diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 00000000000..c44b09af826 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,46 @@ +name: 'Builder' +description: 'build project' +inputs: + path: + description: 'project root path' + required: true + job-name: + description: 'Job name' + required: true + build-commands: + description: 'Build Commands' + required: true +outputs: + logs: + description: "logs" + value: ${{ steps.build.outputs.logs }} + path: + description: "output path" + value: ${{ steps.build.outputs.path }} +runs: + using: "composite" + steps: + - id: build + name: build + run: | + buildlogfile=${{ inputs.job-name }}-build.log + echo "::set-output name=path::$(echo generated/${{ inputs.job-name }})" + curdir=$(pwd) + echo -e "\n****** BUILD ******\n" >> $curdir/$buildlogfile + cd ${{ inputs.path }} + echo -e "${{ inputs.build-commands }}" > $curdir/buildcommands.log + echo "::set-output name=logs::$(echo $curdir/$buildlogfile)" + buildcommands=$(cat $curdir/buildcommands.log) + + while [ "$buildcommands" ] ;do + iter=${buildcommands%%__&&__*} + echo -e "\n****** executing: $iter ******\n" + echo -e "\n****** executing: $iter ******\n" >> $curdir/$buildlogfile + $iter 2>&1 | tee --append $curdir/$buildlogfile + [ "$buildcommands" = "$iter" ] && \ + buildcommands='' || \ + buildcommands="${buildcommands#*__&&__}" + done + cd ${curdir} + echo "::set-output name=logs::$(echo $curdir/$buildlogfile)" + shell: bash diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml new file mode 100644 index 00000000000..53ac0b8d604 --- /dev/null +++ b/.github/actions/generate/action.yml @@ -0,0 +1,39 @@ +name: 'Generate' +description: 'codegen generate' +inputs: + spec-url: + description: 'Url of the openapi definition' + required: true + default: 'https://petstore3.swagger.io/api/v3/openapi.json' + language: + description: 'Language to generate' + required: true + job-name: + description: 'Job name' + required: true + options: + description: 'Language Options' + required: false + default: "" +outputs: + logs: + description: "logs" + value: ${{ steps.generate.outputs.logs }} + path: + description: "output path" + value: ${{ steps.generate.outputs.path }} +runs: + using: "composite" + steps: + - id: generate + name: generate + run: | + logfile=${{ inputs.job-name }}.log + chmod +x ${{ github.action_path }}/generate.sh + echo "${{ inputs.language }} ${{ inputs.job-name }} ${{ inputs.spec-url }} ${{ inputs.options }}" + echo -e "\n****** generate ******\n" > $logfile + echo "::set-output name=logs::$(echo $logfile)" + ${{ github.action_path }}/generate.sh ${{ inputs.language }} ${{ inputs.job-name }} ${{ inputs.spec-url }} ${{ inputs.options }} 2>&1 | tee --append $logfile + echo "::set-output name=path::$(echo generated/${{ inputs.job-name }})" + echo "::set-output name=logs::$(echo $logfile)" + shell: bash diff --git a/.github/actions/generate/generate.sh b/.github/actions/generate/generate.sh new file mode 100755 index 00000000000..56364921e4b --- /dev/null +++ b/.github/actions/generate/generate.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + + +executable="swagger-codegen-cli.jar" + +LANG=$1 + +echo "LANGUAGE $LANG" + +JOB_NAME=$2 + +echo "JOB_NAME $JOB_NAME" + +if [ -z "$JOB_NAME" ] +then + JOB_NAME=$LANG +fi + +SPEC_URL=$3 + +echo "SPEC_URL PARAM $SPEC_URL" + +if [[ $SPEC_URL == "null" ]]; +then + SPEC_URL="https://petstore3.swagger.io/api/v3/openapi.json" +fi + +echo "SPEC_URL $SPEC_URL" + +shift; +shift; +shift; + +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -Dlogback.configurationFile=$SCRIPT/logback.xml" +ags="generate -i ${SPEC_URL} -l ${LANG} -o generated/${JOB_NAME} $@" + +java $JAVA_OPTS -jar $executable $ags + + diff --git a/.github/actions/generate/logback.xml b/.github/actions/generate/logback.xml new file mode 100644 index 00000000000..49a66bc59bb --- /dev/null +++ b/.github/actions/generate/logback.xml @@ -0,0 +1,12 @@ + + + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n + + + + + + + diff --git a/.github/workflows/test-framework-ada.yml b/.github/workflows/test-framework-ada.yml new file mode 100644 index 00000000000..163c243da3a --- /dev/null +++ b/.github/workflows/test-framework-ada.yml @@ -0,0 +1,194 @@ +name: Test Framework PHP + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - uses: ada-actions/toolchain@dev + with: + distrib: fsf + target: native + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-clojure.yml b/.github/workflows/test-framework-clojure.yml new file mode 100644 index 00000000000..82643c68277 --- /dev/null +++ b/.github/workflows/test-framework-clojure.yml @@ -0,0 +1,200 @@ +name: Test Framework Clojure + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + - name: Install clojure tools + uses: DeLaGuardo/setup-clojure@3.2 + with: + cli: 1.10.1.693 + lein: 2.9.1 + boot: 2.8.3 + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-dart.yml b/.github/workflows/test-framework-dart.yml new file mode 100644 index 00000000000..25ac105a509 --- /dev/null +++ b/.github/workflows/test-framework-dart.yml @@ -0,0 +1,182 @@ +name: Test Framework DART + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - uses: dart-lang/setup-dart@v1 + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-dotnet.yml b/.github/workflows/test-framework-dotnet.yml new file mode 100644 index 00000000000..4b0afc215ec --- /dev/null +++ b/.github/workflows/test-framework-dotnet.yml @@ -0,0 +1,194 @@ +name: Test Framework DotNet + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + dotnet-version: [3.1.x] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up DotNet 3.1.x + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ matrix.dotnet-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-elixir.yml b/.github/workflows/test-framework-elixir.yml new file mode 100644 index 00000000000..74dd51d32c0 --- /dev/null +++ b/.github/workflows/test-framework-elixir.yml @@ -0,0 +1,185 @@ +name: Test Framework Elixir + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - uses: actions/setup-elixir@v1 + with: + otp-version: '22.2' + elixir-version: '1.9.4' + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-go.yml b/.github/workflows/test-framework-go.yml new file mode 100644 index 00000000000..b440cacbd26 --- /dev/null +++ b/.github/workflows/test-framework-go.yml @@ -0,0 +1,184 @@ +name: Test Framework Golang + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - uses: actions/setup-go@v2 + with: + go-version: '^1.13.1' + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-java.yml b/.github/workflows/test-framework-java.yml new file mode 100644 index 00000000000..d58a32a8596 --- /dev/null +++ b/.github/workflows/test-framework-java.yml @@ -0,0 +1,194 @@ +name: Test Framework JAVA + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-java11.yml b/.github/workflows/test-framework-java11.yml new file mode 100644 index 00000000000..d930dcd5c60 --- /dev/null +++ b/.github/workflows/test-framework-java11.yml @@ -0,0 +1,194 @@ +name: Test Framework JAVA 11 + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 11 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 11 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [ 11 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-js.yml b/.github/workflows/test-framework-js.yml new file mode 100644 index 00000000000..2c84f2c3005 --- /dev/null +++ b/.github/workflows/test-framework-js.yml @@ -0,0 +1,194 @@ +name: Test Framework JS + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-lua.yml b/.github/workflows/test-framework-lua.yml new file mode 100644 index 00000000000..1e7261f4fe9 --- /dev/null +++ b/.github/workflows/test-framework-lua.yml @@ -0,0 +1,185 @@ +name: Test Framework Lua + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - uses: leafo/gh-actions-lua@v8.0.0 + with: + luaVersion: "5.1.5" + - uses: leafo/gh-actions-luarocks@v2 + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-no-build.yml b/.github/workflows/test-framework-no-build.yml new file mode 100644 index 00000000000..53acb4291e2 --- /dev/null +++ b/.github/workflows/test-framework-no-build.yml @@ -0,0 +1,129 @@ +name: Test Framework No Build + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} diff --git a/.github/workflows/test-framework-php.yml b/.github/workflows/test-framework-php.yml new file mode 100644 index 00000000000..b7e9e03c33b --- /dev/null +++ b/.github/workflows/test-framework-php.yml @@ -0,0 +1,195 @@ +name: Test Framework PHP + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Setup PHP with composer v2 + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + tools: composer:v2 + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }}/SwaggerClient-php + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-python.yml b/.github/workflows/test-framework-python.yml new file mode 100644 index 00000000000..61c03b76841 --- /dev/null +++ b/.github/workflows/test-framework-python.yml @@ -0,0 +1,194 @@ +name: Test Framework Python + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + python-version: [3.x] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-ruby.yml b/.github/workflows/test-framework-ruby.yml new file mode 100644 index 00000000000..a6b968361cd --- /dev/null +++ b/.github/workflows/test-framework-ruby.yml @@ -0,0 +1,194 @@ +name: Test Framework Ruby + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + ruby: ['3.0'] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-sbt.yml b/.github/workflows/test-framework-sbt.yml new file mode 100644 index 00000000000..cf22a1a2cff --- /dev/null +++ b/.github/workflows/test-framework-sbt.yml @@ -0,0 +1,198 @@ +name: Test Framework SBT + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "3.0.0"] + inputs: + language: + description: 'Language' + required: true + specUrl: + description: 'URL of OpenAPI doc' + required: true + default: "https://petstore3.swagger.io/api/v3/openapi.json" + options: + description: 'language options' + default: '' + jobName: + description: 'job name' + required: true + buildCommands: + description: 'build commands for generated code' + required: true + version: + description: 'exact release or snapshot codegen version' + required: true + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + if [[ ${{ env.VERSION }} == 3* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + elif [[ ${{ env.VERSION }} == 2* ]] + then + echo "DOWNLOADING ${{ env.VERSION }}" + wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/${{ env.VERSION }}/swagger-codegen-cli-${{ env.VERSION }}.jar -O codegen-cli/swagger-codegen-cli.jar + else + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + fi + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ${{ env.LANGUAGE }} + job-name: ${{ env.JOB_NAME }} + spec-url: ${{ env.SPEC_URL }} + options: ${{ env.OPTIONS }} + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} + VERSION: ${{ github.event.inputs.version }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: Setup Scala + uses: olafurpg/setup-scala@v10 + with: + java-version: "adopt@1.8" + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: ${{ env.BUILD_COMMANDS }} + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: ${{ github.event.inputs.jobName }} + OPTIONS: ${{ github.event.inputs.options }} + SPEC_URL: ${{ github.event.inputs.specUrl }} + BUILD_COMMANDS: ${{ github.event.inputs.buildCommands }} diff --git a/.github/workflows/test-framework-v2-ada.yml b/.github/workflows/test-framework-v2-ada.yml new file mode 100644 index 00000000000..a3bd90901f2 --- /dev/null +++ b/.github/workflows/test-framework-v2-ada.yml @@ -0,0 +1,145 @@ +name: Test Framework V2 Ada Sample + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: javascript + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DprojectName=Petstore --model-package Samples.Petstore + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "ada-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - uses: ada-actions/toolchain@dev + with: + distrib: fsf + target: native + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "gprbuild -Ppetstore -p" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "ada-v2-sample" diff --git a/.github/workflows/test-framework-v2-inflector.yml b/.github/workflows/test-framework-v2-inflector.yml new file mode 100644 index 00000000000..e964cc529b6 --- /dev/null +++ b/.github/workflows/test-framework-v2-inflector.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Inflector + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "inflector" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " " + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "inflector-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "inflector-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-8-jersey2.yml b/.github/workflows/test-framework-v2-java-8-jersey2.yml new file mode 100644 index 00000000000..d8e8ae40a53 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-8-jersey2.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java 8 Jersey2 + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library jersey2 --additional-properties dateLibrary=java8" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-8-jersey2-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-8-jersey2-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-feign.yml b/.github/workflows/test-framework-v2-java-feign.yml new file mode 100644 index 00000000000..606c6936ec2 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-feign.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Feign + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library feign" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-feign-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-feign-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-google-api.yml b/.github/workflows/test-framework-v2-java-google-api.yml new file mode 100644 index 00000000000..8f6dd529888 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-google-api.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Google Api Client + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library google-api-client" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-google-api-client-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-google-api-client-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-jersey1.yml b/.github/workflows/test-framework-v2-java-jersey1.yml new file mode 100644 index 00000000000..cf3063025bc --- /dev/null +++ b/.github/workflows/test-framework-v2-java-jersey1.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Jersey 1 + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library jersey1" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-jersey-1-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-jersey-1-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-jersey2.yml b/.github/workflows/test-framework-v2-java-jersey2.yml new file mode 100644 index 00000000000..256de234879 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-jersey2.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Jersey 2 + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library jersey2" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-jersey-2-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-jersey-2-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-okhttp-parcelable.yml b/.github/workflows/test-framework-v2-java-okhttp-parcelable.yml new file mode 100644 index 00000000000..4546f2faa6f --- /dev/null +++ b/.github/workflows/test-framework-v2-java-okhttp-parcelable.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Ok Http-Gson Parcelable + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library=okhttp-gson -DparcelableModel=true" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-ok-http-gson-parcelable-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-ok-http-gson-parcelable-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-okhttp.yml b/.github/workflows/test-framework-v2-java-okhttp.yml new file mode 100644 index 00000000000..d2ee8cefab8 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-okhttp.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Ok Http-Gson + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library okhttp-gson" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-ok-http-gson-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-ok-http-gson-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-pkmst.yml b/.github/workflows/test-framework-v2-java-pkmst.yml new file mode 100644 index 00000000000..d3ebbb40420 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-pkmst.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Pkmst + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java-pkmst" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml" + options: " " + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-pkmst-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-pkmst-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-rest-assured.yml b/.github/workflows/test-framework-v2-java-rest-assured.yml new file mode 100644 index 00000000000..881ae231a49 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-rest-assured.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Rest Assured + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library rest-assured" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-rest-assured-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-rest-assured-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-resteasy.yml b/.github/workflows/test-framework-v2-java-resteasy.yml new file mode 100644 index 00000000000..63dc571bce1 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-resteasy.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Resteasy + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library resteasy" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-resteasy-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-resteasy-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-resttemplate-with-xml.yml b/.github/workflows/test-framework-v2-java-resttemplate-with-xml.yml new file mode 100644 index 00000000000..b31690560d1 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-resttemplate-with-xml.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Resttemplate XML + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library resttemplate -DwithXml=true" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-resttemplate-xml-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-resttemplate-xml-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-resttemplate.yml b/.github/workflows/test-framework-v2-java-resttemplate.yml new file mode 100644 index 00000000000..0fec4b4d869 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-resttemplate.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Resttemplate + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library resttemplate" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-resttemplate-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-resttemplate-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-retrofit.yml b/.github/workflows/test-framework-v2-java-retrofit.yml new file mode 100644 index 00000000000..d125ac1e7ef --- /dev/null +++ b/.github/workflows/test-framework-v2-java-retrofit.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Retrofit + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library retrofit -DdateLibrary=joda" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-retrofit2-play24.yml b/.github/workflows/test-framework-v2-java-retrofit2-play24.yml new file mode 100644 index 00000000000..0028c1aaa63 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-retrofit2-play24.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Retrofit2 Play24 + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library retrofit2 --additional-properties useBeanValidation=true,enableBuilderSupport=true,usePlayWS=true,playVersion=play24,dateLibrary=java8" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit2-play24-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit2-play24-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-retrofit2-play25.yml b/.github/workflows/test-framework-v2-java-retrofit2-play25.yml new file mode 100644 index 00000000000..09296c95bce --- /dev/null +++ b/.github/workflows/test-framework-v2-java-retrofit2-play25.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Retrofit2 Play25 + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library retrofit2 --additional-properties useBeanValidation=true,enableBuilderSupport=true,usePlayWS=true,playVersion=play25" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit2-play25-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit2-play25-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-retrofit2.yml b/.github/workflows/test-framework-v2-java-retrofit2.yml new file mode 100644 index 00000000000..7476ae4a37d --- /dev/null +++ b/.github/workflows/test-framework-v2-java-retrofit2.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Retrofit2 + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library retrofit2" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit2-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit2-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-retrofit2rx.yml b/.github/workflows/test-framework-v2-java-retrofit2rx.yml new file mode 100644 index 00000000000..e00c78cffe5 --- /dev/null +++ b/.github/workflows/test-framework-v2-java-retrofit2rx.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Retrofit2 RX + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library retrofit2 -DuseRxJava=true" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit2-rx-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit2-rx-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-retrofit2rx2.yml b/.github/workflows/test-framework-v2-java-retrofit2rx2.yml new file mode 100644 index 00000000000..aea448a864b --- /dev/null +++ b/.github/workflows/test-framework-v2-java-retrofit2rx2.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Retrofit2 RX2 + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library retrofit2 -DuseRxJava2=true" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit2-rx2-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit2-rx2-v2-sample" diff --git a/.github/workflows/test-framework-v2-java-vertx.yml b/.github/workflows/test-framework-v2-java-vertx.yml new file mode 100644 index 00000000000..4457ad8a5fd --- /dev/null +++ b/.github/workflows/test-framework-v2-java-vertx.yml @@ -0,0 +1,151 @@ +name: Test Framework V2 Java Vertx + +on: + # execute on demand + workflow_dispatch: + branches: ['master'] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING Codegen" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: "java" + job-name: ${{ env.JOB_NAME }} + spec-url: "https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml" + options: " --library vertx" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-vertx-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-vertx-v2-sample" diff --git a/.github/workflows/test-framework-v2-javascript.yml b/.github/workflows/test-framework-v2-javascript.yml new file mode 100644 index 00000000000..6c4589243ce --- /dev/null +++ b/.github/workflows/test-framework-v2-javascript.yml @@ -0,0 +1,172 @@ +name: Test Framework V2 Javascript + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + + mkdir test-cfg-files + cp samples/client/petstore/javascript/pom.xml test-cfg-files + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + - name: upload test cfg file + uses: actions/upload-artifact@v2 + with: + name: test-cfg-files + path: test-cfg-files + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: javascript + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: -DappName=PetstoreClient --additional-properties useES6=false + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "javascript-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download Javascript V2 test cfg files + uses: actions/download-artifact@v2 + with: + name: test-cfg-files + path: generated/${{ env.JOB_NAME }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: mvn verify + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "javascript-v2-sample" diff --git a/.github/workflows/test-framework-v2-php.yml b/.github/workflows/test-framework-v2-php.yml new file mode 100644 index 00000000000..e69f987f321 --- /dev/null +++ b/.github/workflows/test-framework-v2-php.yml @@ -0,0 +1,175 @@ +name: Test Framework V2 PHP + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + + mkdir test-cfg-files + cp -r samples/client/petstore/php/SwaggerClient-php/tests test-cfg-files + cp samples/client/petstore/php/SwaggerClient-php/autoload.php test-cfg-files + cp samples/client/petstore/php/SwaggerClient-php/pom.xml test-cfg-files + cp samples/client/petstore/php/SwaggerClient-php/phpcs-generated-code.xml test-cfg-files + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + - name: upload test cfg file + uses: actions/upload-artifact@v2 + with: + name: test-cfg-files + path: test-cfg-files + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: php + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: " --additional-properties composerVendorName=swagger,composerProjectName=swagger_codegen" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "php-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download PHP V2 test cfg files + uses: actions/download-artifact@v2 + with: + name: test-cfg-files + path: generated/SwaggerClient-php/${{ env.JOB_NAME }} + - name: Setup PHP with composer v2 + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + tools: composer:v2 + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }}/SwaggerClient-php + job-name: ${{ env.JOB_NAME }} + build-commands: "composer install__&&__./vendor/bin/phpunit test" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "php-v2-sample" diff --git a/.github/workflows/test-framework-v2-python-asyncio.yml b/.github/workflows/test-framework-v2-python-asyncio.yml new file mode 100644 index 00000000000..746efb80124 --- /dev/null +++ b/.github/workflows/test-framework-v2-python-asyncio.yml @@ -0,0 +1,171 @@ +name: Test Framework V2 Python Asyncio + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING latest" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + ls modules/swagger-codegen-cli/target/ + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + + mkdir python-v2-sample-test-config-files + cp samples/client/petstore/python/tests -r python-v2-sample-test-config-files + cp samples/client/petstore/python/Makefile python-v2-sample-test-config-files + cp samples/client/petstore/python/pom.xml python-v2-sample-test-config-files + cp samples/client/petstore/python/setup.cfg python-v2-sample-test-config-files + cp samples/client/petstore/python/setup.cfg python-v2-sample-test-config-files + cp samples/client/petstore/python/test_python2.sh python-v2-sample-test-config-files + cp samples/client/petstore/python/test_python2_and_3.sh python-v2-sample-test-config-files + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + - name: upload python test cfg files + uses: actions/upload-artifact@v2 + with: + name: python-v2-sample-test-config-files + path: python-v2-sample-test-config-files + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: python + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: -DpackageName=petstore_api --library asyncio + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "python-asyncio-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + python-version: [3.x] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Download Python V2 test cfg files + uses: actions/download-artifact@v2 + with: + name: python-v2-sample-test-config-files + path: generated/${{ env.JOB_NAME }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: make test-all + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "python-asyncio-v2-sample" diff --git a/.github/workflows/test-framework-v2-python.yml b/.github/workflows/test-framework-v2-python.yml new file mode 100644 index 00000000000..da4705d676c --- /dev/null +++ b/.github/workflows/test-framework-v2-python.yml @@ -0,0 +1,171 @@ +name: Test Framework V2 Python + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING latest" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + ls modules/swagger-codegen-cli/target/ + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + + mkdir python-v2-sample-test-config-files + cp samples/client/petstore/python/tests -r python-v2-sample-test-config-files + cp samples/client/petstore/python/Makefile python-v2-sample-test-config-files + cp samples/client/petstore/python/pom.xml python-v2-sample-test-config-files + cp samples/client/petstore/python/setup.py python-v2-sample-test-config-files + cp samples/client/petstore/python/setup.cfg python-v2-sample-test-config-files + cp samples/client/petstore/python/test_python2.sh python-v2-sample-test-config-files + cp samples/client/petstore/python/test_python2_and_3.sh python-v2-sample-test-config-files + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + - name: upload python test cfg files + uses: actions/upload-artifact@v2 + with: + name: python-v2-sample-test-config-files + path: python-v2-sample-test-config-files + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: python + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: -DpackageName=petstore_api + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "python-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + python-version: [3.x] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Download Python V2 test cfg files + uses: actions/download-artifact@v2 + with: + name: python-v2-sample-test-config-files + path: generated/${{ env.JOB_NAME }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "python setup.py install__&&__pip install tox__&&__make test-all" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "python-v2-sample" diff --git a/.github/workflows/test-framework-v2-ruby.yml b/.github/workflows/test-framework-v2-ruby.yml new file mode 100644 index 00000000000..9d5c404e9cd --- /dev/null +++ b/.github/workflows/test-framework-v2-ruby.yml @@ -0,0 +1,175 @@ +name: Test Framework V2 Ruby + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + + mkdir test-cfg-files + cp samples/client/petstore/ruby/pom.xml test-cfg-files + cp samples/client/petstore/ruby/petstore_profiling.rb test-cfg-files + cp samples/client/petstore/ruby/press_anykey_to_continue.sh test-cfg-files + cp samples/client/petstore/ruby/Rakefile test-cfg-files + + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + - name: upload test cfg file + uses: actions/upload-artifact@v2 + with: + name: test-cfg-files + path: test-cfg-files + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ruby + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: -DgemName=petstore,moduleName=Petstore,gemVersion=1.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + JOB_NAME: "ruby-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + ruby: ['2.2'] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download Ruby V2 test cfg files + uses: actions/download-artifact@v2 + with: + name: test-cfg-files + path: generated/${{ env.JOB_NAME }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: mvn verify + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "ruby-v2-sample" diff --git a/.github/workflows/test-framework-v2-scala.yml b/.github/workflows/test-framework-v2-scala.yml new file mode 100644 index 00000000000..5af60e4888d --- /dev/null +++ b/.github/workflows/test-framework-v2-scala.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Scala + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: scala + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: "" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + JOB_NAME: "scala-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: mvn verify + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "scala-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v10.yml b/.github/workflows/test-framework-v2-ts-angular-v10.yml new file mode 100644 index 00000000000..caf111efeba --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v10.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v10 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=10.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v10-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v10-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v11.yml b/.github/workflows/test-framework-v2-ts-angular-v11.yml new file mode 100644 index 00000000000..e864ca95050 --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v11.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v11 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=11.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v11-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v11-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v12.yml b/.github/workflows/test-framework-v2-ts-angular-v12.yml new file mode 100644 index 00000000000..13894d36f21 --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v12.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v12 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=12.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v12-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v12-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v4.yml b/.github/workflows/test-framework-v2-ts-angular-v4.yml new file mode 100644 index 00000000000..297e0911940 --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v4.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v4 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=4 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v4-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v4-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v4_3.yml b/.github/workflows/test-framework-v2-ts-angular-v4_3.yml new file mode 100644 index 00000000000..01f0c8d995f --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v4_3.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v4.3 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=4.3 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v4.3-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v4.3-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v5.yml b/.github/workflows/test-framework-v2-ts-angular-v5.yml new file mode 100644 index 00000000000..8443b35d25e --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v5.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v5 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=5 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v5-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v5-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v6.yml b/.github/workflows/test-framework-v2-ts-angular-v6.yml new file mode 100644 index 00000000000..ed405d37830 --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v6.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v6 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=6 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v4-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v6-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v7.yml b/.github/workflows/test-framework-v2-ts-angular-v7.yml new file mode 100644 index 00000000000..27113575667 --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v7.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v7 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=7.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v7-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v7-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v8.yml b/.github/workflows/test-framework-v2-ts-angular-v8.yml new file mode 100644 index 00000000000..c58ae1c9260 --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v8.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v8 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=8.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v8-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v8-v2-sample" diff --git a/.github/workflows/test-framework-v2-ts-angular-v9.yml b/.github/workflows/test-framework-v2-ts-angular-v9.yml new file mode 100644 index 00000000000..c063dfdaa46 --- /dev/null +++ b/.github/workflows/test-framework-v2-ts-angular-v9.yml @@ -0,0 +1,156 @@ +name: Test Framework V2 Typescript Angular v9 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + env: + VERSION: ${{ github.event.inputs.version }} + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: typescript-angular + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml + options: -DnpmName=@swagger/angular2-typescript-petstore,npmVersion=0.0.1,npmRepository=https://skimdb.npmjs.com/registry,snapshot=false,ngVersion=9.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "typescript-angular-v9-v2-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "npm install -g @angular/cli__&&__npm install -g ng-packagr__&&__npm i__&&__npm run build" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + LANGUAGE: ${{ github.event.inputs.language }} + JOB_NAME: "typescript-angular-v9-v2-sample" diff --git a/.github/workflows/test-framework-v3-java-feign.yml b/.github/workflows/test-framework-v3-java-feign.yml new file mode 100644 index 00000000000..043dac27daf --- /dev/null +++ b/.github/workflows/test-framework-v3-java-feign.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Feign + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library feign --artifact-id swagger-petstore-feign --additional-properties java8=true + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-feign-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-feign-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-inflector.yml b/.github/workflows/test-framework-v3-java-inflector.yml new file mode 100644 index 00000000000..2cf6335befe --- /dev/null +++ b/.github/workflows/test-framework-v3-java-inflector.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 Inflector + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --artifact-id swagger-petstore-inflector + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "inflector-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "inflector-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-jersey1.yml b/.github/workflows/test-framework-v3-java-jersey1.yml new file mode 100644 index 00000000000..f27be24f8d1 --- /dev/null +++ b/.github/workflows/test-framework-v3-java-jersey1.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Jersey 1 + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library jersey1 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-jersey1-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-jersey1-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-jersey2.yml b/.github/workflows/test-framework-v3-java-jersey2.yml new file mode 100644 index 00000000000..d11ac733ff1 --- /dev/null +++ b/.github/workflows/test-framework-v3-java-jersey2.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Jersey 2 + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library jersey2 --artifact-id swagger-petstore-jersey2 --additional-properties java8=true + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-jersey2-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-jersey2-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-okhttp-gson.yml b/.github/workflows/test-framework-v3-java-okhttp-gson.yml new file mode 100644 index 00000000000..97780a37734 --- /dev/null +++ b/.github/workflows/test-framework-v3-java-okhttp-gson.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA okhttp-gson + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library okhttp-gson --artifact-id swagger-petstore-okhttp-gson + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-okhttp-gson-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-okhttp-gson-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-resteasy.yml b/.github/workflows/test-framework-v3-java-resteasy.yml new file mode 100644 index 00000000000..0d87de089fc --- /dev/null +++ b/.github/workflows/test-framework-v3-java-resteasy.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Resteasy + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library resteasy --artifact-id swagger-petstore-resteasy + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-resttemplate-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-resttemplate-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-resttemplate-withXml.yml b/.github/workflows/test-framework-v3-java-resttemplate-withXml.yml new file mode 100644 index 00000000000..70e203295f3 --- /dev/null +++ b/.github/workflows/test-framework-v3-java-resttemplate-withXml.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Resttemplate withXml + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library resttemplate --artifact-id swagger-petstore-resttemplate -DwithXml=true + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-resttemplate-withxml-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-resttemplate-withxml-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-resttemplate.yml b/.github/workflows/test-framework-v3-java-resttemplate.yml new file mode 100644 index 00000000000..1d160282139 --- /dev/null +++ b/.github/workflows/test-framework-v3-java-resttemplate.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Resttemplate + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library resttemplate --artifact-id swagger-petstore-resttemplate + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-resttemplate-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-resttemplate-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-retrofit.yml b/.github/workflows/test-framework-v3-java-retrofit.yml new file mode 100644 index 00000000000..eb2864e513b --- /dev/null +++ b/.github/workflows/test-framework-v3-java-retrofit.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Retrofit + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library retrofit --artifact-id swagger-petstore-retrofit + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-retrofit2.yml b/.github/workflows/test-framework-v3-java-retrofit2.yml new file mode 100644 index 00000000000..372a28c54bf --- /dev/null +++ b/.github/workflows/test-framework-v3-java-retrofit2.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Retrofit2 + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library retrofit2 --artifact-id swagger-petstore-retrofit2 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit2-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit2-v3-sample" diff --git a/.github/workflows/test-framework-v3-java-retrofit2rx.yml b/.github/workflows/test-framework-v3-java-retrofit2rx.yml new file mode 100644 index 00000000000..6dbb7a38dea --- /dev/null +++ b/.github/workflows/test-framework-v3-java-retrofit2rx.yml @@ -0,0 +1,153 @@ +name: Test Framework V3 JAVA Retrofit2Rx + +on: + # execute on demand + workflow_dispatch: + branches: ["3.0.0"] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + with: + ref: 3.0.0 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING 3.0.0" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + + generate: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: java + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: --library retrofit2 --artifact-id swagger-petstore-retrofit2rx -DuseRxJava=true + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + env: + JOB_NAME: "java-retrofit2rx-v3-sample" + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + java-version: [1.8] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: "mvn clean package -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "java-retrofit2rx-v3-sample" diff --git a/.github/workflows/test-generation-v2.yml b/.github/workflows/test-generation-v2.yml new file mode 100644 index 00000000000..0bdb2d09e10 --- /dev/null +++ b/.github/workflows/test-generation-v2.yml @@ -0,0 +1,433 @@ +name: Test Generation V2 + +on: + # execute on demand + workflow_dispatch: + branches: ["master"] + # execute on PRs + pull_request: + branches: [ "master" ] + # execute on merge + push: + branches: [ "master" ] + +jobs: + + # builds codegen cli and uploads its artifact + build-codegen: + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mkdir codegen-cli + echo "BUILDING ${{ env.VERSION }}" + mvn -version + mvn -q -B package -DskipTests -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.httpconnectionManager.ttlSeconds=120 -Dmaven.wagon.http.retryHandler.count=3 + cp modules/swagger-codegen-cli/target/swagger-codegen-cli.jar codegen-cli + + - name: upload codegen cli + uses: actions/upload-artifact@v2 + with: + name: codegen-cli + path: codegen-cli + env: + VERSION: ${{ github.event.inputs.version }} + + ###################### + ##### RUBY ##### + ###################### + generate-ruby: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: ruby + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: -DgemName=petstore,moduleName=Petstore,gemVersion=1.0.0 + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + JOB_NAME: "ruby-v2-sample" + + build-ruby: + + needs: generate-ruby + if: contains(needs.generate-ruby.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + ruby: ['2.2'] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Set up Ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: ${{ matrix.ruby }} + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: ruby test files + run: | + cp samples/client/petstore/ruby/pom.xml generated/${{ env.JOB_NAME }} + cp samples/client/petstore/ruby/petstore_profiling.rb generated/${{ env.JOB_NAME }} + cp samples/client/petstore/ruby/press_anykey_to_continue.sh generated/${{ env.JOB_NAME }} + cp samples/client/petstore/ruby/Rakefile generated/${{ env.JOB_NAME }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: mvn verify + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "ruby-v2-sample" + + ###################### + ##### JAVASCRIPT ##### + ###################### + generate-javascript: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: javascript + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: -DappName=PetstoreClient --additional-properties useES6=false + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + JOB_NAME: "javascript-v2-sample" + + build-javascript: + + needs: generate-javascript + if: contains(needs.generate-javascript.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Javascript test files + run: | + cp samples/client/petstore/javascript/pom.xml generated/${{ env.JOB_NAME }} + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + build-commands: mvn verify + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "javascript-v2-sample" + + ###################### + ##### PHP ##### + ###################### + generate-php: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + matrix: + java: [ 8 ] + + + outputs: + generate_outcome: ${{ steps.outcome.outputs.generate_outcome }} + + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: Download codegen cli + uses: actions/download-artifact@v2 + with: + name: codegen-cli + - name: generate + id: generate + continue-on-error: true + uses: ./.github/actions/generate + with: + language: php + job-name: ${{ env.JOB_NAME }} + spec-url: https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml + options: " --additional-properties composerVendorName=swagger,composerProjectName=swagger_codegen" + - id: outcome + run: | + echo "::set-output name=generate_outcome::${{ steps.generate.outcome }}" + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_outcome + path: generate_outcome_${{ env.JOB_NAME }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: ${{ steps.generate.outputs.path }} + + env: + JOB_NAME: "php-v2-sample" + + build-php: + + needs: generate-php + if: contains(needs.generate-php.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + matrix: + node-version: [12.x] + java: [ 8 ] + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generated + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: ${{ env.JOB_NAME }}generate_logs + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: PHP test files + run: | + cp -r samples/client/petstore/php/SwaggerClient-php/tests generated/${{ env.JOB_NAME }} + cp samples/client/petstore/php/SwaggerClient-php/autoload.php generated/${{ env.JOB_NAME }} + cp samples/client/petstore/php/SwaggerClient-php/pom.xml generated/${{ env.JOB_NAME }} + cp samples/client/petstore/php/SwaggerClient-php/phpcs-generated-code.xml generated/${{ env.JOB_NAME }} + - name: Setup PHP with composer v2 + uses: shivammathur/setup-php@v2 + with: + php-version: '7.4' + tools: composer:v2 + ############################################### + ##### END DYNAMIC: Dependent on build environment + ############################################### + - name: build + id: build + uses: ./.github/actions/build + with: + path: generated/${{ env.JOB_NAME }}/SwaggerClient-php + job-name: ${{ env.JOB_NAME }} + build-commands: "composer install__&&__./vendor/bin/phpunit test" + - id: outcome + run: | + echo "::set-output name=build_outcome::${{ steps.build.outcome }}" + echo ${{ steps.build.outcome }} > ${{ env.JOB_NAME }}build_outcome + - name: upload build outcome + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}build_outcome + path: ${{ env.JOB_NAME }}build_outcome + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ env.JOB_NAME }}logs + path: ${{ steps.build.outputs.logs }} + env: + JOB_NAME: "php-v2-sample" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7f3231f6b4f..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,100 +0,0 @@ -sudo: required -language: java -dist: trusty -jdk: - - openjdk8 - -cache: - directories: - - $HOME/.m2 - - $HOME/.ivy2 - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - - $HOME/samples/client/petstore/php/SwaggerClient-php/vendor - - $HOME/samples/client/petstore/ruby/venodr/bundle - - $HOME/samples/client/petstore/python/.venv/ - - $HOME/samples/client/petstore/typescript-node/npm/node_modules - - $HOME/samples/client/petstore/typescript-node/npm/typings/ - - $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules - - $HOME/samples/client/petstore/typescript-fetch/tests/default/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules - - $HOME/samples/client/petstore/typescript-fetch/builds/default/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules - - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules - - $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings - - $HOME/samples/client/petstore/typescript-angular/node_modules - - $HOME/samples/client/petstore/typescript-angular/typings - -services: - - docker - -# comment out the host table change to use the public petstore server -addons: - hosts: - - petstore.swagger.io - -before_install: - # required when sudo: required for the Ruby petstore tests - - gem install bundler -v '< 2' - - gem update --system 2.7.8 - - gem --version - - npm install -g typescript - - npm install -g npm - - npm config set registry http://registry.npmjs.org/ - # set python 3.6.3 as default - - source ~/virtualenv/python3.6/bin/activate - # to run petstore server locally via docker - - docker pull swaggerapi/petstore - - docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - - docker ps -a - # Add bats test framework and cURL for Bash script integration tests - - sudo add-apt-repository ppa:duggan/bats --yes - - sudo apt-get update -qq - - sudo apt-get install -qq bats - - sudo apt-get install -qq curl - # comment out below as installation failed in travis - # Add rebar3 build tool and recent Erlang/OTP for Erlang petstore server tests. - # - Travis CI does not support rebar3 [yet](https://github.com/travis-ci/travis-ci/issues/6506#issuecomment-275189490). - # - Rely on `kerl` for [pre-compiled versions available](https://docs.travis-ci.com/user/languages/erlang#Choosing-OTP-releases-to-test-against). Rely on installation path chosen by [`travis-erlang-builder`](https://github.com/travis-ci/travis-erlang-builder/blob/e6d016b1a91ca7ecac5a5a46395bde917ea13d36/bin/compile#L18). - # - . ~/otp/18.2.1/activate && erl -version - #- curl -f -L -o ./rebar3 https://s3.amazonaws.com/rebar3/rebar3 && chmod +x ./rebar3 && ./rebar3 version && export PATH="${TRAVIS_BUILD_DIR}:$PATH" - - # show host table to confirm petstore.swagger.io is mapped to localhost - - cat /etc/hosts - # show java version - - java -version - -install: - # Add Godeps dependencies to GOPATH and PATH - - eval "$(curl -sL https://raw.githubusercontent.com/travis-ci/gimme/master/gimme | GIMME_GO_VERSION=1.4 bash)" - - export GOPATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace" - - export PATH="${TRAVIS_BUILD_DIR}/Godeps/_workspace/bin:$PATH" - -script: - # fail fast - - set -e - # fail if templates/generators contain carriage return '\r' - - /bin/bash ./bin/utils/detect_carriage_return.sh - # fail if generators contain merge conflicts - - /bin/bash ./bin/utils/detect_merge_conflict.sh - # fail if generators contain tab '\t' - - /bin/bash ./bin/utils/detect_tab_in_java_class.sh - # run integration tests defined in maven pom.xml - - mvn clean install - - mvn -q --batch-mode verify -Psamples - # Below has been moved to CircleCI - # docker: build generator image and push to Docker Hub - #- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_GENERATOR_IMAGE_NAME ./modules/swagger-generator && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_GENERATOR_IMAGE_NAME:latest $DOCKER_GENERATOR_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_GENERATOR_IMAGE_NAME; fi; fi - ## docker: build cli image and push to Docker Hub - #- if [ $DOCKER_HUB_USERNAME ]; then docker login --email=$DOCKER_HUB_EMAIL --username=$DOCKER_HUB_USERNAME --password=$DOCKER_HUB_PASSWORD && docker build -t $DOCKER_CODEGEN_CLI_IMAGE_NAME ./modules/swagger-codegen-cli && if [ ! -z "$TRAVIS_TAG" ]; then docker tag $DOCKER_CODEGEN_CLI_IMAGE_NAME:latest $DOCKER_CODEGEN_CLI_IMAGE_NAME:$TRAVIS_TAG; fi && if [ ! -z "$TRAVIS_TAG" ] || [ "$TRAVIS_BRANCH" = "master" ]; then docker push $DOCKER_CODEGEN_CLI_IMAGE_NAME; fi; fi - -after_success: - # push a snapshot version to maven repo - #- if [ $SONATYPE_USERNAME ] && [ -z $TRAVIS_TAG ] && [ "$TRAVIS_BRANCH" = "master" ]; then - # mvn clean deploy --settings .travis/settings.xml; - # echo "Finished mvn clean deploy for $TRAVIS_BRANCH"; - # fi; - -env: - - DOCKER_GENERATOR_IMAGE_NAME=swaggerapi/swagger-generator DOCKER_CODEGEN_CLI_IMAGE_NAME=swaggerapi/swagger-codegen-cli diff --git a/.travis.yml.bash b/.travis.yml.bash deleted file mode 100644 index 707e26140df..00000000000 --- a/.travis.yml.bash +++ /dev/null @@ -1,38 +0,0 @@ -sudo: required -language: java -dist: trusty -jdk: - - openjdk8 - -cache: - directories: - - $HOME/.m2 - - $HOME/.ivy2 - -services: - - docker - -addons: - hosts: - - petstore.swagger.io - -before_install: - # to run petstore server locally via docker - - docker pull swaggerapi/petstore - - docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - - docker ps -a - # Add bats test framework and cURL for Bash script integration tests - - sudo add-apt-repository ppa:duggan/bats --yes - - sudo apt-get update -qq - - sudo apt-get install -qq bats - - sudo apt-get install -qq curl - - # show host table to confirm petstore.swagger.io is mapped to localhost - - cat /etc/hosts - -script: - # fail fast - - set -e - # run integration tests defined in maven pom.xml - - cp pom.xml.bash pom.xml - - mvn --batch-mode verify -Psamples diff --git a/.travis.yml.ios b/.travis.yml.ios deleted file mode 100644 index 8fd91938354..00000000000 --- a/.travis.yml.ios +++ /dev/null @@ -1,68 +0,0 @@ -sudo: required -language: objective-c -dist: trusty -osx_image: xcode8.1 -cache: - directories: - - $HOME/.m2 - - $HOME/.ivy2 - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - - $HOME/.stack - - $HOME/samples/client/petstore/php/SwaggerClient-php/vendor - - $HOME/samples/client/petstore/ruby/venodr/bundle - - $HOME/samples/client/petstore/python/.venv/ - - $HOME/samples/client/petstore/typescript-node/npm/node_modules - - $HOME/samples/client/petstore/typescript-node/npm/typings/ - - $HOME/samples/client/petstore/typescript-fetch/tests/default/node_modules - - $HOME/samples/client/petstore/typescript-fetch/tests/default/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/default/node_modules - - $HOME/samples/client/petstore/typescript-fetch/builds/default/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/node_modules - - $HOME/samples/client/petstore/typescript-fetch/builds/es6-target/typings - - $HOME/samples/client/petstore/typescript-fetch/builds/with-npm-version/node_modules - - $HOME/samples/client/petstore/typescript-fetch/npm/with-npm-version/typings - - $HOME/samples/client/petstore/typescript-angularjs/node_modules - - $HOME/samples/client/petstore/typescript-angularjs/typings - - $HOME/.cocoapods/repos/master - timeout: 1000 - -# comment out the host table change to use the public petstore server -addons: - hosts: - - petstore.swagger.io - -before_install: - - export SW=`pwd` - - rvm list - - rvm use 2.3.3 - - gem environment - - gem install bundler -N --no-ri --no-rdoc - - gem install cocoapods -v 1.2.1 -N --no-ri --no-rdoc - - gem install xcpretty -N --no-ri --no-rdoc - - pod --version - # comment out below to avoid errors - #- pod repo update - - pod setup --silent > /dev/null - - mkdir -p ~/.local/bin - - export PATH=$HOME/.local/bin:$PATH - # start local petstore server - - git clone -b docker --single-branch https://github.com/wing328/swagger-samples - - cd swagger-samples/java/java-jersey-jaxrs - - sudo mvn jetty:run & - - cd $SW - - # show host table to confirm petstore.swagger.io is mapped to localhost - - cat /etc/hosts - # show java version - - java -version - # show brew version - - brew --version - # show xcpretty version - - xcpretty -v - # show go version - - go version - -script: - # run integration tests defined in maven pom.xml - - mvn -q --batch-mode verify -Psamples diff --git a/.travis/settings.xml b/.travis/settings.xml deleted file mode 100644 index 7fd9d3e7014..00000000000 --- a/.travis/settings.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - sonatype-nexus-snapshots - ${env.SONATYPE_USERNAME} - ${env.SONATYPE_PASSWORD} - - - - - - - diff --git a/.whitesource b/.whitesource new file mode 100644 index 00000000000..db4b0fec82c --- /dev/null +++ b/.whitesource @@ -0,0 +1,15 @@ +{ + "scanSettings": { + "configMode": "AUTO", + "configExternalURL": "", + "projectToken": "", + "baseBranches": [] + }, + "checkRunSettings": { + "vulnerableCheckRunConclusionLevel": "failure", + "displayMode": "diff" + }, + "issueSettings": { + "minSeverityLevel": "LOW" + } +} \ No newline at end of file diff --git a/LICENSE b/LICENSE index ebfd64c4931..01abb442b99 100644 --- a/LICENSE +++ b/LICENSE @@ -1,11 +1,201 @@ -Copyright 2016 SmartBear Software + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ -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 [apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0) + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION -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. + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2020 SmartBear Software Inc. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 41bd6cf6e5f..57adb5ebc38 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,11 @@ [![Build Status](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master-java7/badge/icon?subject=jenkins%20build%20-%20java%207)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master-java7/) -- Master (2.4.11-SNAPSHOT): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) +- Master (2.4.22-SNAPSHOT): [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/master.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Java Test](https://img.shields.io/jenkins/build.svg?jobUrl=https://jenkins.swagger.io/job/oss-swagger-codegen-master)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-master) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=master&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen) -- 3.0.15-SNAPSHOT: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) +- 3.0.28-SNAPSHOT: [![Build Status](https://img.shields.io/travis/swagger-api/swagger-codegen/3.0.0.svg?label=Petstore%20Integration%20Test)](https://travis-ci.org/swagger-api/swagger-codegen) [![Java Test](https://img.shields.io/jenkins/build.svg?jobUrl=https://jenkins.swagger.io/job/oss-swagger-codegen-3)](https://jenkins.swagger.io/view/OSS%20-%20Java/job/oss-swagger-codegen-3) [![Windows Test](https://ci.appveyor.com/api/projects/status/github/swagger-api/swagger-codegen?branch=3.0.0&svg=true&passingText=Windows%20Test%20-%20OK&failingText=Windows%20Test%20-%20Fails)](https://ci.appveyor.com/project/swaggerhub-bot/swagger-codegen) @@ -52,13 +52,13 @@ dependency example: io.swagger swagger-codegen-maven-plugin - 2.4.10 + 2.4.21 ``` ### Swagger Codegen 3.X ([`3.0.0` branch](https://github.com/swagger-api/swagger-codegen/tree/3.0.0)) -Swagger Codegen 2.X supports OpenAPI version 3 (and version 2 via spec conversion to version 3) +Swagger Codegen 3.X supports OpenAPI version 3 (and version 2 via spec conversion to version 3) [Online generator of version 3.X](https://github.com/swagger-api/swagger-codegen/tree/3.0.0#online-generators) supports both generation from Swagger/OpenAPI version 2 (by using engine + generators of 2.X) and version 3 specifications. group id: `io.swagger.codegen.v3` @@ -70,7 +70,7 @@ dependency example: io.swagger.codegen.v3 swagger-codegen-maven-plugin - 3.0.14 + 3.0.27 ``` @@ -89,7 +89,7 @@ Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for addit # Table of contents - - [Swagger Code Generator](#swagger-code-generator) + - [Versioning](#versioning) - [Overview](#overview) - [Table of Contents](#table-of-contents) - Installation @@ -134,8 +134,21 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- -3.0.15-SNAPSHOT (current 3.0.0, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/codegen/v3/swagger-codegen-cli/3.0.15-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release -[3.0.14](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.14) (**current stable**) | 2019-11-16 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.14](https://github.com/swagger-api/swagger-codegen/tree/v3.0.14) +3.0.28-SNAPSHOT (current 3.0.0, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/codegen/v3/swagger-codegen-cli/3.0.28-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release +[3.0.27](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.27) (**current stable**) | 2021-06-28 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.27](https://github.com/swagger-api/swagger-codegen/tree/v3.0.27) +[3.0.26](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.26) | 2021-05-28 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.26](https://github.com/swagger-api/swagger-codegen/tree/v3.0.26) +[3.0.25](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.25) | 2021-03-04 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.25](https://github.com/swagger-api/swagger-codegen/tree/v3.0.25) +[3.0.24](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.24) | 2020-12-29 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.24](https://github.com/swagger-api/swagger-codegen/tree/v3.0.24) +[3.0.23](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.23) | 2020-11-02 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.23](https://github.com/swagger-api/swagger-codegen/tree/v3.0.23) +[3.0.22](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.22) | 2020-10-05 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.22](https://github.com/swagger-api/swagger-codegen/tree/v3.0.22) +[3.0.21](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.21) | 2020-07-28 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.21](https://github.com/swagger-api/swagger-codegen/tree/v3.0.21) +[3.0.20](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.20) | 2020-05-18 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.20](https://github.com/swagger-api/swagger-codegen/tree/v3.0.20) +[3.0.19](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.19) | 2020-04-02 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.19](https://github.com/swagger-api/swagger-codegen/tree/v3.0.19) +[3.0.18](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.18) | 2020-02-26 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.18](https://github.com/swagger-api/swagger-codegen/tree/v3.0.18) +[3.0.17](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.17) | 2020-02-23 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.17](https://github.com/swagger-api/swagger-codegen/tree/v3.0.17) +[3.0.17](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.16) | 2020-01-15 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.16](https://github.com/swagger-api/swagger-codegen/tree/v3.0.16) +[3.0.15](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.15) | 2020-01-03 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.15](https://github.com/swagger-api/swagger-codegen/tree/v3.0.15) +[3.0.14](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.14) | 2019-11-16 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.14](https://github.com/swagger-api/swagger-codegen/tree/v3.0.14) [3.0.13](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.13) | 2019-10-16 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.13](https://github.com/swagger-api/swagger-codegen/tree/v3.0.13) [3.0.12](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.12) | 2019-10-14 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.12](https://github.com/swagger-api/swagger-codegen/tree/v3.0.12) [3.0.11](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.11) | 2019-08-24 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.11](https://github.com/swagger-api/swagger-codegen/tree/v3.0.11) @@ -149,8 +162,19 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes [3.0.2](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.2)| 2018-10-19 | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release [3.0.1](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.1)| 2018-10-05 | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes [3.0.0](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.0)| 2018-09-06 | 1.0, 1.1, 1.2, 2.0, 3.0 | Major release with breaking changes -2.4.11-SNAPSHOT (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.11-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Minor release -[2.4.10](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.10) (**current stable**) | 2019-11-16 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.10](https://github.com/swagger-api/swagger-codegen/tree/v2.4.10) +2.4.22-SNAPSHOT (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.22-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Minor release +[2.4.21](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.21) (**current stable**) | 2021-06-28 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.21](https://github.com/swagger-api/swagger-codegen/tree/v2.4.21) +[2.4.20](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.20) | 2021-05-28 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.20](https://github.com/swagger-api/swagger-codegen/tree/v2.4.20) +[2.4.19](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.19) | 2021-03-04 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.19](https://github.com/swagger-api/swagger-codegen/tree/v2.4.19) +[2.4.18](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.18) | 2020-12-29 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.18](https://github.com/swagger-api/swagger-codegen/tree/v2.4.18) +[2.4.17](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.17) | 2020-11-02 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.17](https://github.com/swagger-api/swagger-codegen/tree/v2.4.17) +[2.4.16](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.16) | 2020-10-05 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.16](https://github.com/swagger-api/swagger-codegen/tree/v2.4.16) +[2.4.15](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.15) | 2020-07-28 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.15](https://github.com/swagger-api/swagger-codegen/tree/v2.4.15) +[2.4.14](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.14) | 2020-05-18 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.14](https://github.com/swagger-api/swagger-codegen/tree/v2.4.14) +[2.4.13](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.13) | 2020-04-02 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.13](https://github.com/swagger-api/swagger-codegen/tree/v2.4.13) +[2.4.12](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.12) | 2020-01-15 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.12](https://github.com/swagger-api/swagger-codegen/tree/v2.4.12) +[2.4.11](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.11) | 2020-01-03 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.11](https://github.com/swagger-api/swagger-codegen/tree/v2.4.11) +[2.4.10](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.10) | 2019-11-16 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.10](https://github.com/swagger-api/swagger-codegen/tree/v2.4.10) [2.4.9](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.9) | 2019-10-14 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.9](https://github.com/swagger-api/swagger-codegen/tree/v2.4.9) [2.4.8](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.8) | 2019-08-24 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.8](https://github.com/swagger-api/swagger-codegen/tree/v2.4.8) [2.4.7](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.7) | 2019-07-11 | 1.0, 1.1, 1.2, 2.0 | [tag v2.4.7](https://github.com/swagger-api/swagger-codegen/tree/v2.4.7) @@ -169,18 +193,22 @@ Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes 2.0.17 | 2014-08-22 | 1.1, 1.2 | [tag v2.0.17](https://github.com/swagger-api/swagger-codegen/tree/2.0.17) 1.0.4 | 2012-04-12 | 1.0, 1.1 | [tag v1.0.4](https://github.com/swagger-api/swagger-codegen/tree/swagger-codegen_2.9.1-1.1) - - ### Prerequisites If you're looking for the latest stable version, you can grab it directly from Maven.org (Java 8 runtime at a minimum): ```sh -wget http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.10/swagger-codegen-cli-2.4.10.jar -O swagger-codegen-cli.jar +# Download current stable 2.x.x branch (Swagger and OpenAPI version 2) +wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.21/swagger-codegen-cli-2.4.21.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar help + +# Download current stable 3.x.x branch (OpenAPI version 3) +wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.27/swagger-codegen-cli-3.0.27.jar -O swagger-codegen-cli.jar + +java -jar swagger-codegen-cli.jar --help ``` -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 swagger-codegen-cli.jar http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.10/swagger-codegen-cli-2.4.10.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 swagger-codegen-cli.jar https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.21/swagger-codegen-cli-2.4.21.jar` On a mac, it's even easier with `brew`: ```sh @@ -194,7 +222,7 @@ To build from source, you need the following installed and available in your `$P * [Apache maven 3.3.3 or greater](http://maven.apache.org/) #### OS X Users -Don't forget to install Java 8+. +Don't forget to install Java 8+. Export `JAVA_HOME` in order to use the supported Java version: ```sh @@ -220,7 +248,7 @@ To install, run `brew install swagger-codegen` Here is an example usage: ```sh -swagger-codegen generate -i http://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ +swagger-codegen generate -i https://petstore.swagger.io/v2/swagger.json -l ruby -o /tmp/test/ ``` ### Docker @@ -249,6 +277,9 @@ Once built, `run-in-docker.sh` will act as an executable for swagger-codegen-cli ./run-in-docker.sh generate -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml \ -l go -o /gen/out/go-petstore -DpackageName=petstore # generates go client, outputs locally to ./out/go-petstore ``` +#### Standalone generator Development in docker + +See [standalone generator development](https://github.com/swagger-api/swagger-codegen/blob/master/standalone-gen-dev/standalone-generator-development.md) #### Run Docker in Vagrant Prerequisite: install [Vagrant](https://www.vagrantup.com/downloads.html) and [VirtualBox](https://www.virtualbox.org/wiki/Downloads). @@ -282,7 +313,7 @@ sleep 5 GEN_IP=$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $CID) # Execute an HTTP request and store the download link RESULT=$(curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ - "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" + "swaggerUrl": "https://petstore.swagger.io/v2/swagger.json" }' 'http://localhost:8188/api/gen/clients/javascript' | jq '.link' | tr -d '"') # Download the generated zip and redirect to a file curl $RESULT > result.zip @@ -302,7 +333,7 @@ Example: ```sh docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli generate \ - -i http://petstore.swagger.io/v2/swagger.json \ + -i https://petstore.swagger.io/v2/swagger.json \ -l go \ -o /local/out/go ``` @@ -313,28 +344,28 @@ The generated code will be located under `./out/go` in the current directory. ## Getting Started -To generate a PHP client for http://petstore.swagger.io/v2/swagger.json, please run the following +To generate a PHP client for https://petstore.swagger.io/v2/swagger.json, please run the following ```sh git clone https://github.com/swagger-api/swagger-codegen cd swagger-codegen mvn clean package java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ - -i http://petstore.swagger.io/v2/swagger.json \ + -i https://petstore.swagger.io/v2/swagger.json \ -l php \ -o /var/tmp/php_api_client ``` -(if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i http://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) +(if you're on Windows, replace the last command with `java -jar modules\swagger-codegen-cli\target\swagger-codegen-cli.jar generate -i https://petstore.swagger.io/v2/swagger.json -l php -o c:\temp\php_api_client`) -You can also download the JAR (latest release) directly from [maven.org](http://central.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.10/swagger-codegen-cli-2.4.10.jar) +You can also download the JAR (latest release) directly from [maven.org](https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.21/swagger-codegen-cli-2.4.21.jar) -To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` +To get a list of **general** options available, please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar help generate` (for version 3.x check [3.0.0 branch](https://github.com/swagger-api/swagger-codegen/tree/3.0.0)) To get a list of PHP specified options (which can be passed to the generator with a config file via the `-c` option), please run `java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar config-help -l php` ## Generators ### To generate a sample client library -You can build a client against the swagger sample [petstore](http://petstore.swagger.io) API as follows: +You can build a client against the swagger sample [petstore](https://petstore.swagger.io) API as follows: ```sh ./bin/java-petstore.sh @@ -346,7 +377,7 @@ This will run the generator with this command: ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ - -i http://petstore.swagger.io/v2/swagger.json \ + -i https://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java ``` @@ -444,14 +475,16 @@ Note the `myClientCodegen` is an option now, and you can use the usual arguments ```sh java -cp output/myLibrary/target/myClientCodegen-swagger-codegen-1.0.0.jar:modules/swagger-codegen-cli/target/swagger-codegen-cli.jar \ io.swagger.codegen.SwaggerCodegen generate -l myClientCodegen\ - -i http://petstore.swagger.io/v2/swagger.json \ + -i https://petstore.swagger.io/v2/swagger.json \ -o myClient ``` +See also [standalone generator development](https://github.com/swagger-api/swagger-codegen/blob/master/standalone-gen-dev/standalone-generator-development.md) + ### Where is Javascript??? See our [javascript library](http://github.com/swagger-api/swagger-js)--it's completely dynamic and doesn't require static code generation. -There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from a OpenAPI Specification. +There is a third-party component called [swagger-js-codegen](https://github.com/wcandillon/swagger-js-codegen) that can generate angularjs or nodejs source code from an OpenAPI Specification. :exclamation: On Dec 7th 2015, a Javascript API client generator has been added by @jfiala. @@ -574,7 +607,7 @@ Each of these files creates reasonable defaults so you can get running quickly. ```sh java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ - -i http://petstore.swagger.io/v2/swagger.json \ + -i https://petstore.swagger.io/v2/swagger.json \ -l java \ -o samples/client/petstore/java \ -c path/to/config.json @@ -619,10 +652,10 @@ Your config file for Java can look like ```json { - "groupId":"com.my.company", - "artifactId":"MyClient", - "artifactVersion":"1.2.0", - "library":"feign" + "groupId": "com.my.company", + "artifactId": "MyClient", + "artifactVersion": "1.2.0", + "library": "feign" } ``` @@ -678,7 +711,7 @@ or You have options. The easiest is to use our [online validator](https://github.com/swagger-api/validator-badge) which not only will let you validate your spec, but with the debug flag, you can see what's wrong with your spec. For example: -http://online.swagger.io/validator/debug?url=http://petstore.swagger.io/v2/swagger.json +http://online.swagger.io/validator/debug?url=https://petstore.swagger.io/v2/swagger.json ### Generating dynamic html api documentation @@ -754,15 +787,15 @@ One can also generate API client or server using the online generators (https:// For example, to generate Ruby API client, simply send the following HTTP request using curl: ```sh -curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby +curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"https://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/ruby ``` -Then you will receieve a JSON response with the URL to download the zipped code. +Then you will receive a JSON response with the URL to download the zipped code. -To customize the SDK, you can `POST` to `https://generator.swagger.io/gen/clients/{language}` with the following HTTP body: +To customize the SDK, you can `POST` to `https://generator.swagger.io/api/gen/clients/{language}` with the following HTTP body: ```json { - "options": {}, - "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" + "options": {}, + "swaggerUrl": "https://petstore.swagger.io/v2/swagger.json" } ``` in which the `options` for a language can be obtained by submitting a `GET` request to `https://generator.swagger.io/api/gen/clients/{language}`: @@ -770,23 +803,23 @@ in which the `options` for a language can be obtained by submitting a `GET` requ For example, `curl https://generator.swagger.io/api/gen/clients/python` returns ```json { - "packageName":{ - "opt":"packageName", - "description":"python package name (convention: snake_case).", - "type":"string", - "default":"swagger_client" + "packageName": { + "opt": "packageName", + "description": "python package name (convention: snake_case).", + "type": "string", + "default": "swagger_client" }, - "packageVersion":{ - "opt":"packageVersion", - "description":"python package version.", - "type":"string", - "default":"1.0.0" + "packageVersion": { + "opt": "packageVersion", + "description": "python package version.", + "type": "string", + "default": "1.0.0" }, - "sortParamsByRequiredFlag":{ - "opt":"sortParamsByRequiredFlag", - "description":"Sort method arguments to place required parameters before optional parameters.", - "type":"boolean", - "default":"true" + "sortParamsByRequiredFlag": { + "opt": "sortParamsByRequiredFlag", + "description": "Sort method arguments to place required parameters before optional parameters.", + "type": "boolean", + "default": "true" } } ``` @@ -796,12 +829,12 @@ To set package name to `pet_store`, the HTTP body of the request is as follows: "options": { "packageName": "pet_store" }, - "swaggerUrl": "http://petstore.swagger.io/v2/swagger.json" + "swaggerUrl": "https://petstore.swagger.io/v2/swagger.json" } ``` and here is the curl command: ```sh -curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "http://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python +curl -H "Content-type: application/json" -X POST -d '{"options": {"packageName": "pet_store"},"swaggerUrl": "https://petstore.swagger.io/v2/swagger.json"}' https://generator.swagger.io/api/gen/clients/python ``` Instead of using `swaggerUrl` with an URL to the OpenAPI/Swagger spec, one can include the spec in the JSON payload with `spec`, e.g. @@ -907,11 +940,15 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [MailMojo](https://mailmojo.no/) - [Metaswitch](https://www.metaswitch.com/) - [Mindera](http://mindera.com/) +- [ModuleQ](https://moduleq.com) - [Mporium](http://mporium.com/) - [Neverfail](https://neverfail.com/) - [NexCap](http://www.nexess-solutions.com/fr/plateforme-iot/) +- [Nitrobox](https://www.nitrobox.com) +- [Norwegian Air Shuttle](https://www.norwegian.com/) - [NTT DATA](http://www.nttdata.com/) - [nViso](http://www.nviso.ch/) +- [NHSD](https://digital.nhs.uk/) - [Okiok](https://www.okiok.com) - [Onedata](http://onedata.org) - [Open International Systems](https://openintl.com/) @@ -963,6 +1000,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Trexle](https://trexle.com/) - [Upwork](http://upwork.com/) - [uShip](https://www.uship.com/) +- [Variograma](https://variograma.pt) - [VMware](https://vmware.com/) - [Viavi Solutions Inc.](https://www.viavisolutions.com) - [W.UP](http://wup.hu/?siteLang=en) @@ -974,6 +1012,7 @@ Here are some companies/projects using Swagger Codegen in production. To add you - [Zalando](https://tech.zalando.com) - [ZEEF.com](https://zeef.com/) - [zooplus](https://www.zooplus.com/) +- [Trifork](https://www.trifork.com/) Presentations/Videos/Tutorials/Books ---------------------------------------- @@ -1159,7 +1198,7 @@ Who is eligible? Those who want to join must have at least 3 PRs merged into a g | Android | | | Apex | | | Bash | @kenjones-cisco (2017/09) | -| C++ | @fvarose (2017/11) | +| C++ | | | C# | @mandrean (2017/08) | | Clojure | | | Dart | @ircecho (2017/07) | diff --git a/bin/aspnetcore-v2.2-petstore-server-interface-controller.sh b/bin/aspnetcore-v2.2-petstore-server-interface-controller.sh new file mode 100755 index 00000000000..76b4a0f6b7f --- /dev/null +++ b/bin/aspnetcore-v2.2-petstore-server-interface-controller.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -l aspnetcore -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/aspnetcore-v2.2-interface-controller --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties interface-controller=true --additional-properties aspnetCoreVersion=2.2" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/aspnetcore-v2.2-petstore-server-interface-only.sh b/bin/aspnetcore-v2.2-petstore-server-interface-only.sh new file mode 100755 index 00000000000..4def1987d0a --- /dev/null +++ b/bin/aspnetcore-v2.2-petstore-server-interface-only.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -l aspnetcore -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/aspnetcore-v2.2-interface-only --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties interface-only=true --additional-properties aspnetCoreVersion=2.2" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/aspnetcore-v2.2-petstore-server.sh b/bin/aspnetcore-v2.2-petstore-server.sh new file mode 100755 index 00000000000..2eca7939a43 --- /dev/null +++ b/bin/aspnetcore-v2.2-petstore-server.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -l aspnetcore -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -o samples/server/petstore/aspnetcore-v2.2 --additional-properties packageGuid={3C799344-F285-4669-8FD5-7ED9B795D5C5} --additional-properties aspnetCoreVersion=2.2" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/java-petstore-all.sh b/bin/java-petstore-all.sh index 0566f775d40..8e7e15a8ddd 100755 --- a/bin/java-petstore-all.sh +++ b/bin/java-petstore-all.sh @@ -12,7 +12,6 @@ ./bin/java-petstore-retrofit2rx2.sh ./bin/java8-petstore-jersey2.sh ./bin/java-petstore-retrofit2-play24.sh -./bin/java-petstore-jersey2-java6.sh ./bin/java-petstore-resttemplate.sh ./bin/java-petstore-resttemplate-withxml.sh ./bin/java-petstore-resteasy.sh diff --git a/bin/java-petstore-jersey2-java6.sh b/bin/java-petstore-jersey2-java6.sh deleted file mode 100755 index 8ab7c2c7ef4..00000000000 --- a/bin/java-petstore-jersey2-java6.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/sh - -SCRIPT="$0" - -while [ -h "$SCRIPT" ] ; do - ls=`ls -ld "$SCRIPT"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - SCRIPT="$link" - else - SCRIPT=`dirname "$SCRIPT"`/"$link" - fi -done - -if [ ! -d "${APP_DIR}" ]; then - APP_DIR=`dirname "$SCRIPT"`/.. - APP_DIR=`cd "${APP_DIR}"; pwd` -fi - -executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" - -if [ ! -f "$executable" ] -then - mvn clean package -fi - -# if you've executed sbt assembly previously it will use that instead. -export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" -ags="$@ generate --artifact-id swagger-petstore-jersey2-java6 -i modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -l java -c bin/java-petstore-jersey2.json -o samples/client/petstore/java/jersey2-java6 -DhideGenerationTimestamp=true,supportJava6=true" - -echo "Removing files and folders under samples/client/petstore/java/jersey2/src/main" -rm -rf samples/client/petstore/java/jersey2-java6/src/main -find samples/client/petstore/java/jersey2-java6 -maxdepth 1 -type f ! -name "README.md" -exec rm {} + -java $JAVA_OPTS -jar $executable $ags diff --git a/bin/security/ue4cpp-petstore.sh b/bin/security/ue4cpp-petstore.sh new file mode 100644 index 00000000000..43ff4096047 --- /dev/null +++ b/bin/security/ue4cpp-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/ue4cpp -i modules/swagger-codegen/src/test/resources/2_0/petstore-security-test.yaml -l ue4cpp -o samples/client/petstore-security-test/ue4cpp" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/ue4cpp-petstore.sh b/bin/ue4cpp-petstore.sh new file mode 100644 index 00000000000..920fe96c157 --- /dev/null +++ b/bin/ue4cpp-petstore.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +SCRIPT="$0" + +while [ -h "$SCRIPT" ] ; do + ls=`ls -ld "$SCRIPT"` + link=`expr "$ls" : '.*-> \(.*\)$'` + if expr "$link" : '/.*' > /dev/null; then + SCRIPT="$link" + else + SCRIPT=`dirname "$SCRIPT"`/"$link" + fi +done + +if [ ! -d "${APP_DIR}" ]; then + APP_DIR=`dirname "$SCRIPT"`/.. + APP_DIR=`cd "${APP_DIR}"; pwd` +fi + +executable="./modules/swagger-codegen-cli/target/swagger-codegen-cli.jar" + +if [ ! -f "$executable" ] +then + mvn clean package +fi + +# if you've executed sbt assembly previously it will use that instead. +export JAVA_OPTS="${JAVA_OPTS} -XX:MaxPermSize=256M -Xmx1024M -DloggerPath=conf/log4j.properties" +ags="$@ generate -t modules/swagger-codegen/src/main/resources/ue4cpp -i modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -l ue4cpp -o samples/client/petstore/ue4cpp" + +java $JAVA_OPTS -jar $executable $ags diff --git a/bin/windows/ue4cpp-petstore.bat b/bin/windows/ue4cpp-petstore.bat new file mode 100644 index 00000000000..6ac8263e904 --- /dev/null +++ b/bin/windows/ue4cpp-petstore.bat @@ -0,0 +1,10 @@ +set executable=.\modules\swagger-codegen-cli\target\swagger-codegen-cli.jar + +If Not Exist %executable% ( + mvn clean package +) + +REM set JAVA_OPTS=%JAVA_OPTS% -Xmx1024M +set ags=generate -i modules\swagger-codegen\src\test\resources\2_0\petstore.yaml -l ue4cpp -o samples\client\petstore\ue4cpp + +java %JAVA_OPTS% -jar %executable% %ags% diff --git a/circle.yml.disabled b/circle.yml.disabled deleted file mode 100644 index 6d394bd3dcf..00000000000 --- a/circle.yml.disabled +++ /dev/null @@ -1,56 +0,0 @@ -# Java-related client, server tests -machine: - java: - version: openjdk8 - services: - - docker - # Override /etc/hosts - hosts: - petstore.swagger.io: 127.0.0.1 - environment: - DOCKER_GENERATOR_IMAGE_NAME: swaggerapi/swagger-generator - DOCKER_CODEGEN_CLI_IMAGE_NAME: swaggerapi/swagger-codegen-cli - -dependencies: - cache_directories: - - "~/.m2" - - "~/.sbt" - - "~/.ivy2" - - pre: - - sudo add-apt-repository ppa:duggan/bats --yes - - sudo apt-get update -qq - - sudo apt-get install -qq bats - - sudo apt-get install -qq curl - - wget -q https://dl.bintray.com/sbt/debian/sbt-0.13.15.deb - - sudo dpkg -i sbt-0.13.15.deb - # to run petstore server locally via docker - - docker pull swaggerapi/petstore - - docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - - docker ps -a - # show host table to confirm petstore.swagger.io is mapped to localhost - - cat /etc/hosts - override: - - cp pom.xml.circleci pom.xml - -test: - override: - ## test with jdk8 - - java -version - - mvn clean install - - mvn -q verify -Psamples - # skip the rest if previous mvn task fails - - if [ $? -ne 0 ]; then exit 1; fi - ## test with jdk7 - - sudo update-java-alternatives -s java-1.7.0-openjdk-amd64 - - java -version - - cp pom.xml.circleci.java7 pom.xml # use jdk7 pom - - mvn clean install - - mvn -q verify -Psamples - # skip the rest if previous mvn task fails - - if [ $? -ne 0 ]; then exit 1; fi - ## docker: build generator image and push to Docker Hub - ## 16/07/2018, commented out as it's causing timeout on circleCI, for the time being build and push manually - #- ./bin/docker/build_and_push_docker: - # timeout: 60m - diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index 51314836797..a9745c8d930 100644 --- a/modules/swagger-codegen-cli/pom.xml +++ b/modules/swagger-codegen-cli/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.4.11-SNAPSHOT + 2.4.22-SNAPSHOT ../.. 4.0.0 diff --git a/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java b/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java index 57a9cbe8af8..bb5a407ae07 100644 --- a/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java +++ b/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Generate.java @@ -172,6 +172,12 @@ public class Generate implements Runnable { description = CodegenConstants.REMOVE_OPERATION_ID_PREFIX_DESC) private Boolean removeOperationIdPrefix; + @Option(name = {"--skip-alias-generation"}, title = "skip alias generation.", description = "skip code generation for models identified as alias.") + private Boolean skipAliasGeneration; + + @Option(name = {"--ignore-import-mapping"}, title = "ignore import mapping", description = "allow generate model classes using names previously listed on import mappings.") + private String ignoreImportMappings; + @Override public void run() { @@ -273,6 +279,14 @@ public void run() { configurator.setRemoveOperationIdPrefix(removeOperationIdPrefix); } + if (skipAliasGeneration != null) { + configurator.setSkipAliasGeneration(skipAliasGeneration); + } + + if (ignoreImportMappings != null) { + additionalProperties.add(String.format("%s=%s", CodegenConstants.IGNORE_IMPORT_MAPPING_OPTION, Boolean.parseBoolean(ignoreImportMappings))); + } + applySystemPropertiesKvpList(systemProperties, configurator); applyInstantiationTypesKvpList(instantiationTypes, configurator); applyImportMappingsKvpList(importMappings, configurator); diff --git a/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Meta.java b/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Meta.java index e52e121e801..b8fe42f3853 100644 --- a/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Meta.java +++ b/modules/swagger-codegen-cli/src/main/java/io/swagger/codegen/cmd/Meta.java @@ -16,6 +16,7 @@ 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; @@ -115,7 +116,7 @@ public File convert(SupportingFile support) { LOGGER.info("copying file to {}", outputFile.getAbsolutePath()); } - FileUtils.writeStringToFile(outputFile, formatted); + FileUtils.writeStringToFile(outputFile, formatted, StandardCharsets.UTF_8); return outputFile; } catch (IOException e) { diff --git a/modules/swagger-codegen-maven-plugin/examples/java-client.xml b/modules/swagger-codegen-maven-plugin/examples/java-client.xml index 43518b0e009..64d6842c843 100644 --- a/modules/swagger-codegen-maven-plugin/examples/java-client.xml +++ b/modules/swagger-codegen-maven-plugin/examples/java-client.xml @@ -43,7 +43,7 @@ - + io.swagger swagger-annotations @@ -52,7 +52,7 @@ - + org.glassfish.jersey.core @@ -96,7 +96,7 @@ jackson-jaxrs-json-provider ${jackson-version} - + com.fasterxml.jackson.datatype @@ -107,22 +107,22 @@ joda-time joda-time ${jodatime-version} - + com.brsanthu migbase64 2.2 - + - + 1.5.21 2.29.1 - 2.10.1 + 2.11.4 2.7 1.0.0 - 4.8.1 + 4.13.1 diff --git a/modules/swagger-codegen-maven-plugin/pom.xml b/modules/swagger-codegen-maven-plugin/pom.xml index 4fe8932cbf6..5bcb97eba07 100644 --- a/modules/swagger-codegen-maven-plugin/pom.xml +++ b/modules/swagger-codegen-maven-plugin/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.4.11-SNAPSHOT + 2.4.22-SNAPSHOT ../.. swagger-codegen-maven-plugin diff --git a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java index 446acc9849e..bb5aedd81d1 100644 --- a/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java +++ b/modules/swagger-codegen-maven-plugin/src/main/java/io/swagger/codegen/plugin/CodeGenMojo.java @@ -50,7 +50,7 @@ /** * Goal which generates client/server code from a swagger json/yaml definition. */ -@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES) +@Mojo(name = "generate", defaultPhase = LifecyclePhase.GENERATE_SOURCES, threadSafe = true) public class CodeGenMojo extends AbstractMojo { @Parameter(name = "verbose", required = false, defaultValue = "false") @@ -315,6 +315,13 @@ public class CodeGenMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException { + // Using the naive approach for achieving thread safety + synchronized (CodeGenMojo.class) { + execute_(); + } + } + + protected void execute_() throws MojoExecutionException { if (skip) { getLog().info("Code generation is skipped."); diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index 6ac6d2b8eab..6d49a95e784 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.4.11-SNAPSHOT + 2.4.22-SNAPSHOT ../.. 4.0.0 @@ -74,8 +74,8 @@ maven-compiler-plugin 3.5.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -249,6 +249,19 @@ commons-cli ${commons-cli-version} + + + org.json + json + 20210307 + + org.testng testng diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java index 4f668ac224e..8cf1efa2213 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConfig.java @@ -163,6 +163,8 @@ public interface CodegenConfig { String apiFilename(String templateName, String tag); + String modelFilename(String templateName, String modelName); + String apiTestFilename(String templateName, String tag); String apiDocFilename(String templateName, String tag); @@ -222,4 +224,14 @@ public interface CodegenConfig { String sanitizeName(String name); + void setSkipAliasGeneration(Boolean skipAliasGeneration); + + Boolean getSkipAliasGeneration(); + + boolean getIgnoreImportMapping(); + + void setIgnoreImportMapping(boolean ignoreImportMapping); + + boolean defaultIgnoreImportMappingOption(); + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java index 63d88620adb..94dbbcd3387 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenConstants.java @@ -234,4 +234,6 @@ public static enum ENUM_PROPERTY_NAMING_TYPE {camelCase, PascalCase, snake_case, public static final String ASP_NET_CORE_VERSION = "aspnetCoreVersion"; public static final String INTERFACE_ONLY = "interface-only"; public static final String INTERFACE_CONTROLLER = "interface-controller"; + + public static final String IGNORE_IMPORT_MAPPING_OPTION = "ignoreImportMappings"; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java index 38cb7fb40d4..41a9390f1a2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenModel.java @@ -40,6 +40,7 @@ public class CodegenModel { public Set imports = new TreeSet(); public boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum, hasRequired, hasOptional, isArrayModel, hasChildren; + public CodegenProperty parentContainer; public boolean hasOnlyReadOnly = true; // true if all properties are read-only public ExternalDocs externalDocs; @@ -55,6 +56,14 @@ public class CodegenModel { allMandatory = mandatory; } + public boolean getIsInteger() { + return "Integer".equalsIgnoreCase(this.dataType); + } + + public boolean getIsNumber() { + return "BigDecimal".equalsIgnoreCase(this.dataType); + } + @Override public String toString() { return String.format("%s(%s)", name, classname); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java index 8334d12c79c..57352356654 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenProperty.java @@ -46,6 +46,7 @@ public class CodegenProperty implements Cloneable { public List _enum; public Map allowableValues; public CodegenProperty items; + public Integer itemsDepth; public Map vendorExtensions; public boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template) public boolean isInherited; @@ -55,6 +56,7 @@ public class CodegenProperty implements Cloneable { public String enumName; public Integer maxItems; public Integer minItems; + public boolean uniqueItems; // XML public boolean isXmlAttribute = false; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 4072b5ca4a3..61d2b6dfef1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -2,6 +2,9 @@ import javax.annotation.Nullable; import java.io.File; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.util.*; import java.util.Map.Entry; import java.util.regex.Matcher; @@ -103,6 +106,8 @@ public class DefaultCodegen { protected String gitUserId, gitRepoId, releaseNote; protected String httpUserAgent; protected Boolean hideGenerationTimestamp = true; + protected Boolean skipAliasGeneration; + protected boolean ignoreImportMapping; // How to encode special characters like $ // They are translated to words like "Dollar" and prefixed with ' // Then translated back during JSON encoding and decoding @@ -162,6 +167,12 @@ public void processOpts() { this.setRemoveOperationIdPrefix(Boolean.valueOf(additionalProperties .get(CodegenConstants.REMOVE_OPERATION_ID_PREFIX).toString())); } + + if (additionalProperties.get(CodegenConstants.IGNORE_IMPORT_MAPPING_OPTION) != null) { + setIgnoreImportMapping(Boolean.parseBoolean( additionalProperties.get(CodegenConstants.IGNORE_IMPORT_MAPPING_OPTION).toString())); + } else { + setIgnoreImportMapping(defaultIgnoreImportMappingOption()); + } } // override with any special post-processing for all models @@ -179,43 +190,48 @@ public Map postProcessAllModels(Map objs) { allModels.put(modelName, cm); } } - // Fix up all parent and interface CodegenModel references. - for (CodegenModel cm : allModels.values()) { - if (cm.parent != null) { - cm.parentModel = allModels.get(cm.parent); - } - if (cm.interfaces != null && !cm.interfaces.isEmpty()) { - cm.interfaceModels = new ArrayList(cm.interfaces.size()); - for (String intf : cm.interfaces) { - CodegenModel intfModel = allModels.get(intf); - if (intfModel != null) { - cm.interfaceModels.add(intfModel); - } - } - } - } - // Let parent know about all its children + for (String name : allModels.keySet()) { - CodegenModel cm = allModels.get(name); - CodegenModel parent = allModels.get(cm.parent); - // if a discriminator exists on the parent, don't add this child to the inheritance hierarchy - // TODO Determine what to do if the parent discriminator name == the grandparent discriminator name - while (parent != null) { - if (parent.children == null) { - parent.children = new ArrayList(); - } - parent.children.add(cm); - if (parent.discriminator == null) { - parent = allModels.get(parent.parent); - } else { - parent = null; - } - } + CodegenModel codegenModel = allModels.get(name); + fixUpParentAndInterfaces(codegenModel, allModels); } } return objs; } + /** + * Fix up all parent and interface CodegenModel references. + * @param allModels + */ + protected void fixUpParentAndInterfaces(CodegenModel codegenModel, Map allModels) { + if (codegenModel.parent != null) { + codegenModel.parentModel = allModels.get(codegenModel.parent); + } + if (codegenModel.interfaces != null && !codegenModel.interfaces.isEmpty()) { + codegenModel.interfaceModels = new ArrayList(codegenModel.interfaces.size()); + for (String intf : codegenModel.interfaces) { + CodegenModel intfModel = allModels.get(intf); + if (intfModel != null) { + codegenModel.interfaceModels.add(intfModel); + } + } + } + CodegenModel parent = codegenModel.parentModel; + // if a discriminator exists on the parent, don't add this child to the inheritance hierarchy + // TODO Determine what to do if the parent discriminator name == the grandparent discriminator name + while (parent != null) { + if (parent.children == null) { + parent.children = new ArrayList(); + } + parent.children.add(codegenModel); + if (parent.discriminator == null) { + parent = allModels.get(parent.parent); + } else { + parent = null; + } + } + } + // override with any special post-processing @SuppressWarnings("static-method") public Map postProcessModels(Map objs) { @@ -277,8 +293,8 @@ public Map postProcessModelsEnum(Map objs) { } /** - * Returns the common prefix of variables for enum naming if - * two or more variables are present + * Returns the common prefix of variables for enum naming if + * two or more variables are present. * * @param vars List of variable names * @return the common prefix for naming @@ -331,7 +347,7 @@ public String toEnumDefaultValue(String value, String datatype) { * @return the sanitized value for enum */ public String toEnumValue(String value, String datatype) { - if ("number".equalsIgnoreCase(datatype)) { + if (isPrimivite(datatype)) { return value; } else { return "\"" + escapeText(value) + "\""; @@ -358,6 +374,12 @@ public String toEnumVarName(String value, String datatype) { } } + public boolean isPrimivite(String datatype) { + return "number".equalsIgnoreCase(datatype) + || "integer".equalsIgnoreCase(datatype) + || "boolean".equalsIgnoreCase(datatype); + } + // override with any special post-processing @SuppressWarnings("static-method") public Map postProcessOperations(Map objs) { @@ -378,6 +400,15 @@ public Map postProcessSupportingFileData(Map obj // override to post-process any model properties @SuppressWarnings("unused") + public void postProcessModelProperties(CodegenModel model){ + if (model.vars == null || model.vars.isEmpty()) { + return; + } + for(CodegenProperty codegenProperty : model.vars) { + postProcessModelProperty(model, codegenProperty); + } + } + public void postProcessModelProperty(CodegenModel model, CodegenProperty property){ } @@ -1350,7 +1381,13 @@ public CodegenModel fromModel(String name, Model model, Map allDe m.classname = toModelName(name); m.classVarName = toVarName(name); m.classFilename = toModelFilename(name); - m.modelJson = Json.pretty(model); + // NOTE: not using Json.pretty() to write out model, as it + // can raise memory consumption (see comment in ExampleGenerator) + try { + m.modelJson = Json.mapper().writeValueAsString(model); + } catch (Exception e) { + m.modelJson = "{}"; + } m.externalDocs = model.getExternalDocs(); m.vendorExtensions = model.getVendorExtensions(); m.isAlias = typeAliases.containsKey(name); @@ -1382,6 +1419,12 @@ public CodegenModel fromModel(String name, Model model, Map allDe List required = new ArrayList(); Map allProperties; List allRequired; + + List allComponents = composed.getAllOf(); + if (allComponents.size() > 0 && composed.getParent() == null) { + rebuildComponents(composed); + } + if (supportsInheritance || supportsMixins) { allProperties = new LinkedHashMap(); allRequired = new ArrayList(); @@ -1461,7 +1504,7 @@ public CodegenModel fromModel(String name, Model model, Map allDe if(parentName != null) { m.parentSchema = parentName; - m.parent = toModelName(parentName); + m.parent = typeMapping.containsKey(parentName) ? typeMapping.get(parentName): toModelName(parentName); addImport(m, m.parent); if (allDefinitions != null) { final Model parentModel = allDefinitions.get(m.parentSchema); @@ -1478,6 +1521,10 @@ public CodegenModel fromModel(String name, Model model, Map allDe properties.putAll(model.getProperties()); } + if (composed.getRequired() != null) { + required.addAll(composed.getRequired()); + } + // child model (properties owned by the model itself) Model child = composed.getChild(); if (child != null && child instanceof RefModel && allDefinitions != null) { @@ -1503,6 +1550,9 @@ public CodegenModel fromModel(String name, Model model, Map allDe // comment out below as allowableValues is not set in post processing model enum m.allowableValues = new HashMap(); m.allowableValues.put("values", impl.getEnum()); + if (m.dataType.equals("BigDecimal")) { + addImport(m, "BigDecimal"); + } } if (impl.getAdditionalProperties() != null) { addAdditionPropertiesToCodeGenModel(m, impl); @@ -1510,12 +1560,32 @@ public CodegenModel fromModel(String name, Model model, Map allDe addVars(m, impl.getProperties(), impl.getRequired(), allDefinitions); } - if (m.vars != null) { - for(CodegenProperty prop : m.vars) { - postProcessModelProperty(m, prop); + postProcessModelProperties(m); + return m; + } + + private void rebuildComponents(ComposedModel composedModel) { + List allComponents = composedModel.getAllOf(); + if (allComponents.size() >= 1) { + composedModel.setParent(allComponents.get(0)); + if (allComponents.size() >= 2) { + composedModel.setChild(allComponents.get(allComponents.size() - 1)); + List interfaces = new ArrayList(); + int size = allComponents.size(); + Iterator modelIterator = allComponents.subList(1, size - 1).iterator(); + + while(modelIterator.hasNext()) { + Model model = (Model)modelIterator.next(); + if (model instanceof RefModel) { + RefModel ref = (RefModel)model; + interfaces.add(ref); + } + } + composedModel.setInterfaces(interfaces); + } else { + composedModel.setChild(new ModelImpl()); } } - return m; } /** @@ -1596,12 +1666,24 @@ public String getterAndSetterCapitalize(String name) { * @return Codegen Property object */ public CodegenProperty fromProperty(String name, Property p) { + return fromProperty(name, p, null); + } + /** + * Convert Swagger Property object to Codegen Property object + * + * @param name name of the property + * @param p Swagger property object + * @param itemsDepth the depth in nested containers or null + * @return Codegen Property object + */ + private CodegenProperty fromProperty(String name, Property p, Integer itemsDepth) { if (p == null) { LOGGER.error("unexpected missing property for name " + name); return null; } CodegenProperty property = CodegenModelFactory.newInstance(CodegenModelType.PROPERTY); + property.itemsDepth = itemsDepth; property.name = toVarName(name); property.baseName = name; property.nameInCamelCase = camelize(property.name, false); @@ -1860,11 +1942,13 @@ public CodegenProperty fromProperty(String name, Property p) { ArrayProperty ap = (ArrayProperty) p; property.maxItems = ap.getMaxItems(); property.minItems = ap.getMinItems(); + property.uniqueItems = ap.getUniqueItems() == null ? false : ap.getUniqueItems(); String itemName = (String) p.getVendorExtensions().get("x-item-name"); if (itemName == null) { itemName = property.name; } - CodegenProperty cp = fromProperty(itemName, ap.getItems()); + CodegenProperty cp = fromProperty(itemName, ap.getItems(), + itemsDepth == null ? 1 : itemsDepth.intValue() + 1); updatePropertyForArray(property, cp); } else if (p instanceof MapProperty) { MapProperty ap = (MapProperty) p; @@ -1877,7 +1961,8 @@ public CodegenProperty fromProperty(String name, Property p) { property.maxItems = ap.getMaxProperties(); // handle inner property - CodegenProperty cp = fromProperty("inner", ap.getAdditionalProperties()); + CodegenProperty cp = fromProperty("inner", ap.getAdditionalProperties(), + itemsDepth == null ? 1 : itemsDepth.intValue() + 1); updatePropertyForMap(property, cp); } else { setNonArrayMapProperty(property, type); @@ -2702,27 +2787,14 @@ public CodegenParameter fromParameter(Parameter param, Set imports) { p.isPrimitiveType = cp.isPrimitiveType; p.isContainer = true; p.isListContainer = true; + p.uniqueItems = impl.getUniqueItems() == null ? false : impl.getUniqueItems(); // set boolean flag (e.g. isString) setParameterBooleanFlagWithCodegenProperty(p, cp); } else { Model sub = bp.getSchema(); if (sub instanceof RefModel) { - String name = ((RefModel) sub).getSimpleRef(); - name = getAlias(name); - if (typeMapping.containsKey(name)) { - name = typeMapping.get(name); - p.baseType = name; - } else { - name = toModelName(name); - p.baseType = name; - if (defaultIncludes.contains(name)) { - imports.add(name); - } - imports.add(name); - name = getTypeDeclaration(name); - } - p.dataType = name; + readRefModelParameter((RefModel) model, p, imports); } else { if (sub instanceof ComposedModel) { p.dataType = "object"; @@ -2832,6 +2904,29 @@ public boolean isDataTypeFile(String dataType) { } } + protected void readRefModelParameter(RefModel refModel, CodegenParameter codegenParameter, Set imports) { + String name = refModel.getSimpleRef(); + try { + name = URLDecoder.decode(name, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + LOGGER.error("Could not decoded string: " + name, e); + } + name = getAlias(name); + if (typeMapping.containsKey(name)) { + name = typeMapping.get(name); + codegenParameter.baseType = name; + } else { + name = toModelName(name); + codegenParameter.baseType = name; + if (defaultIncludes.contains(name)) { + imports.add(name); + } + imports.add(name); + name = getTypeDeclaration(name); + } + codegenParameter.dataType = name; + } + /** * Convert map of Swagger SecuritySchemeDefinition objects to a list of Codegen Security objects * @@ -3080,10 +3175,10 @@ public void addOperationToGroup(String tag, String resourcePath, Operation opera } private void addParentContainer(CodegenModel m, String name, Property property) { - final CodegenProperty tmp = fromProperty(name, property); - addImport(m, tmp.complexType); + m.parentContainer = fromProperty(name, property); + addImport(m, m.parentContainer.complexType); m.parent = toInstantiationType(property); - final String containerType = tmp.containerType; + final String containerType = m.parentContainer.containerType; final String instantiationType = instantiationTypes.get(containerType); if (instantiationType != null) { addImport(m, instantiationType); @@ -3263,6 +3358,10 @@ private void addVars(CodegenModel m, List vars, Map files, Map models, String modelName) throws IOException { @@ -378,7 +381,7 @@ private Model getParent(Model model) { for (String name : modelKeys) { try { //don't generate models that have an import mapping - if (config.importMapping().containsKey(name)) { + if (!config.getIgnoreImportMapping() && config.importMapping().containsKey(name)) { LOGGER.info("Model " + name + " not imported due to import mapping"); continue; } @@ -401,17 +404,19 @@ private Model getParent(Model model) { // post process all processed models allProcessedModels = config.postProcessAllModels(allProcessedModels); + final boolean skipAlias = config.getSkipAliasGeneration() != null && config.getSkipAliasGeneration(); + // generate files based on processed models for (String modelName : allProcessedModels.keySet()) { Map models = (Map) allProcessedModels.get(modelName); models.put("modelPackage", config.modelPackage()); try { //don't generate models that have an import mapping - if (config.importMapping().containsKey(modelName)) { + if (!config.getIgnoreImportMapping() && config.importMapping().containsKey(modelName)) { continue; } Map modelTemplate = (Map) ((List) models.get("models")).get(0); - if (config instanceof AbstractJavaCodegen) { + if (skipAlias) { // Special handling of aliases only applies to Java if (modelTemplate != null && modelTemplate.containsKey("model")) { CodegenModel m = (CodegenModel) modelTemplate.get("model"); @@ -422,8 +427,7 @@ private Model getParent(Model model) { } allModels.add(modelTemplate); for (String templateName : config.modelTemplateFiles().keySet()) { - String suffix = config.modelTemplateFiles().get(templateName); - String filename = config.modelFileFolder() + File.separator + config.toModelFilename(modelName) + suffix; + String filename = config.modelFilename(templateName, modelName); if (!config.shouldOverwrite(filename)) { LOGGER.info("Skipped overwriting " + filename); continue; @@ -764,10 +768,6 @@ public List generate() { configureGeneratorProperties(); configureSwaggerInfo(); - // resolve inline models - InlineModelResolver inlineModelResolver = new InlineModelResolver(); - inlineModelResolver.flatten(swagger); - List files = new ArrayList(); // models List allModels = new ArrayList(); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/InlineModelResolver.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/InlineModelResolver.java index 0363e459c97..5cac878003a 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/InlineModelResolver.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/InlineModelResolver.java @@ -14,6 +14,15 @@ import java.util.List; import java.util.Map; +/** + * @deprecated use instead the option flatten in SwaggerParser + */ +/* + * Use flatten option in Swagger parser like this: + * ParseOptions parseOptions = new ParseOptions(); + * parseOptions.setFlatten(true); + * Swagger swagger = new SwaggerParser().read(rootNode, new ArrayList<>(), parseOptions);*/ + public class InlineModelResolver { private Swagger swagger; private boolean skipMatches; @@ -355,6 +364,22 @@ public void flattenProperties(Map properties, String path) { } } } + } else if (property instanceof ComposedProperty) { + ComposedProperty composedProperty = (ComposedProperty) property; + String modelName = resolveModelName(composedProperty.getTitle(), path + "_" + key); + Model model = modelFromProperty(composedProperty, modelName); + String existing = matchGenerated(model); + if (existing != null) { + RefProperty refProperty = new RefProperty(existing); + refProperty.setRequired(composedProperty.getRequired()); + propsToUpdate.put(key, refProperty); + } else { + RefProperty refProperty = new RefProperty(modelName); + refProperty.setRequired(composedProperty.getRequired()); + propsToUpdate.put(key, refProperty); + addGenerated(modelName, model); + swagger.addDefinition(modelName, model); + } } } if (propsToUpdate.size() > 0) { @@ -428,6 +453,30 @@ public Model modelFromProperty(ObjectProperty object, String path) { return model; } + public Model modelFromProperty(ComposedProperty composedProperty, String path) { + String description = composedProperty.getDescription(); + String example = null; + + Object obj = composedProperty.getExample(); + if (obj != null) { + example = obj.toString(); + } + Xml xml = composedProperty.getXml(); + + ModelImpl model = new ModelImpl(); + model.type(composedProperty.getType()); + model.setDescription(description); + model.setExample(example); + model.setName(path); + model.setXml(xml); + if (composedProperty.getVendorExtensions() != null) { + for (String key : composedProperty.getVendorExtensions().keySet()) { + model.setVendorExtension(key, composedProperty.getVendorExtensions().get(key)); + } + } + return model; + } + @SuppressWarnings("static-method") public Model modelFromProperty(MapProperty object, @SuppressWarnings("unused") String path) { String description = object.getDescription(); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/MetaGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/MetaGenerator.java index 45eb05e56fb..ecc8b02e689 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/MetaGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/MetaGenerator.java @@ -14,6 +14,7 @@ import java.io.File; import java.io.IOException; import java.io.Reader; +import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -166,7 +167,7 @@ public Reader getTemplate(String name) { files.add(new File(outputFilename)); } else { String template = readTemplate(templateDir + File.separator + support.templateFile); - FileUtils.writeStringToFile(new File(outputFilename), template); + FileUtils.writeStringToFile(new File(outputFilename), template, StandardCharsets.UTF_8); LOGGER.info("copying file to " + outputFilename); files.add(new File(outputFilename)); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java index 92d411fe933..e22833d0f00 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/config/CodegenConfigurator.java @@ -12,6 +12,7 @@ import io.swagger.models.Swagger; import io.swagger.models.auth.AuthorizationValue; import io.swagger.parser.SwaggerParser; +import io.swagger.parser.util.ParseOptions; import io.swagger.util.Json; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; @@ -44,6 +45,7 @@ public class CodegenConfigurator implements Serializable { private String outputDir; private boolean verbose; private boolean skipOverwrite; + private Boolean skipAliasGeneration; private boolean removeOperationIdPrefix; private String templateDir; private String auth; @@ -126,6 +128,10 @@ public CodegenConfigurator setRemoveOperationIdPrefix(boolean removeOperationIdP return this; } + public void setSkipAliasGeneration(Boolean skipAliasGeneration) { + this.skipAliasGeneration = skipAliasGeneration; + } + public String getModelNameSuffix() { return modelNameSuffix; } @@ -392,6 +398,7 @@ public ClientOptInput toClientOptInput() { config.setInputSpec(inputSpec); config.setOutputDir(outputDir); config.setSkipOverwrite(skipOverwrite); + config.setSkipAliasGeneration(skipAliasGeneration); config.setIgnoreFilePathOverride(ignoreFileOverride); config.setRemoveOperationIdPrefix(removeOperationIdPrefix); @@ -427,8 +434,10 @@ public ClientOptInput toClientOptInput() { .config(config); final List authorizationValues = AuthParser.parse(auth); - - Swagger swagger = new SwaggerParser().read(inputSpec, authorizationValues, true); + ParseOptions parseOptions = new ParseOptions(); + parseOptions.setResolve(true); + parseOptions.setFlatten(true); + Swagger swagger = new SwaggerParser().read(inputSpec, authorizationValues, parseOptions); input.opts(new ClientOpts()) .swagger(swagger); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java index 15055d0ba6c..168b6862a8b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/examples/ExampleGenerator.java @@ -4,6 +4,7 @@ import io.swagger.models.ModelImpl; import io.swagger.models.properties.*; import io.swagger.util.Json; +import org.json.JSONObject; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -46,7 +47,15 @@ public List> generate(Map examples, List kv = new HashMap<>(); kv.put(CONTENT_TYPE, mediaType); if (property != null && mediaType.startsWith(MIME_TYPE_JSON)) { - String example = Json.pretty(resolvePropertyToExample("", mediaType, property, processedModels)); + /* + org.json is used to pretty print example, because of an issue with + Jackson pretty printing for large specs, where for some reason + memory usage goes up to OOM errors. + TODO if bug (?) is fixed in Jackson pretty printing, remove the dep and use jackson instead + */ + //String example = Json.pretty(resolvePropertyToExample("", mediaType, property, processedModels)); + String example = new JSONObject(resolvePropertyToExample("", mediaType, property, processedModels)).toString(2); + if (example != null) { kv.put(EXAMPLE, example); @@ -91,7 +100,14 @@ public List> generate(Map examples, List postProcessOperations(Map objs) { super.postProcessOperations(objs); if (objs != null) { + boolean hasAuthMethods = false; Map operations = (Map) objs.get("operations"); if (operations != null) { List ops = (List) operations.get("operation"); @@ -564,8 +565,13 @@ public Map postProcessOperations(Map objs) { } processOperation(operation); + + if (operation.hasAuthMethods) { + hasAuthMethods = true; + } } } + objs.put("hasAuthMethods", hasAuthMethods); } return objs; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java index 6f827f1db9a..125a9d6f607 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractGoCodegen.java @@ -51,6 +51,7 @@ public AbstractGoCodegen() { "complex64", "complex128", "rune", + "interface{}", "byte") ); @@ -458,8 +459,13 @@ public Map createMapping(String key, String value) { @Override public String toEnumValue(String value, String datatype) { - if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + if ("int".equals(datatype) || "int32".equals(datatype) || "int64".equals(datatype) + || "uint".equals(datatype) || "uint32".equals(datatype) || "uint64".equals(datatype) + || "float".equals(datatype) || "float32".equals(datatype) || "float64".equals(datatype) + || "boolean".equals(datatype) || "double".equals(datatype)) { return value; + } else if ("string".equals(datatype)) { + return String.format("\"%s\"", value); } else { return escapeText(value); } @@ -477,11 +483,16 @@ public String toEnumVarName(String name, String datatype) { } // number - if ("int".equals(datatype) || "double".equals(datatype) || "float".equals(datatype)) { + if ("int".equals(datatype) || "int32".equals(datatype) || "int64".equals(datatype) + || "uint".equals(datatype) || "uint32".equals(datatype) || "uint64".equals(datatype) + || "float".equals(datatype) || "float32".equals(datatype) || "float64".equals(datatype)) { String varName = name; varName = varName.replaceAll("-", "MINUS_"); varName = varName.replaceAll("\\+", "PLUS_"); varName = varName.replaceAll("\\.", "_DOT_"); + if (varName.matches("\\d.*")) { + return "_" + varName; + } return varName; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 262d6a3eaf9..05f6096e502 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java @@ -5,11 +5,16 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; +import java.util.LinkedList; import java.util.List; import java.util.ListIterator; import java.util.Map; import java.util.regex.Pattern; +import io.swagger.codegen.languages.features.NotNullAnnotationFeatures; +import io.swagger.codegen.languages.features.IgnoreUnknownJacksonFeatures; +import io.swagger.models.RefModel; +import io.swagger.models.properties.RefProperty; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -43,6 +48,8 @@ import io.swagger.models.properties.Property; import io.swagger.models.properties.StringProperty; +import static io.swagger.codegen.languages.features.NotNullAnnotationFeatures.NOT_NULL_JACKSON_ANNOTATION; +import static io.swagger.codegen.languages.features.IgnoreUnknownJacksonFeatures.IGNORE_UNKNOWN_JACKSON_ANNOTATION; public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig { @@ -51,14 +58,19 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code public static final String DEFAULT_LIBRARY = ""; public static final String DATE_LIBRARY = "dateLibrary"; public static final String JAVA8_MODE = "java8"; + public static final String JAVA11_MODE = "java11"; public static final String SUPPORT_ASYNC = "supportAsync"; public static final String WITH_XML = "withXml"; public static final String SUPPORT_JAVA6 = "supportJava6"; public static final String DISABLE_HTML_ESCAPING = "disableHtmlEscaping"; + public static final String ERROR_ON_UNKNOWN_ENUM = "errorOnUnknownEnum"; + public static final String CHECK_DUPLICATED_MODEL_NAME = "checkDuplicatedModelName"; + public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "additionalModelTypeAnnotations"; protected String dateLibrary = "threetenbp"; protected boolean supportAsync = false; protected boolean java8Mode = false; + protected boolean java11Mode = false; protected boolean withXml = false; protected String invokerPackage = "io.swagger"; protected String groupId = "io.swagger"; @@ -88,6 +100,9 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code protected String modelDocPath = "docs/"; protected boolean supportJava6= false; protected boolean disableHtmlEscaping = false; + private NotNullAnnotationFeatures notNullOption; + private IgnoreUnknownJacksonFeatures ignoreUnknown; + protected List additionalModelTypeAnnotations = new LinkedList<>(); public AbstractJavaCodegen() { super(); @@ -115,7 +130,7 @@ public AbstractJavaCodegen() { "this", "break", "double", "implements", "protected", "throw", "byte", "else", "import", "public", "throws", "case", "enum", "instanceof", "return", "transient", "catch", "extends", "int", "short", "try", "char", "final", "interface", "static", - "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", + "void", "class", "finally", "long", "strictfp", "volatile", "const", "float", "list", "native", "super", "while", "null") ); @@ -161,10 +176,17 @@ public AbstractJavaCodegen() { cliOptions.add(CliOption.newBoolean(FULL_JAVA_UTIL, "whether to use fully qualified name for classes under java.util. This option only works for Java API client")); cliOptions.add(new CliOption("hideGenerationTimestamp", "hides the timestamp when files were generated")); cliOptions.add(CliOption.newBoolean(WITH_XML, "whether to include support for application/xml content type and include XML annotations in the model (works with libraries that provide support for JSON and XML)")); - + if(this instanceof NotNullAnnotationFeatures){ + cliOptions.add(CliOption.newBoolean(NOT_NULL_JACKSON_ANNOTATION, "adds @JsonInclude(JsonInclude.Include.NON_NULL) annotation to model classes")); + } + if (this instanceof IgnoreUnknownJacksonFeatures){ + cliOptions.add(CliOption.newBoolean(IGNORE_UNKNOWN_JACKSON_ANNOTATION, + "adds @JsonIgnoreProperties(ignoreUnknown = true) annotation to model classes")); + } CliOption dateLibrary = new CliOption(DATE_LIBRARY, "Option. Date library to use"); Map dateOptions = new HashMap(); dateOptions.put("java8", "Java 8 native JSR310 (preferred for jdk 1.8+) - note: this also sets \"" + JAVA8_MODE + "\" to true"); + dateOptions.put("java11", "Java 11 native JSR384 (preferred for jdk 11+) - note: this also sets \"" + JAVA11_MODE + "\" to true"); dateOptions.put("threetenbp", "Backport of JSR310 (preferred for jdk < 1.8)"); dateOptions.put("java8-localdatetime", "Java 8 using LocalDateTime (for legacy app only)"); dateOptions.put("java8-instant", "Java 8 using Instant"); @@ -180,7 +202,16 @@ public AbstractJavaCodegen() { java8Mode.setEnum(java8ModeOptions); cliOptions.add(java8Mode); + CliOption java11Mode = new CliOption(JAVA11_MODE, "Option. Use Java11 classes instead of third party equivalents"); + Map java11ModeOptions = new HashMap(); + java11ModeOptions.put("true", "Use Java 11 classes"); + java11ModeOptions.put("false", "Various third party libraries as needed"); + java11Mode.setEnum(java11ModeOptions); + cliOptions.add(java11Mode); + cliOptions.add(CliOption.newBoolean(DISABLE_HTML_ESCAPING, "Disable HTML escaping of JSON strings when using gson (needed to avoid problems with byte[] fields)")); + cliOptions.add(CliOption.newBoolean(CHECK_DUPLICATED_MODEL_NAME, "Check if there are duplicated model names (ignoring case)")); + cliOptions.add(CliOption.newString(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, "Additional annotations for model type(class level annotations)")); } @Override @@ -188,7 +219,7 @@ public void processOpts() { super.processOpts(); if (additionalProperties.containsKey(SUPPORT_JAVA6)) { - this.setSupportJava6(Boolean.valueOf(additionalProperties.get(SUPPORT_JAVA6).toString())); + this.setSupportJava6(false); // JAVA 6 not supported } additionalProperties.put(SUPPORT_JAVA6, supportJava6); @@ -197,6 +228,11 @@ public void processOpts() { } additionalProperties.put(DISABLE_HTML_ESCAPING, disableHtmlEscaping); + if (additionalProperties.containsKey(ADDITIONAL_MODEL_TYPE_ANNOTATIONS)) { + String additionalAnnotationsList = additionalProperties.get(ADDITIONAL_MODEL_TYPE_ANNOTATIONS).toString(); + this.setAdditionalModelTypeAnnotations(Arrays.asList(additionalAnnotationsList.split(";"))); + } + if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { this.setInvokerPackage((String) additionalProperties.get(CodegenConstants.INVOKER_PACKAGE)); } else if (additionalProperties.containsKey(CodegenConstants.API_PACKAGE)) { @@ -338,6 +374,28 @@ public void processOpts() { this.setFullJavaUtil(Boolean.valueOf(additionalProperties.get(FULL_JAVA_UTIL).toString())); } + if (this instanceof NotNullAnnotationFeatures) { + notNullOption = (NotNullAnnotationFeatures)this; + if (additionalProperties.containsKey(NOT_NULL_JACKSON_ANNOTATION)) { + notNullOption.setNotNullJacksonAnnotation(convertPropertyToBoolean(NOT_NULL_JACKSON_ANNOTATION)); + writePropertyBack(NOT_NULL_JACKSON_ANNOTATION, notNullOption.isNotNullJacksonAnnotation()); + if (notNullOption.isNotNullJacksonAnnotation()) { + importMapping.put("JsonInclude", "com.fasterxml.jackson.annotation.JsonInclude"); + } + } + } + + if (this instanceof IgnoreUnknownJacksonFeatures) { + ignoreUnknown = (IgnoreUnknownJacksonFeatures)this; + if (additionalProperties.containsKey(IGNORE_UNKNOWN_JACKSON_ANNOTATION)) { + ignoreUnknown.setIgnoreUnknownJacksonAnnotation(convertPropertyToBoolean(IGNORE_UNKNOWN_JACKSON_ANNOTATION)); + writePropertyBack(IGNORE_UNKNOWN_JACKSON_ANNOTATION, ignoreUnknown.isIgnoreUnknownJacksonAnnotation()); + if (ignoreUnknown.isIgnoreUnknownJacksonAnnotation()) { + importMapping.put("JsonIgnoreProperties", "com.fasterxml.jackson.annotation.JsonIgnoreProperties"); + } + } + } + if (fullJavaUtil) { javaUtilPrefix = "java.util."; } @@ -349,6 +407,11 @@ public void processOpts() { } additionalProperties.put(WITH_XML, withXml); + if (additionalProperties.containsKey(ERROR_ON_UNKNOWN_ENUM)) { + boolean errorOnUnknownEnum = Boolean.parseBoolean(additionalProperties.get(ERROR_ON_UNKNOWN_ENUM).toString()); + additionalProperties.put(ERROR_ON_UNKNOWN_ENUM, errorOnUnknownEnum); + } + // make api and model doc path available in mustache template additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); @@ -400,12 +463,10 @@ public void processOpts() { // used later in recursive import in postProcessingModels importMapping.put("com.fasterxml.jackson.annotation.JsonProperty", "com.fasterxml.jackson.annotation.JsonCreator"); - if (additionalProperties.containsKey(JAVA8_MODE)) { - setJava8Mode(Boolean.parseBoolean(additionalProperties.get(JAVA8_MODE).toString())); - if ( java8Mode ) { - additionalProperties.put("java8", true); - } - } + setJava8Mode(Boolean.parseBoolean(String.valueOf(additionalProperties.get(JAVA8_MODE)))); + additionalProperties.put(JAVA8_MODE, java8Mode); + setJava11Mode(Boolean.parseBoolean(String.valueOf(additionalProperties.get(JAVA11_MODE)))); + additionalProperties.put(JAVA11_MODE, java11Mode); if (additionalProperties.containsKey(SUPPORT_ASYNC)) { setSupportAsync(Boolean.parseBoolean(additionalProperties.get(SUPPORT_ASYNC).toString())); @@ -459,6 +520,22 @@ public void processOpts() { } else if (dateLibrary.equals("legacy")) { additionalProperties.put("legacyDates", true); } + + if (this.skipAliasGeneration == null) { + this.skipAliasGeneration = Boolean.TRUE; + } + } + + @Override + public Map postProcessAllModels(Map objs) { + objs = super.postProcessAllModels(objs); + if (!additionalModelTypeAnnotations.isEmpty()) { + for (String modelName : objs.keySet()) { + Map models = (Map) objs.get(modelName); + models.put(ADDITIONAL_MODEL_TYPE_ANNOTATIONS, additionalModelTypeAnnotations); + } + } + return objs; } private void sanitizeConfig() { @@ -599,7 +676,7 @@ public String toParamName(String name) { public String toModelName(final String name) { // We need to check if import-mapping has a different model for this class, so we use it // instead of the auto-generated one. - if (importMapping.containsKey(name)) { + if (!getIgnoreImportMapping() && importMapping.containsKey(name)) { return importMapping.get(name); } @@ -903,6 +980,26 @@ public CodegenModel fromModel(String name, Model model, Map allDe final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel); codegenModel = AbstractJavaCodegen.reconcileInlineEnums(codegenModel, parentCodegenModel); } + if (this instanceof NotNullAnnotationFeatures) { + if (this instanceof NotNullAnnotationFeatures) { + notNullOption = (NotNullAnnotationFeatures)this; + if (additionalProperties.containsKey(NOT_NULL_JACKSON_ANNOTATION)) { + if (notNullOption.isNotNullJacksonAnnotation()) { + codegenModel.imports.add("JsonInclude"); + } + } + } + } + if (this instanceof IgnoreUnknownJacksonFeatures) { + if (this instanceof IgnoreUnknownJacksonFeatures) { + ignoreUnknown = (IgnoreUnknownJacksonFeatures)this; + if (additionalProperties.containsKey(IGNORE_UNKNOWN_JACKSON_ANNOTATION)) { + if (ignoreUnknown.isIgnoreUnknownJacksonAnnotation()) { + codegenModel.imports.add("JsonIgnoreProperties"); + } + } + } + } return codegenModel; } @@ -934,6 +1031,33 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert } } + @Override + protected void fixUpParentAndInterfaces(CodegenModel codegenModel, Map allModels) { + super.fixUpParentAndInterfaces(codegenModel, allModels); + if (codegenModel.vars == null || codegenModel.vars.isEmpty() || codegenModel.parentModel == null) { + return; + } + CodegenModel parentModel = codegenModel.parentModel; + + for (CodegenProperty codegenProperty : codegenModel.vars) { + while (parentModel != null) { + if (parentModel.vars == null || parentModel.vars.isEmpty()) { + parentModel = parentModel.parentModel; + continue; + } + boolean hasConflict = parentModel.vars.stream() + .anyMatch(parentProperty -> parentProperty.name.equals(codegenProperty.name) && !parentProperty.datatype.equals(codegenProperty.datatype)); + if (hasConflict) { + codegenProperty.name = toVarName(codegenModel.name + "_" + codegenProperty.name); + codegenProperty.getter = toGetter(codegenProperty.name); + codegenProperty.setter = toGetter(codegenProperty.name); + break; + } + parentModel = parentModel.parentModel; + } + } + } + @Override public void postProcessParameter(CodegenParameter parameter) { } @@ -979,6 +1103,10 @@ public void preprocessSwagger(Swagger swagger) { if (swagger == null || swagger.getPaths() == null){ return; } + boolean checkDuplicatedModelName = Boolean.parseBoolean(additionalProperties.get(CHECK_DUPLICATED_MODEL_NAME) != null ? additionalProperties.get(CHECK_DUPLICATED_MODEL_NAME).toString() : ""); + if (checkDuplicatedModelName) { + this.checkDuplicatedModelNameIgnoringCase(swagger); + } for (String pathname : swagger.getPaths().keySet()) { Path path = swagger.getPath(pathname); if (path.getOperations() == null){ @@ -1036,6 +1164,84 @@ private static String getAccept(Operation operation) { protected boolean needToImport(String type) { return super.needToImport(type) && type.indexOf(".") < 0; } + + protected void checkDuplicatedModelNameIgnoringCase(Swagger swagger) { + final Map definitions = swagger.getDefinitions(); + final Map> definitionsRepeated = new HashMap<>(); + + for (String definitionKey : definitions.keySet()) { + final Model model = definitions.get(definitionKey); + final String lowerKeyDefinition = definitionKey.toLowerCase(); + + if (definitionsRepeated.containsKey(lowerKeyDefinition)) { + Map modelMap = definitionsRepeated.get(lowerKeyDefinition); + if (modelMap == null) { + modelMap = new HashMap<>(); + definitionsRepeated.put(lowerKeyDefinition, modelMap); + } + modelMap.put(definitionKey, model); + } else { + definitionsRepeated.put(lowerKeyDefinition, null); + } + } + for (String lowerKeyDefinition : definitionsRepeated.keySet()) { + final Map modelMap = definitionsRepeated.get(lowerKeyDefinition); + if (modelMap == null) { + continue; + } + int index = 1; + for (String name : modelMap.keySet()) { + final Model model = modelMap.get(name); + final String newModelName = name + index; + definitions.put(newModelName, model); + replaceDuplicatedInPaths(swagger.getPaths(), name, newModelName); + replaceDuplicatedInModelProperties(definitions, name, newModelName); + definitions.remove(name); + index++; + } + } + } + + protected void replaceDuplicatedInPaths(Map paths, String modelName, String newModelName) { + if (paths == null || paths.isEmpty()) { + return; + } + paths.values().stream() + .flatMap(path -> path.getOperations().stream()) + .flatMap(operation -> operation.getParameters().stream()) + .filter(parameter -> parameter instanceof BodyParameter + && ((BodyParameter)parameter).getSchema() != null + && ((BodyParameter)parameter).getSchema() instanceof RefModel + ) + .forEach(parameter -> { + final RefModel refModel = (RefModel) ((BodyParameter)parameter).getSchema(); + if (refModel.getSimpleRef().equals(modelName)) { + refModel.set$ref(refModel.get$ref().replace(modelName, newModelName)); + } + }); + paths.values().stream() + .flatMap(path -> path.getOperations().stream()) + .flatMap(operation -> operation.getResponses().values().stream()) + .filter(response -> response.getResponseSchema() != null && response.getResponseSchema() instanceof RefModel) + .forEach(response -> { + final RefModel refModel = (RefModel) response.getResponseSchema(); + if (refModel.getSimpleRef().equals(modelName)) { + refModel.set$ref(refModel.get$ref().replace(modelName, newModelName)); + } + }); + } + + protected void replaceDuplicatedInModelProperties(Map definitions, String modelName, String newModelName) { + definitions.values().stream() + .flatMap(model -> model.getProperties().values().stream()) + .filter(property -> property instanceof RefProperty) + .forEach(property -> { + final RefProperty refProperty = (RefProperty) property; + if (refProperty.getSimpleRef().equals(modelName)) { + refProperty.set$ref(refProperty.get$ref().replace(modelName, newModelName)); + } + }); + } /* @Override public String findCommonPrefixOfVars(List vars) { @@ -1063,8 +1269,7 @@ public String toEnumVarName(String value, String datatype) { } // number - if ("Integer".equals(datatype) || "Long".equals(datatype) || - "Float".equals(datatype) || "Double".equals(datatype)) { + if ("Integer".equals(datatype) || "Long".equals(datatype) || "Float".equals(datatype) || "Double".equals(datatype) || "BigDecimal".equals(datatype)) { String varName = "NUMBER_" + value; varName = varName.replaceAll("-", "MINUS_"); varName = varName.replaceAll("\\+", "PLUS_"); @@ -1083,7 +1288,7 @@ public String toEnumVarName(String value, String datatype) { @Override public String toEnumValue(String value, String datatype) { - if ("Integer".equals(datatype) || "Double".equals(datatype)) { + if ("Integer".equals(datatype) || "Double".equals(datatype) || "Boolean".equals(datatype)) { return value; } else if ("Long".equals(datatype)) { // add l to number, e.g. 2048 => 2048l @@ -1091,6 +1296,8 @@ public String toEnumValue(String value, String datatype) { } else if ("Float".equals(datatype)) { // add f to number, e.g. 3.14 => 3.14f return value + "f"; + } else if ("BigDecimal".equals(datatype)) { + return "new BigDecimal(" + escapeText(value) + ")"; } else { return "\"" + escapeText(value) + "\""; } @@ -1265,6 +1472,10 @@ public void setJava8Mode(boolean enabled) { this.java8Mode = enabled; } + public void setJava11Mode(boolean java11Mode) { + this.java11Mode = java11Mode; + } + public void setDisableHtmlEscaping(boolean disabled) { this.disableHtmlEscaping = disabled; } @@ -1272,6 +1483,10 @@ public void setDisableHtmlEscaping(boolean disabled) { public void setSupportAsync(boolean enabled) { this.supportAsync = enabled; } + + public void setAdditionalModelTypeAnnotations(final List additionalModelTypeAnnotations) { + this.additionalModelTypeAnnotations = additionalModelTypeAnnotations; + } @Override public String escapeQuotationMark(String input) { @@ -1345,4 +1560,8 @@ public String sanitizeTag(String tag) { return tag; } + public boolean defaultIgnoreImportMappingOption() { + return true; + } + } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractKotlinCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractKotlinCodegen.java index aed0dc41b39..18d23d5c807 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractKotlinCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractKotlinCodegen.java @@ -406,6 +406,25 @@ public String toEnumVarName(String value, String datatype) { return modified; } + @Override + public String toEnumValue(String value, String datatype) { + if (isPrimivite(datatype)) { + return value; + } + return super.toEnumValue(value, datatype); + } + + @Override + public boolean isPrimivite(String datatype) { + return "kotlin.Byte".equalsIgnoreCase(datatype) + || "kotlin.Short".equalsIgnoreCase(datatype) + || "kotlin.Int".equalsIgnoreCase(datatype) + || "kotlin.Long".equalsIgnoreCase(datatype) + || "kotlin.Float".equalsIgnoreCase(datatype) + || "kotlin.Double".equalsIgnoreCase(datatype) + || "kotlin.Boolean".equalsIgnoreCase(datatype); + } + @Override public String toInstantiationType(Property p) { if (p instanceof ArrayProperty) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java index f669ffb6a59..aa14075c5d5 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AspNetCoreServerCodegen.java @@ -23,7 +23,7 @@ public class AspNetCoreServerCodegen extends AbstractCSharpCodegen { private String packageGuid = "{" + randomUUID().toString().toUpperCase() + "}"; - private final String DEFAULT_ASP_NET_CORE_VERSION = "2.2"; + private final String DEFAULT_ASP_NET_CORE_VERSION = "3.0"; private String aspNetCoreVersion; @SuppressWarnings("hiding") @@ -64,7 +64,7 @@ public AspNetCoreServerCodegen() { sourceFolder); addOption(CodegenConstants.ASP_NET_CORE_VERSION, - "aspnetcore version to use, current options are: 2.0, 2.1 and 2.2 (default)", + "aspnetcore version to use, current options are: 2.0, 2.1, 2.2 and 3.0 (default)", this.aspNetCoreVersion); addOption(CodegenConstants.INTERFACE_ONLY, @@ -133,16 +133,35 @@ public void processOpts() { apiTemplateFiles.put("controller.mustache", ".cs"); addInterfaceControllerTemplate(interfaceOnly, interfaceController); + supportingFiles.add(new SupportingFile("Filters" + File.separator + "BasePathFilter.mustache", packageFolder + File.separator + "Filters", "BasePathFilter.cs")); + supportingFiles.add(new SupportingFile("Filters" + File.separator + "GeneratePathParamsValidationFilter.mustache", packageFolder + File.separator + "Filters", "GeneratePathParamsValidationFilter.cs")); + + supportingFiles.add(new SupportingFile("Startup.mustache", packageFolder, "Startup.cs")); supportingFiles.add(new SupportingFile("Program.mustache", packageFolder, "Program.cs")); supportingFiles.add(new SupportingFile("Project.csproj.mustache", packageFolder, this.packageName + ".csproj")); supportingFiles.add(new SupportingFile("Dockerfile.mustache", packageFolder, "Dockerfile")); - } else { + } else if (this.aspNetCoreVersion.equals("2.1") || this.aspNetCoreVersion.equals("2.2")) { apiTemplateFiles.put("2.1/controller.mustache", ".cs"); addInterfaceControllerTemplate(interfaceOnly, interfaceController); + supportingFiles.add(new SupportingFile("Filters" + File.separator + "BasePathFilter.mustache", packageFolder + File.separator + "Filters", "BasePathFilter.cs")); + supportingFiles.add(new SupportingFile("Filters" + File.separator + "GeneratePathParamsValidationFilter.mustache", packageFolder + File.separator + "Filters", "GeneratePathParamsValidationFilter.cs")); + + supportingFiles.add(new SupportingFile("Startup.mustache", packageFolder, "Startup.cs")); supportingFiles.add(new SupportingFile("2.1/Program.mustache", packageFolder, "Program.cs")); supportingFiles.add(new SupportingFile("2.1/Project.csproj.mustache", packageFolder, this.packageName + ".csproj")); supportingFiles.add(new SupportingFile("2.1/Dockerfile.mustache", packageFolder, "Dockerfile")); + } else { + apiTemplateFiles.put("3.0/controller.mustache", ".cs"); + addInterfaceControllerTemplate(interfaceOnly, interfaceController); + + supportingFiles.add(new SupportingFile("3.0" + File.separator + "Filters" + File.separator + "BasePathFilter.mustache", packageFolder + File.separator + "Filters", "BasePathFilter.cs")); + supportingFiles.add(new SupportingFile("3.0" + File.separator + "Filters" + File.separator + "GeneratePathParamsValidationFilter.mustache", packageFolder + File.separator + "Filters", "GeneratePathParamsValidationFilter.cs")); + + supportingFiles.add(new SupportingFile("3.0/Startup.mustache", packageFolder, "Startup.cs")); + supportingFiles.add(new SupportingFile("3.0/Program.mustache", packageFolder, "Program.cs")); + supportingFiles.add(new SupportingFile("3.0/Project.csproj.mustache", packageFolder, this.packageName + ".csproj")); + supportingFiles.add(new SupportingFile("3.0/Dockerfile.mustache", packageFolder, "Dockerfile")); } additionalProperties.put("aspNetCoreVersion", aspNetCoreVersion); @@ -159,20 +178,14 @@ public void processOpts() { supportingFiles.add(new SupportingFile("build.bat.mustache", "", "build.bat")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("Solution.mustache", "", this.packageName + ".sln")); - supportingFiles.add(new SupportingFile("Dockerfile.mustache", packageFolder, "Dockerfile")); supportingFiles.add(new SupportingFile("gitignore", packageFolder, ".gitignore")); supportingFiles.add(new SupportingFile("appsettings.json", packageFolder, "appsettings.json")); - supportingFiles.add(new SupportingFile("Startup.mustache", packageFolder, "Startup.cs")); supportingFiles.add(new SupportingFile("validateModel.mustache", packageFolder + File.separator + "Attributes", "ValidateModelStateAttribute.cs")); supportingFiles.add(new SupportingFile("web.config", packageFolder, "web.config")); supportingFiles.add(new SupportingFile("Properties" + File.separator + "launchSettings.json", packageFolder + File.separator + "Properties", "launchSettings.json")); - supportingFiles.add(new SupportingFile("Filters" + File.separator + "BasePathFilter.mustache", packageFolder + File.separator + "Filters", "BasePathFilter.cs")); - supportingFiles.add(new SupportingFile("Filters" + File.separator + "GeneratePathParamsValidationFilter.mustache", packageFolder + File.separator + "Filters", "GeneratePathParamsValidationFilter.cs")); - - supportingFiles.add(new SupportingFile("wwwroot" + File.separator + "README.md", packageFolder + File.separator + "wwwroot", "README.md")); supportingFiles.add(new SupportingFile("wwwroot" + File.separator + "index.html", packageFolder + File.separator + "wwwroot", "index.html")); supportingFiles.add(new SupportingFile("wwwroot" + File.separator + "web.config", packageFolder + File.separator + "wwwroot", "web.config")); @@ -301,7 +314,7 @@ private void setAspNetCoreVersion(String optionValue) { return; } this.aspNetCoreVersion = optionValue; - if (!this.aspNetCoreVersion.equals("2.0") && !this.aspNetCoreVersion.equals("2.1") && !this.aspNetCoreVersion.equals("2.2")) { + if (!this.aspNetCoreVersion.equals("2.0") && !this.aspNetCoreVersion.equals("2.1") && !this.aspNetCoreVersion.equals("2.2") && !this.aspNetCoreVersion.equals("3.0")) { LOGGER.error("version '" + this.aspNetCoreVersion + "' is not supported, switching to default version: '" + DEFAULT_ASP_NET_CORE_VERSION + "'"); this.aspNetCoreVersion = DEFAULT_ASP_NET_CORE_VERSION; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java index 24129e87200..5484c900725 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CSharpClientCodegen.java @@ -4,12 +4,21 @@ import com.samskivert.mustache.Mustache; import io.swagger.codegen.*; import io.swagger.models.Model; +import io.swagger.models.ModelImpl; +import io.swagger.models.RefModel; +import io.swagger.models.Swagger; import io.swagger.models.properties.ArrayProperty; import io.swagger.models.properties.Property; +import io.swagger.models.properties.PropertyBuilder; +import io.swagger.models.properties.RefProperty; +import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.io.File; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import java.nio.charset.StandardCharsets; import java.util.*; import static org.apache.commons.lang3.StringUtils.isEmpty; @@ -29,6 +38,8 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen { // Defines the sdk option for targeted frameworks, which differs from targetFramework and targetFrameworkNuget private static final String MCS_NET_VERSION_KEY = "x-mcs-sdk"; + protected Swagger swagger; + protected String packageGuid = "{" + java.util.UUID.randomUUID().toString().toUpperCase() + "}"; protected String clientPackage = "IO.Swagger.Client"; protected String localVariablePrefix = ""; @@ -310,9 +321,8 @@ public void processOpts() { if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_METHOD_ARGUMENT)) { setOptionalMethodArgumentFlag(convertPropertyToBooleanAndWriteBack(CodegenConstants.OPTIONAL_METHOD_ARGUMENT)); - } else { - additionalProperties.put(CodegenConstants.OPTIONAL_METHOD_ARGUMENT, optionalMethodArgumentFlag); } + additionalProperties.put(CodegenConstants.OPTIONAL_METHOD_ARGUMENT, optionalMethodArgumentFlag); if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_ASSEMBLY_INFO)) { setOptionalAssemblyInfoFlag(convertPropertyToBooleanAndWriteBack(CodegenConstants.OPTIONAL_ASSEMBLY_INFO)); @@ -322,9 +332,8 @@ public void processOpts() { if (additionalProperties.containsKey(CodegenConstants.NON_PUBLIC_API)) { setNonPublicApi(convertPropertyToBooleanAndWriteBack(CodegenConstants.NON_PUBLIC_API)); - } else { - additionalProperties.put(CodegenConstants.NON_PUBLIC_API, isNonPublicApi()); } + additionalProperties.put(CodegenConstants.NON_PUBLIC_API, isNonPublicApi()); final String testPackageName = testPackageName(); String packageFolder = sourceFolder + File.separator + packageName; @@ -435,6 +444,10 @@ public void processOpts() { additionalProperties.put("apiDocPath", apiDocPath); additionalProperties.put("modelDocPath", modelDocPath); + + if (skipAliasGeneration == null) { + skipAliasGeneration = true; + } } public void setModelPropertyNaming(String naming) { @@ -479,6 +492,26 @@ public Map postProcessOperations(Map objs) { return objs; } + @Override + public String getSwaggerType(Property p) { + String swaggerType = super.getSwaggerType(p); + if (p instanceof RefProperty && this.swagger != null) { + final Map allDefinitions = this.swagger.getDefinitions(); + final Model referencedModel = allDefinitions.get(swaggerType); + if (referencedModel == null) { + return swaggerType; + } + if (referencedModel instanceof ModelImpl) { + final ModelImpl model = (ModelImpl) referencedModel; + if (!this.isModelObject(model) && (model.getEnum() == null || model.getEnum().isEmpty())) { + final Property property = PropertyBuilder.build(model.getType(), model.getFormat(), null); + swaggerType = getSwaggerType(property); + } + } + } + return swaggerType; + } + @Override public CodegenType getTag() { return CodegenType.CLIENT; @@ -554,6 +587,28 @@ public CodegenModel fromModel(String name, Model model, Map allDe return codegenModel; } + @Override + protected void readRefModelParameter(RefModel refModel, CodegenParameter codegenParameter, Set imports) { + String name = getSwaggerType(new RefProperty(refModel.get$ref())); + + try { + name = URLDecoder.decode(name, StandardCharsets.UTF_8.name()); + } catch (UnsupportedEncodingException e) { + LOGGER.error("Could not decoded string: " + name, e); + } + name = getAlias(name); + if (typeMapping.containsKey(name)) { + name = typeMapping.get(name); + } else { + if (defaultIncludes.contains(name)) { + imports.add(name); + } + } + codegenParameter.baseType = name; + codegenParameter.dataType = name; + } + + public void setOptionalProjectFileFlag(boolean flag) { this.optionalProjectFileFlag = flag; } @@ -805,4 +860,9 @@ public Mustache.Compiler processCompiler(Mustache.Compiler compiler) { // To avoid unexpected behaviors when options are passed programmatically such as { "supportsAsync": "" } return super.processCompiler(compiler).emptyStringIsFalse(true); } + + @Override + public void preprocessSwagger(Swagger swagger) { + this.swagger = swagger; + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java index fe71ba3006b..b16a84bfc6e 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/CsharpDotNet2ClientCodegen.java @@ -9,6 +9,7 @@ public class CsharpDotNet2ClientCodegen extends AbstractCSharpCodegen { public static final String CLIENT_PACKAGE = "clientPackage"; + public static final String USE_CSPROJ_FILE = "useCsProjFile"; protected String clientPackage = "IO.Swagger.Client"; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; @@ -68,6 +69,9 @@ public void processOpts() { supportingFiles.add(new SupportingFile("packages.config.mustache", "vendor", "packages.config")); supportingFiles.add(new SupportingFile("compile-mono.sh.mustache", "", "compile-mono.sh")); supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); + if (additionalProperties.containsKey(USE_CSPROJ_FILE) && Boolean.parseBoolean(additionalProperties.get(USE_CSPROJ_FILE).toString())) { + supportingFiles.add(new SupportingFile("csproj.mustache", "", clientPackage + ".csproj")); + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java index 377a8031070..0a850ca6cc3 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/DartClientCodegen.java @@ -100,6 +100,7 @@ public DartClientCodegen() { //TODO binary should be mapped to byte array // mapped to String as a workaround typeMapping.put("binary", "String"); + typeMapping.put("ByteArray", "String"); cliOptions.add(new CliOption(BROWSER_CLIENT, "Is the client browser based")); cliOptions.add(new CliOption(PUB_NAME, "Name in generated pubspec")); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java index 58f621ae3db..aa88c6263da 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java @@ -100,6 +100,7 @@ public void processOpts() { * it will be processed by the template engine. Otherwise, it will be copied */ supportingFiles.add(new SupportingFile("swagger.mustache", "api", "swagger.yaml")); + supportingFiles.add(new SupportingFile("Dockerfile", "", "Dockerfile")); supportingFiles.add(new SupportingFile("main.mustache", "", "main.go")); supportingFiles.add(new SupportingFile("routers.mustache", apiPath, "routers.go")); supportingFiles.add(new SupportingFile("logger.mustache", apiPath, "logger.go")); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java index 44b565554f9..432eb00dbc2 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaClientCodegen.java @@ -6,6 +6,8 @@ import io.swagger.codegen.*; import io.swagger.codegen.languages.features.BeanValidationFeatures; import io.swagger.codegen.languages.features.GzipFeatures; +import io.swagger.codegen.languages.features.NotNullAnnotationFeatures; +import io.swagger.codegen.languages.features.IgnoreUnknownJacksonFeatures; import io.swagger.codegen.languages.features.PerformBeanValidationFeatures; import org.apache.commons.lang3.BooleanUtils; @@ -19,7 +21,7 @@ public class JavaClientCodegen extends AbstractJavaCodegen implements BeanValidationFeatures, PerformBeanValidationFeatures, - GzipFeatures + GzipFeatures, NotNullAnnotationFeatures, IgnoreUnknownJacksonFeatures { static final String MEDIA_TYPE = "mediaType"; @@ -52,7 +54,8 @@ public class JavaClientCodegen extends AbstractJavaCodegen protected boolean performBeanValidation = false; protected boolean useGzipFeature = false; protected boolean useRuntimeException = false; - + private boolean notNullJacksonAnnotation; + private boolean ignoreUnknownJacksonAnnotation = false; public JavaClientCodegen() { super(); @@ -68,22 +71,21 @@ public JavaClientCodegen() { cliOptions.add(CliOption.newBoolean(PARCELABLE_MODEL, "Whether to generate models for Android that implement Parcelable with the okhttp-gson library.")); cliOptions.add(CliOption.newBoolean(USE_PLAY_WS, "Use Play! Async HTTP client (Play WS API)")); cliOptions.add(CliOption.newString(PLAY_VERSION, "Version of Play! Framework (possible values \"play24\", \"play25\")")); - cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1 library.")); cliOptions.add(CliOption.newBoolean(USE_BEANVALIDATION, "Use BeanValidation API annotations")); cliOptions.add(CliOption.newBoolean(PERFORM_BEANVALIDATION, "Perform BeanValidation")); cliOptions.add(CliOption.newBoolean(USE_GZIP_FEATURE, "Send gzip-encoded requests")); cliOptions.add(CliOption.newBoolean(USE_RUNTIME_EXCEPTION, "Use RuntimeException instead of Exception")); - supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.4. JSON processing: Jackson 2.10.1. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); - supportedLibraries.put("feign", "HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.10.1"); - supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.29.1. JSON processing: Jackson 2.10.1"); + supportedLibraries.put("jersey1", "HTTP client: Jersey client 1.19.4. JSON processing: Jackson 2.11.4. Enable Java6 support using '-DsupportJava6=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); + supportedLibraries.put("feign", "HTTP client: OpenFeign 9.4.0. JSON processing: Jackson 2.11.4"); + supportedLibraries.put("jersey2", "HTTP client: Jersey client 2.29.1. JSON processing: Jackson 2.11.4"); supportedLibraries.put("okhttp-gson", "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.8.1. Enable Parcelable models on Android using '-DparcelableModel=true'. Enable gzip request encoding using '-DuseGzipFeature=true'."); supportedLibraries.put(RETROFIT_1, "HTTP client: OkHttp 2.7.5. JSON processing: Gson 2.3.1 (Retrofit 1.9.0). IMPORTANT NOTE: retrofit1.x is no longer actively maintained so please upgrade to 'retrofit2' instead."); supportedLibraries.put(RETROFIT_2, "HTTP client: OkHttp 3.8.0. JSON processing: Gson 2.6.1 (Retrofit 2.3.0). Enable the RxJava adapter using '-DuseRxJava[2]=true'. (RxJava 1.x or 2.x)"); - supportedLibraries.put("resttemplate", "HTTP client: Spring RestTemplate 4.3.9-RELEASE. JSON processing: Jackson 2.10.1"); - supportedLibraries.put("resteasy", "HTTP client: Resteasy client 3.1.3.Final. JSON processing: Jackson 2.10.1"); - supportedLibraries.put("vertx", "HTTP client: VertX client 3.2.4. JSON processing: Jackson 2.10.1"); - supportedLibraries.put("google-api-client", "HTTP client: Google API client 1.23.0. JSON processing: Jackson 2.10.1"); + supportedLibraries.put("resttemplate", "HTTP client: Spring RestTemplate 4.3.9-RELEASE. JSON processing: Jackson 2.11.4"); + supportedLibraries.put("resteasy", "HTTP client: Resteasy client 3.1.3.Final. JSON processing: Jackson 2.11.4"); + supportedLibraries.put("vertx", "HTTP client: VertX client 3.2.4. JSON processing: Jackson 2.11.4"); + supportedLibraries.put("google-api-client", "HTTP client: Google API client 1.23.0. JSON processing: Jackson 2.11.4"); supportedLibraries.put("rest-assured", "HTTP client: rest-assured : 3.1.0. JSON processing: Gson 2.6.1. Only for Java8"); CliOption libraryOption = new CliOption(CodegenConstants.LIBRARY, "library template (sub-template) to use"); @@ -611,4 +613,23 @@ static boolean isJsonVendorMimeType(String mime) { return mime != null && JSON_VENDOR_MIME_PATTERN.matcher(mime).matches(); } + @Override + public void setNotNullJacksonAnnotation(boolean notNullJacksonAnnotation) { + this.notNullJacksonAnnotation = notNullJacksonAnnotation; + } + + @Override + public boolean isNotNullJacksonAnnotation() { + return notNullJacksonAnnotation; + } + + @Override + public void setIgnoreUnknownJacksonAnnotation(boolean ignoreUnknownJacksonAnnotation) { + this.ignoreUnknownJacksonAnnotation = ignoreUnknownJacksonAnnotation; + } + + @Override + public boolean isIgnoreUnknownJacksonAnnotation() { + return ignoreUnknownJacksonAnnotation; + } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java index 3d66995f386..ff5b9be3f0b 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJAXRSSpecServerCodegen.java @@ -1,23 +1,26 @@ package io.swagger.codegen.languages; -import java.io.File; -import java.io.IOException; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; - -import org.apache.commons.io.FileUtils; - import io.swagger.codegen.CliOption; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenOperation; +import io.swagger.codegen.CodegenParameter; import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.SupportingFile; import io.swagger.models.Operation; import io.swagger.models.Swagger; +import io.swagger.models.parameters.Parameter; import io.swagger.util.Json; +import org.apache.commons.io.FileUtils; + +import java.io.File; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; public class JavaJAXRSSpecServerCodegen extends AbstractJavaJAXRSServerCodegen { @@ -56,6 +59,7 @@ public JavaJAXRSSpecServerCodegen() typeMapping.put("date", "LocalDate"); importMapping.put("LocalDate", "org.joda.time.LocalDate"); + importMapping.put("InputStream", "java.io.InputStream"); super.embeddedTemplateDir = templateDir = JAXRS_TEMPLATE_DIRECTORY_NAME + File.separator + "spec"; @@ -161,12 +165,39 @@ public void postProcessModelProperty(CodegenModel model, CodegenProperty propert model.imports.remove("JsonProperty"); } + @Override + public void postProcessModelProperties(CodegenModel model){ + if (model.vars == null || model.vars.isEmpty()) { + return; + } + final boolean useJackson = Boolean.valueOf(String.valueOf(additionalProperties.get("jackson"))); + boolean hasEnumProperty = false; + for(CodegenProperty codegenProperty : model.vars) { + postProcessModelProperty(model, codegenProperty); + if (codegenProperty.isEnum) { + hasEnumProperty = true; + } + } + if (useJackson && hasEnumProperty) { + model.imports.add("JsonValue"); + model.imports.add("JsonCreator"); + } + } + + public CodegenParameter fromParameter(Parameter param, Set imports) { + final CodegenParameter parameter = super.fromParameter(param, imports); + if (parameter.isFile) { + imports.add("InputStream"); + } + return parameter; + } + @Override public void preprocessSwagger(Swagger swagger) { //copy input swagger to output folder try { String swaggerJson = Json.pretty(swagger); - FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson); + FileUtils.writeStringToFile(new File(outputFolder + File.separator + "swagger.json"), swaggerJson, StandardCharsets.UTF_8); } catch (IOException e) { throw new RuntimeException(e.getMessage(), e.getCause()); } @@ -174,8 +205,7 @@ public void preprocessSwagger(Swagger swagger) { } @Override - public String getHelp() - { + public String getHelp() { return "Generates a Java JAXRS Server according to JAXRS 2.0 specification."; } } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJerseyServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJerseyServerCodegen.java index 0c0aa767f8f..48c99aa9f3f 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJerseyServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaJerseyServerCodegen.java @@ -13,7 +13,7 @@ public class JavaJerseyServerCodegen extends AbstractJavaJAXRSServerCodegen { protected static final String LIBRARY_JERSEY1 = "jersey1"; protected static final String LIBRARY_JERSEY2 = "jersey2"; - + /** * Default library template to use. (Default:{@value #DEFAULT_LIBRARY}) */ @@ -48,7 +48,6 @@ public JavaJerseyServerCodegen() { library.setDefault(DEFAULT_LIBRARY); cliOptions.add(library); - cliOptions.add(CliOption.newBoolean(SUPPORT_JAVA6, "Whether to support Java6 with the Jersey1/2 library.")); cliOptions.add(CliOption.newBoolean(USE_TAGS, "use tags for creating interface and controller classnames")); } @@ -89,11 +88,11 @@ public void processOpts() { if (StringUtils.isEmpty(library)) { setLibrary(DEFAULT_LIBRARY); } - + if ( additionalProperties.containsKey(CodegenConstants.IMPL_FOLDER)) { implFolder = (String) additionalProperties.get(CodegenConstants.IMPL_FOLDER); } - + if (additionalProperties.containsKey(USE_TAGS)) { this.setUseTags(Boolean.valueOf(additionalProperties.get(USE_TAGS).toString())); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java index 6b59748e3be..041fac10342 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavaResteasyServerCodegen.java @@ -99,6 +99,7 @@ public void processOpts() { supportingFiles.add(new SupportingFile("LocalDateProvider.mustache", (sourceFolder + '/' + apiPackage).replace(".", "/"), "LocalDateProvider.java")); } + writeOptional(outputFolder, new SupportingFile("Dockerfile.mustache", "", "Dockerfile")); } @Override diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 351245bca5a..fb2dd0243af 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java @@ -873,7 +873,7 @@ public CodegenOperation fromOperation(String path, String httpMethod, Operation public CodegenModel fromModel(String name, Model model, Map allDefinitions) { CodegenModel codegenModel = super.fromModel(name, model, allDefinitions); - if (allDefinitions != null && codegenModel != null && codegenModel.parent != null && codegenModel.hasEnums) { + if (allDefinitions != null && codegenModel != null && codegenModel.parent != null && codegenModel.hasEnums && codegenModel.parentSchema != null) { final Model parentModel = allDefinitions.get(codegenModel.parentSchema); final CodegenModel parentCodegenModel = super.fromModel(codegenModel.parent, parentModel, allDefinitions); codegenModel = JavascriptClientCodegen.reconcileInlineEnums(codegenModel, parentCodegenModel); @@ -900,6 +900,14 @@ public CodegenModel fromModel(String name, Model model, Map allDe return codegenModel; } + @Override + protected void addAdditionPropertiesToCodeGenModel(CodegenModel codegenModel, ModelImpl swaggerModel) { + super.addAdditionPropertiesToCodeGenModel(codegenModel, swaggerModel); + if (swaggerModel.getAdditionalProperties() != null) { + codegenModel.additionalPropertiesType = getSwaggerType(swaggerModel.getAdditionalProperties()); + } + } + private String sanitizePath(String p) { //prefer replace a ', instead of a fuLL URL encode for readability return p.replaceAll("'", "%27"); @@ -1051,9 +1059,11 @@ public Map postProcessOperationsWithModels(Map o // Provide access to all property models. for (CodegenModel cgModel : new HashSet(cgModels.values())) { + detectRecursiveModel(cgModel.allVars, cgModel.classname, cgModels); postProcessProperties(cgModel.vars, cgModels); - if (cgModel.allVars != cgModel.vars) + if (cgModel.allVars != cgModel.vars) { postProcessProperties(cgModel.allVars, cgModels); + } } return objs; @@ -1305,6 +1315,27 @@ public Map postProcessModels(Map objs) { return objs; } + public void detectRecursiveModel(List allVars, String className, Map allModels) { + if (allVars == null || allVars.isEmpty()) { + return; + } + for (CodegenProperty codegenProperty : allVars) { + if (codegenProperty.isPrimitiveType) { + continue; + } + if (codegenProperty.isListContainer || codegenProperty.isMapContainer) { + if (className.equalsIgnoreCase(codegenProperty.items.datatype)) { + codegenProperty.items.vendorExtensions.put("x-is-recursive-model", Boolean.TRUE); + continue; + } + } + if (className.equalsIgnoreCase(codegenProperty.datatype)) { + codegenProperty.vendorExtensions.put("x-is-recursive-model", Boolean.TRUE); + continue; + } + } + } + @Override protected boolean needToImport(String type) { return !defaultIncludes.contains(type) @@ -1389,7 +1420,7 @@ public String toEnumVarName(String value, String datatype) { @Override public String toEnumValue(String value, String datatype) { - if ("Integer".equals(datatype) || "Number".equals(datatype)) { + if ("Integer".equals(datatype) || "Number".equals(datatype) || "Boolean".equals(datatype)) { return value; } else { return "\"" + escapeText(value) + "\""; diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java index 542e3820332..9ef2e69e009 100755 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/PythonClientCodegen.java @@ -25,12 +25,20 @@ public class PythonClientCodegen extends DefaultCodegen implements CodegenConfig public static final String PACKAGE_URL = "packageUrl"; public static final String DEFAULT_LIBRARY = "urllib3"; + public static final String WRITE_BINARY_OPTION = "writeBinary"; + + public static final String CASE_OPTION = "case"; + public static final String CAMEL_CASE_OPTION = "camel"; + public static final String SNAKE_CASE_OPTION = "snake"; + public static final String KEBAB_CASE_OPTION = "kebab"; + protected String packageName; // e.g. petstore_api protected String packageVersion; protected String projectName; // for setup.py, e.g. petstore-api protected String packageUrl; protected String apiDocPath = "docs/"; protected String modelDocPath = "docs/"; + protected String caseType; protected Map regexModifiers; @@ -140,6 +148,8 @@ public PythonClientCodegen() { libraryOption.setDefault(DEFAULT_LIBRARY); cliOptions.add(libraryOption); setLibrary(DEFAULT_LIBRARY); + + this.caseType = SNAKE_CASE_OPTION; } @Override @@ -159,7 +169,8 @@ public void processOpts() { } if (additionalProperties.containsKey(CodegenConstants.PROJECT_NAME)) { - setProjectName((String) additionalProperties.get(CodegenConstants.PROJECT_NAME)); + String projectName = (String) additionalProperties.get(CodegenConstants.PROJECT_NAME); + setProjectName(projectName.replaceAll("[^a-zA-Z0-9\\s\\-_]","")); } else { // default: set project based on package name @@ -174,6 +185,11 @@ public void processOpts() { setPackageVersion("1.0.0"); } + if (additionalProperties.containsKey(WRITE_BINARY_OPTION)) { + boolean optionValue = Boolean.parseBoolean(String.valueOf(additionalProperties.get(WRITE_BINARY_OPTION))); + additionalProperties.put(WRITE_BINARY_OPTION, optionValue); + } + additionalProperties.put(CodegenConstants.PROJECT_NAME, projectName); additionalProperties.put(CodegenConstants.PACKAGE_NAME, packageName); additionalProperties.put(CodegenConstants.PACKAGE_VERSION, packageVersion); @@ -186,16 +202,20 @@ public void processOpts() { setPackageUrl((String) additionalProperties.get(PACKAGE_URL)); } + this.setCaseType(); + + final String packageFolder = packageName.replace('.', File.separatorChar); + supportingFiles.add(new SupportingFile("README.mustache", "", "README.md")); supportingFiles.add(new SupportingFile("tox.mustache", "", "tox.ini")); supportingFiles.add(new SupportingFile("test-requirements.mustache", "", "test-requirements.txt")); supportingFiles.add(new SupportingFile("requirements.mustache", "", "requirements.txt")); - supportingFiles.add(new SupportingFile("configuration.mustache", packageName, "configuration.py")); - supportingFiles.add(new SupportingFile("__init__package.mustache", packageName, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__model.mustache", packageName + File.separatorChar + modelPackage, "__init__.py")); - supportingFiles.add(new SupportingFile("__init__api.mustache", packageName + File.separatorChar + apiPackage, "__init__.py")); + supportingFiles.add(new SupportingFile("configuration.mustache", packageFolder, "configuration.py")); + supportingFiles.add(new SupportingFile("__init__package.mustache", packageFolder, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__model.mustache", packageFolder + File.separatorChar + modelPackage, "__init__.py")); + supportingFiles.add(new SupportingFile("__init__api.mustache", packageFolder + File.separatorChar + apiPackage, "__init__.py")); if(Boolean.FALSE.equals(excludeTests)) { supportingFiles.add(new SupportingFile("__init__test.mustache", testFolder, "__init__.py")); @@ -204,16 +224,16 @@ public void processOpts() { supportingFiles.add(new SupportingFile("gitignore.mustache", "", ".gitignore")); supportingFiles.add(new SupportingFile("travis.mustache", "", ".travis.yml")); supportingFiles.add(new SupportingFile("setup.mustache", "", "setup.py")); - supportingFiles.add(new SupportingFile("api_client.mustache", packageName, "api_client.py")); + supportingFiles.add(new SupportingFile("api_client.mustache", packageFolder, "api_client.py")); if ("asyncio".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packageName, "rest.py")); + supportingFiles.add(new SupportingFile("asyncio/rest.mustache", packageFolder, "rest.py")); additionalProperties.put("asyncio", "true"); } else if ("tornado".equals(getLibrary())) { - supportingFiles.add(new SupportingFile("tornado/rest.mustache", packageName, "rest.py")); + supportingFiles.add(new SupportingFile("tornado/rest.mustache", packageFolder, "rest.py")); additionalProperties.put("tornado", "true"); } else { - supportingFiles.add(new SupportingFile("rest.mustache", packageName, "rest.py")); + supportingFiles.add(new SupportingFile("rest.mustache", packageFolder, "rest.py")); } modelPackage = packageName + "." + modelPackage; @@ -286,6 +306,15 @@ public void postProcessPattern(String pattern, Map vendorExtensi } } + protected void setCaseType() { + final String caseType = String.valueOf(additionalProperties.get(CASE_OPTION)); + if (CAMEL_CASE_OPTION.equalsIgnoreCase(caseType) || SNAKE_CASE_OPTION.equalsIgnoreCase(caseType) || KEBAB_CASE_OPTION.equalsIgnoreCase(caseType)) { + this.caseType = caseType; + } else { + this.caseType = SNAKE_CASE_OPTION; + } + } + @Override public CodegenType getTag() { return CodegenType.CLIENT; @@ -400,13 +429,18 @@ public String toVarName(String name) { if (name.matches("^[A-Z_]*$")) { name = name.toLowerCase(); } + if (CAMEL_CASE_OPTION.equalsIgnoreCase(this.caseType)) { + name = camelize(name, true); + } else if (KEBAB_CASE_OPTION.equalsIgnoreCase(this.caseType)) { + name = dashize(name); + } else { + // underscore the variable name + // petId => pet_id + name = underscore(name); - // underscore the variable name - // petId => pet_id - name = underscore(name); - - // remove leading underscore - name = name.replaceAll("^_*", ""); + // remove leading underscore + name = name.replaceAll("^_*", ""); + } // for reserved word or word starting with number, append _ if (isReservedWord(name) || name.matches("^\\d.*")) { diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java index 87db2d63d6d..0f2a44285bc 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/RubyClientCodegen.java @@ -577,7 +577,7 @@ public String toEnumVarName(String name, String datatype) { varName = varName.replaceAll("-", "MINUS_"); varName = varName.replaceAll("\\+", "PLUS_"); varName = varName.replaceAll("\\.", "_DOT_"); - return varName; + return "N" + varName; } // string diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java index ec0e7cb4dc7..c5255339301 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/ScalaGatlingCodegen.java @@ -8,6 +8,7 @@ import org.apache.commons.lang3.StringUtils; import java.io.IOException; +import java.nio.charset.StandardCharsets; import java.util.*; import java.io.File; @@ -252,7 +253,11 @@ public void preprocessSwagger(Swagger swagger) { operation.setVendorExtension("x-gatling-body-feeder", operation.getOperationId() + "BodyFeeder"); operation.setVendorExtension("x-gatling-body-feeder-params", StringUtils.join(sessionBodyVars, ",")); try { - FileUtils.writeStringToFile(new File(outputFolder + File.separator + dataFolder + File.separator + operation.getOperationId() + "-" + "bodyParams.csv"), StringUtils.join(bodyFeederParams, ",")); + FileUtils.writeStringToFile( + new File(outputFolder + File.separator + dataFolder + File.separator + operation.getOperationId() + "-" + "bodyParams.csv"), + StringUtils.join(bodyFeederParams, ","), + StandardCharsets.UTF_8 + ); } catch (IOException ioe) { LOGGER.error("Could not create feeder file for operationId" + operation.getOperationId(), ioe); } @@ -296,7 +301,11 @@ private void prepareGatlingData(Operation operation, Set parameters, operation.setVendorExtension("x-gatling-" + parameterType.toLowerCase() + "-params", vendorList); operation.setVendorExtension("x-gatling-" + parameterType.toLowerCase() + "-feeder", operation.getOperationId() + parameterType.toUpperCase() + "Feeder"); try { - FileUtils.writeStringToFile(new File(outputFolder + File.separator + dataFolder + File.separator + operation.getOperationId() + "-" + parameterType.toLowerCase() + "Params.csv"), StringUtils.join(parameterNames, ",")); + FileUtils.writeStringToFile( + new File(outputFolder + File.separator + dataFolder + File.separator + operation.getOperationId() + "-" + parameterType.toLowerCase() + "Params.csv"), + StringUtils.join(parameterNames, ","), + StandardCharsets.UTF_8 + ); } catch (IOException ioe) { LOGGER.error("Could not create feeder file for operationId" + operation.getOperationId(), ioe); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java index d07d6ef2106..bf302c4b516 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SpringCodegen.java @@ -4,6 +4,8 @@ import com.samskivert.mustache.Template; import io.swagger.codegen.*; import io.swagger.codegen.languages.features.BeanValidationFeatures; +import io.swagger.codegen.languages.features.NotNullAnnotationFeatures; +import io.swagger.codegen.languages.features.IgnoreUnknownJacksonFeatures; import io.swagger.codegen.languages.features.OptionalFeatures; import io.swagger.models.Operation; import io.swagger.models.Path; @@ -17,7 +19,8 @@ public class SpringCodegen extends AbstractJavaCodegen - implements BeanValidationFeatures, OptionalFeatures { + implements BeanValidationFeatures, OptionalFeatures, + NotNullAnnotationFeatures, IgnoreUnknownJacksonFeatures { public static final String DEFAULT_LIBRARY = "spring-boot"; public static final String TITLE = "title"; public static final String CONFIG_PACKAGE = "configPackage"; @@ -26,6 +29,7 @@ public class SpringCodegen extends AbstractJavaCodegen public static final String DELEGATE_PATTERN = "delegatePattern"; public static final String SINGLE_CONTENT_TYPES = "singleContentTypes"; public static final String JAVA_8 = "java8"; + public static final String JAVA_11 = "java11"; public static final String ASYNC = "async"; public static final String RESPONSE_WRAPPER = "responseWrapper"; public static final String USE_TAGS = "useTags"; @@ -44,6 +48,7 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean delegateMethod = false; protected boolean singleContentTypes = false; protected boolean java8 = false; + protected boolean java11 = false; protected boolean async = false; protected String responseWrapper = ""; protected boolean useTags = false; @@ -53,6 +58,8 @@ public class SpringCodegen extends AbstractJavaCodegen protected boolean useOptional = false; protected boolean openFeign = false; protected boolean defaultInterfaces = true; + private boolean notNullJacksonAnnotation; + private boolean ignoreUnknownJacksonAnnotation = false; public SpringCodegen() { super(); @@ -129,6 +136,15 @@ public void processOpts() { setDateLibrary("java8"); } } + if (additionalProperties.containsKey(JAVA_11)) { + this.setJava8(Boolean.valueOf(additionalProperties.get(JAVA_11).toString())); + } + if (this.java11) { + additionalProperties.put("javaVersion", "11"); + additionalProperties.put("jdk11", "true"); + } + + additionalProperties.put("isJava8or11", this.java8 || this.java11); // set invokerPackage as basePackage if (additionalProperties.containsKey(CodegenConstants.INVOKER_PACKAGE)) { @@ -169,10 +185,6 @@ public void processOpts() { this.setSingleContentTypes(Boolean.valueOf(additionalProperties.get(SINGLE_CONTENT_TYPES).toString())); } - if (additionalProperties.containsKey(JAVA_8)) { - this.setJava8(Boolean.valueOf(additionalProperties.get(JAVA_8).toString())); - } - if (additionalProperties.containsKey(ASYNC)) { this.setAsync(Boolean.valueOf(additionalProperties.get(ASYNC).toString())); } @@ -296,7 +308,7 @@ public void processOpts() { } } - if ((!this.delegatePattern && this.java8) || this.delegateMethod) { + if ((!this.delegatePattern && (this.java8 || this.java11)) || this.delegateMethod) { additionalProperties.put("jdk8-no-delegate", true); } @@ -307,8 +319,6 @@ public void processOpts() { } if (this.java8) { - additionalProperties.put("javaVersion", "1.8"); - additionalProperties.put("jdk8", "true"); if (this.async) { additionalProperties.put(RESPONSE_WRAPPER, "CompletableFuture"); } @@ -499,6 +509,26 @@ public void setReturnContainer(final String returnContainer) { return objs; } + @Override + public void setNotNullJacksonAnnotation(boolean notNullJacksonAnnotation) { + this.notNullJacksonAnnotation = notNullJacksonAnnotation; + } + + @Override + public boolean isNotNullJacksonAnnotation() { + return notNullJacksonAnnotation; + } + + @Override + public void setIgnoreUnknownJacksonAnnotation(boolean ignoreUnknownJacksonAnnotation) { + this.ignoreUnknownJacksonAnnotation = ignoreUnknownJacksonAnnotation; + } + + @Override + public boolean isIgnoreUnknownJacksonAnnotation() { + return ignoreUnknownJacksonAnnotation; + } + private interface DataTypeAssigner { void setReturnType(String returnType); void setReturnContainer(String returnContainer); @@ -632,6 +662,8 @@ public void setSingleContentTypes(boolean singleContentTypes) { public void setJava8(boolean java8) { this.java8 = java8; } + public void setJava11(boolean java11) { this.java11 = java11; } + public void setAsync(boolean async) { this.async = async; } public void setResponseWrapper(String responseWrapper) { this.responseWrapper = responseWrapper; } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java index 84a43f52672..83b7c0443c1 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerGenerator.java @@ -1,6 +1,7 @@ package io.swagger.codegen.languages; import java.io.File; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; @@ -62,7 +63,7 @@ public void processSwagger(Swagger swagger) { try { String outputFile = outputFolder + File.separator + this.outputFile; - FileUtils.writeStringToFile(new File(outputFile), swaggerString); + FileUtils.writeStringToFile(new File(outputFile), swaggerString, StandardCharsets.UTF_8); LOGGER.debug("wrote file to " + outputFile); } catch (Exception e) { LOGGER.error(e.getMessage(), e); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java index 340da572994..14cf9dc682c 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/SwaggerYamlGenerator.java @@ -20,6 +20,7 @@ import org.slf4j.LoggerFactory; import java.io.File; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map; @@ -84,7 +85,7 @@ public void processSwagger(Swagger swagger) { configureMapper(mapper); String swaggerString = mapper.writeValueAsString(swagger); String outputFile = outputFolder + File.separator + this.outputFile; - FileUtils.writeStringToFile(new File(outputFile), swaggerString); + FileUtils.writeStringToFile(new File(outputFile), swaggerString, StandardCharsets.UTF_8); LOGGER.debug("wrote file to " + outputFile); } catch (Exception e) { LOGGER.error(e.getMessage(), e); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java index 24007199db1..d6fe3c8a414 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java @@ -31,10 +31,12 @@ public class TypeScriptAngularClientCodegen extends AbstractTypeScriptClientCode public static final String TAGGED_UNIONS ="taggedUnions"; public static final String NG_VERSION = "ngVersion"; public static final String PROVIDED_IN_ROOT ="providedInRoot"; + public static final String KEBAB_FILE_NAME ="kebab-file-name"; protected String npmName = null; protected String npmVersion = "1.0.0"; protected String npmRepository = null; + protected boolean kebabFileNaming; private boolean taggedUnions = false; @@ -136,9 +138,12 @@ public void processOpts() { additionalProperties.put("injectionTokenTyped", ngVersion.atLeast("4.0.0")); additionalProperties.put("useHttpClient", ngVersion.atLeast("4.3.0")); additionalProperties.put("useRxJS6", ngVersion.atLeast("6.0.0")); + additionalProperties.put("genericModuleWithProviders", ngVersion.atLeast("7.0.0")); if (!ngVersion.atLeast("4.3.0")) { supportingFiles.add(new SupportingFile("rxjs-operators.mustache", getIndexDirectory(), "rxjs-operators.ts")); } + + kebabFileNaming = Boolean.parseBoolean(String.valueOf(additionalProperties.get(KEBAB_FILE_NAME))); } private void addNpmPackageGeneration(SemVer ngVersion) { @@ -161,6 +166,59 @@ private void addNpmPackageGeneration(SemVer ngVersion) { this.setNpmRepository(additionalProperties.get(NPM_REPOSITORY).toString()); } + // Set the typescript version compatible to the Angular version + if (ngVersion.atLeast("11.0.0")) { + additionalProperties.put("tsVersion", ">=4.0.0 <4.1.0"); + additionalProperties.put("rxjsVersion", "6.6.0"); + additionalProperties.put("ngPackagrVersion", "11.0.2"); + additionalProperties.put("tsickleVersion", "0.39.1"); + additionalProperties.put("zonejsVersion", "0.11.3"); + + additionalProperties.put("skipHttpImport", true); + } else if (ngVersion.atLeast("10.0.0")) { + additionalProperties.put("tsVersion", ">=3.9.2 <4.0.0"); + additionalProperties.put("rxjsVersion", "6.6.0"); + additionalProperties.put("ngPackagrVersion", "10.0.3"); + additionalProperties.put("tsickleVersion", "0.39.1"); + additionalProperties.put("zonejsVersion", "0.10.2"); + + additionalProperties.put("skipHttpImport", true); + } else if (ngVersion.atLeast("9.0.0")) { + additionalProperties.put("tsVersion", ">=3.6.0 <3.8.0"); + additionalProperties.put("rxjsVersion", "6.5.3"); + additionalProperties.put("ngPackagrVersion", "9.0.1"); + additionalProperties.put("tsickleVersion", "0.38.0"); + additionalProperties.put("zonejsVersion", "0.10.2"); + + additionalProperties.put("skipHttpImport", true); + } else if (ngVersion.atLeast("8.0.0")) { + additionalProperties.put("tsVersion", ">=3.4.0 <3.6.0"); + additionalProperties.put("rxjsVersion", "6.5.0"); + additionalProperties.put("ngPackagrVersion", "5.4.0"); + additionalProperties.put("tsickleVersion", "0.35.0"); + additionalProperties.put("zonejsVersion", "0.9.1"); + + additionalProperties.put("skipHttpImport", true); + } else if (ngVersion.atLeast("7.0.0")) { + additionalProperties.put("tsVersion", ">=3.1.1 <3.2.0"); + additionalProperties.put("rxjsVersion", "6.3.0"); + additionalProperties.put("ngPackagrVersion", "5.1.0"); + additionalProperties.put("tsickleVersion", "0.34.0"); + additionalProperties.put("zonejsVersion", "0.8.26"); + } else if (ngVersion.atLeast("6.0.0")) { + additionalProperties.put("tsVersion", ">=2.7.2 and <2.10.0"); + additionalProperties.put("rxjsVersion", "6.1.0"); + additionalProperties.put("ngPackagrVersion", "3.0.6"); + additionalProperties.put("tsickleVersion", "0.32.1"); + additionalProperties.put("zonejsVersion", "0.8.26"); + } else { + additionalProperties.put("tsVersion", ">=2.1.5 and <2.8"); + additionalProperties.put("rxjsVersion", "6.1.0"); + additionalProperties.put("ngPackagrVersion", "3.0.6"); + additionalProperties.put("tsickleVersion", "0.32.1"); + additionalProperties.put("zonejsVersion", "0.8.26"); + } + // for Angular 2 AOT support we will use good-old ngc, // Angular Package format wasn't invented at this time and building was much more easier if (!ngVersion.atLeast("4.0.0")) { @@ -410,6 +468,9 @@ public String toApiFilename(String name) { if (name.length() == 0) { return "default.service"; } + if (kebabFileNaming) { + return dashize(name); + } return camelize(name, true) + ".service"; } @@ -420,6 +481,9 @@ public String toApiImport(String name) { @Override public String toModelFilename(String name) { + if (kebabFileNaming) { + return dashize(name); + } return camelize(toModelName(name), true); } diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/UE4CPPGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/UE4CPPGenerator.java new file mode 100644 index 00000000000..f6f196c6756 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/UE4CPPGenerator.java @@ -0,0 +1,578 @@ +package io.swagger.codegen.languages; + +import io.swagger.codegen.*; +import io.swagger.models.properties.ArrayProperty; +import io.swagger.models.properties.BooleanProperty; +import io.swagger.models.properties.DateProperty; +import io.swagger.models.properties.DateTimeProperty; +import io.swagger.models.properties.DecimalProperty; +import io.swagger.models.properties.DoubleProperty; +import io.swagger.models.properties.FloatProperty; +import io.swagger.models.properties.BaseIntegerProperty; +import io.swagger.models.properties.IntegerProperty; +import io.swagger.models.properties.LongProperty; +import io.swagger.models.properties.MapProperty; +import io.swagger.models.properties.Property; +import io.swagger.models.properties.RefProperty; +import io.swagger.models.properties.StringProperty; +import org.apache.commons.lang3.StringUtils; + +import java.io.File; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/* +* Note: Developed with Unreal 4.24 +* Features not yet supported: +* - Default values for all types +* - Enumerations other than String +* - Request formats other than Json (XML) +* - Responses other than Json (Multipart, XML...) +* - In petstore example, Currency is not handled properly +* - OpenAPI 3.0 +*/ +public class UE4CPPGenerator extends AbstractCppCodegen implements CodegenConfig { + public static final String CPP_NAMESPACE = "cppNamespace"; + public static final String CPP_NAMESPACE_DESC = "C++ namespace (convention: name::space::for::api)."; + public static final String UNREAL_MODULE_NAME = "unrealModuleName"; + public static final String UNREAL_MODULE_NAME_DESC = "Name of the generated unreal module (optional)"; + public static final String OPTIONAL_PROJECT_FILE_DESC = "Generate Build.cs"; + + protected String unrealModuleName = "Swagger"; + // Will be treated as pointer + protected Set pointerClasses = new HashSet(); + // source folder where to write the files + protected String privateFolder = "Private"; + protected String publicFolder = "Public"; + protected String apiVersion = "1.0.0"; + protected Map namespaces = new HashMap(); + // 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; + + + public UE4CPPGenerator() { + super(); + + // set the output folder here + outputFolder = "generated-code/ue4cpp"; + + // set modelNamePrefix as default for UE4CPP + if (modelNamePrefix == "") { + modelNamePrefix = unrealModuleName; + } + + /* + * 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 + * a different extension + */ + modelTemplateFiles.put( + "model-header.mustache", + ".h"); + + modelTemplateFiles.put( + "model-source.mustache", + ".cpp"); + + /* + * 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-header.mustache", // the template to use + ".h"); // the extension for each file to write + + apiTemplateFiles.put( + "api-source.mustache", // the template to use + ".cpp"); // the extension for each file to write + + apiTemplateFiles.put( + "api-operations-header.mustache", // the template to use + ".h"); // the extension for each file to write + + apiTemplateFiles.put( + "api-operations-source.mustache", // the template to use + ".cpp"); // the extension for each file to write + + /* + * 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. + */ + embeddedTemplateDir = templateDir = "ue4cpp"; + + // CLI options + addOption(CPP_NAMESPACE, CPP_NAMESPACE_DESC, this.cppNamespace); + addOption(UNREAL_MODULE_NAME, UNREAL_MODULE_NAME_DESC, this.unrealModuleName); + addSwitch(CodegenConstants.OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_DESC, this.optionalProjectFileFlag); + + /* + * Additional Properties. These values can be passed to the templates and + * are available in models, apis, and supporting files + */ + additionalProperties.put("apiVersion", apiVersion); + additionalProperties().put("modelNamePrefix", modelNamePrefix); + additionalProperties().put("modelPackage", modelPackage); + additionalProperties().put("apiPackage", apiPackage); + additionalProperties().put("dllapi", unrealModuleName.toUpperCase() + "_API"); + additionalProperties().put("unrealModuleName", unrealModuleName); + + // Write defaults namespace in properties so that it can be accessible in templates. + // At this point command line has not been parsed so if value is given + // in command line it will superseed this content + additionalProperties.put("cppNamespace",cppNamespace); + additionalProperties.put("unrealModuleName",unrealModuleName); + + /* + * Language Specific Primitives. These types will not trigger imports by + * the client generator + */ + languageSpecificPrimitives = new HashSet( + Arrays.asList( + "bool", + "int32", + "int64", + "float", + "double", + "FString", + "FDateTime", + "FGuid", + "TArray", + "TArray", // For byte arrays + "TMap", + "TSharedPtr") + ); + + supportingFiles.add(new SupportingFile("model-base-header.mustache", publicFolder, modelNamePrefix + "BaseModel.h")); + supportingFiles.add(new SupportingFile("model-base-source.mustache", privateFolder, modelNamePrefix + "BaseModel.cpp")); + supportingFiles.add(new SupportingFile("helpers-header.mustache", publicFolder, modelNamePrefix + "Helpers.h")); + supportingFiles.add(new SupportingFile("helpers-source.mustache", privateFolder, modelNamePrefix + "Helpers.cpp")); + if (optionalProjectFileFlag) { + supportingFiles.add(new SupportingFile("Build.cs.mustache", unrealModuleName + ".Build.cs")); + supportingFiles.add(new SupportingFile("module-header.mustache", privateFolder, unrealModuleName + "Module.h")); + supportingFiles.add(new SupportingFile("module-source.mustache", privateFolder, unrealModuleName + "Module.cpp")); + } + + super.typeMapping = new HashMap(); + + // Maps C++ types during call to getSwaggertype, see DefaultCodegen.getSwaggerType and not the types/formats defined in openapi specification + // "array" is also used explicitly in the generator for containers + typeMapping.clear(); + typeMapping.put("integer", "int32"); + typeMapping.put("long", "int64"); + typeMapping.put("float", "float"); + typeMapping.put("number", "double"); + typeMapping.put("double", "double"); + typeMapping.put("string", "FString"); + typeMapping.put("byte", "uint8"); + typeMapping.put("binary", "TArray"); + typeMapping.put("ByteArray", "TArray"); + typeMapping.put("password", "FString"); + typeMapping.put("boolean", "bool"); + typeMapping.put("date", "FDateTime"); + typeMapping.put("Date", "FDateTime"); + typeMapping.put("date-time", "FDateTime"); + typeMapping.put("DateTime", "FDateTime"); + typeMapping.put("array", "TArray"); + typeMapping.put("list", "TArray"); + typeMapping.put("map", "TMap"); + typeMapping.put("object", "TSharedPtr"); + typeMapping.put("Object", "TSharedPtr"); + typeMapping.put("file", "HttpFileInput"); + typeMapping.put("UUID", "FGuid"); + + importMapping = new HashMap(); + importMapping.put("HttpFileInput", "#include \"" + modelNamePrefix + "Helpers.h\""); + + namespaces = new HashMap(); + } + + @Override + public void processOpts() { + super.processOpts(); + + if (additionalProperties.containsKey("cppNamespace")){ + cppNamespace = (String) additionalProperties.get("cppNamespace"); + } + + additionalProperties.put("cppNamespaceDeclarations", cppNamespace.split("\\::")); + + boolean updateSupportingFiles = false; + if (additionalProperties.containsKey("unrealModuleName")){ + unrealModuleName = (String) additionalProperties.get("unrealModuleName"); + additionalProperties().put("dllapi", unrealModuleName.toUpperCase() + "_API"); + modelNamePrefix = unrealModuleName; + updateSupportingFiles = true; + } + + if(additionalProperties.containsKey("modelNamePrefix")){ + modelNamePrefix = (String) additionalProperties.get("modelNamePrefix"); + updateSupportingFiles = true; + } + + if (additionalProperties.containsKey(CodegenConstants.OPTIONAL_PROJECT_FILE)) { + setOptionalProjectFileFlag(convertPropertyToBooleanAndWriteBack(CodegenConstants.OPTIONAL_PROJECT_FILE)); + } else { + additionalProperties.put(CodegenConstants.OPTIONAL_PROJECT_FILE, optionalProjectFileFlag); + } + + if(updateSupportingFiles) { + supportingFiles.clear(); + + supportingFiles.add(new SupportingFile("model-base-header.mustache", publicFolder, modelNamePrefix + "BaseModel.h")); + supportingFiles.add(new SupportingFile("model-base-source.mustache", privateFolder, modelNamePrefix + "BaseModel.cpp")); + supportingFiles.add(new SupportingFile("helpers-header.mustache", publicFolder, modelNamePrefix + "Helpers.h")); + supportingFiles.add(new SupportingFile("helpers-source.mustache", privateFolder, modelNamePrefix + "Helpers.cpp")); + if (optionalProjectFileFlag) { + supportingFiles.add(new SupportingFile("Build.cs.mustache", unrealModuleName + ".Build.cs")); + supportingFiles.add(new SupportingFile("module-header.mustache", privateFolder, unrealModuleName + "Module.h")); + supportingFiles.add(new SupportingFile("module-source.mustache", privateFolder, unrealModuleName + "Module.cpp")); + } + + importMapping.put("HttpFileInput", "#include \"" + modelNamePrefix + "Helpers.h\""); + } + } + + public void setOptionalProjectFileFlag(boolean flag) { + this.optionalProjectFileFlag = flag; + } + + /** + * Configures the type of generator. + * + * @return the CodegenType for this generator + * @see io.swagger.codegen.CodegenType + */ + @Override + public CodegenType getTag() { + return CodegenType.CLIENT; + } + + /** + * Configures a friendly name for the generator. This will be used by the generator + * to select the library with the -l flag. + * + * @return the friendly name for the generator + */ + @Override + public String getName() { + return "ue4cpp"; + } + + /** + * Returns human-friendly help for the generator. Provide the consumer with help + * tips, parameters here + * + * @return A string value for the help message + */ + @Override + public String getHelp() { + return "Generates a Unreal Engine 4 C++ Module."; + } + + @Override + public String toModelImport(String name) { + if (namespaces.containsKey(name)) { + return "using " + namespaces.get(name) + ";"; + } else if (systemIncludes.contains(name)) { + return "#include <" + name + ">"; + } + + String folder = modelPackage().replace("::", File.separator); + if (!folder.isEmpty()) + folder += File.separator; + + return "#include \"" + folder + name + ".h\""; + } + + @Override + protected boolean needToImport(String type) { + boolean shouldImport = super.needToImport(type); + if(shouldImport) + return !languageSpecificPrimitives.contains(type); + else + return false; + } + + /** + * 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) { + if(this.reservedWordsMappings().containsKey(name)) { + return this.reservedWordsMappings().get(name); + } + return "_" + name; + } + + /** + * 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 + modelPackage().replace("::", File.separator); + } + + /** + * Location to write api files. You can use the apiPackage() as defined when the class is + * instantiated + */ + @Override + public String apiFileFolder() { + return outputFolder + File.separator + apiPackage().replace("::", File.separator); + } + + @Override + public String modelFilename(String templateName, String tag) { + String suffix = modelTemplateFiles().get(templateName); + String folder = privateFolder; + if(suffix == ".h") { + folder = publicFolder; + } + + return modelFileFolder() + File.separator + folder + File.separator + toModelFilename(tag) + suffix; + } + + @Override + public String toModelFilename(String name) { + name = sanitizeName(name); + return modelNamePrefix + initialCaps(name); + } + + @Override + public String apiFilename(String templateName, String tag) { + String suffix = apiTemplateFiles().get(templateName); + String folder = privateFolder; + if(suffix == ".h") { + folder = publicFolder; + } + + if ( templateName.startsWith("api-operations") ) { + return apiFileFolder() + File.separator + folder + File.separator + toApiFilename(tag) + "Operations" + suffix; + } else { + return apiFileFolder() + File.separator + folder + File.separator + toApiFilename(tag) + suffix; + } + } + + @Override + public String toApiFilename(String name) { + name = sanitizeName(name); + return modelNamePrefix + initialCaps(name) + "Api"; + } + + /** + * 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 + */ + @Override + public String getTypeDeclaration(Property p) { + String swaggerType = getSwaggerType(p); + + if (p instanceof ArrayProperty) { + ArrayProperty ap = (ArrayProperty) p; + Property inner = ap.getItems(); + return getSwaggerType(p) + "<" + getTypeDeclaration(inner) + ">"; + } else if (p instanceof MapProperty) { + MapProperty mp = (MapProperty) p; + Property inner = mp.getAdditionalProperties(); + return getSwaggerType(p) + ""; + } + if (pointerClasses.contains(swaggerType)) { + return swaggerType + "*"; + } else if (languageSpecificPrimitives.contains(swaggerType)) { + return toModelName(swaggerType); + } else { + return swaggerType; + } + } + + + @Override + public String toDefaultValue(Property p) { + if (p instanceof StringProperty) { + StringProperty sp = (StringProperty) p; + if (sp.getDefault() != null) { + return "TEXT(\"" + sp.getDefault().toString() + "\")"; + } + else { + return null; + } + } else if (p instanceof BooleanProperty) { + BooleanProperty bp = (BooleanProperty) p; + if (bp.getDefault() != null) { + return bp.getDefault().toString(); + } + else { + return "false"; + } + } else if (p instanceof DateProperty) { + return "FDateTime(0)"; + } else if (p instanceof DateTimeProperty) { + return "FDateTime(0)"; + } else if (p instanceof DoubleProperty) { + DoubleProperty dp = (DoubleProperty) p; + if (dp.getDefault() != null) { + return dp.getDefault().toString(); + } + else { + return "0.0"; + } + } else if (p instanceof FloatProperty) { + FloatProperty fp = (FloatProperty) p; + if (fp.getDefault() != null) { + return fp.getDefault().toString(); + } + else { + return "0.0f"; + } + } else if (p instanceof IntegerProperty) { + IntegerProperty ip = (IntegerProperty) p; + if (ip.getDefault() != null) { + return ip.getDefault().toString(); + } + else { + return "0"; + } + } else if (p instanceof LongProperty) { + LongProperty lp = (LongProperty) p; + if (lp.getDefault() != null) { + return lp.getDefault().toString(); + } + else { + return "0"; + } + } else if (p instanceof BaseIntegerProperty) { + // catchall for any other format of the swagger specifiction + // integer type not explicitly handled above + return "0"; + } else if (p instanceof DecimalProperty) { + return "0.0"; + } + + return null; + } + + /** + * Optional - swagger type conversion. This is used to map swagger types in a `Property` 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 + * @see io.swagger.models.properties.Property + */ + @Override + public String getSwaggerType(Property p) { + String swaggerType = super.getSwaggerType(p); + String type = null; + if (typeMapping.containsKey(swaggerType)) { + type = typeMapping.get(swaggerType); + if (languageSpecificPrimitives.contains(type)) { + return toModelName(type); + } + if (pointerClasses.contains(type)) { + return type; + } + } else { + type = swaggerType; + } + return toModelName(type); + } + + @Override + public String toModelName(String type) { + if (typeMapping.keySet().contains(type) || + typeMapping.values().contains(type) || + importMapping.values().contains(type) || + defaultIncludes.contains(type) || + languageSpecificPrimitives.contains(type)) { + return type; + } else { + type = sanitizeName(type); + return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1); + } + } + + @Override + public String toVarName(String name) { + // sanitize name + name = sanitizeName(name); // FIXME: a parameter should not be assigned. Also declare the methods parameters as 'final'. + + // if it's all uppper case, convert to lower case + if (name.matches("^[A-Z_]*$")) { + name = name.toLowerCase(); + } + + // for reserved word or word starting with number, append _ + if (isReservedWord(name) || name.matches("^\\d.*")) { + name = escapeReservedWord(name); + } + + //Unreal variable names are CamelCase + return camelize(name, false); + } + + @Override + public Map postProcessModels(Map objs) { + // TODO: This could be moved to AbstractCPPGenerator, as model enums are virtually unusable without + objs = super.postProcessModels(objs); + return postProcessModelsEnum(objs); + } + + @Override + public String toEnumVarName(String name, String datatype) { + return toVarName(name); + } + + @Override + public String toParamName(String name) { + return toVarName(name); + } + + @Override + public String toApiName(String type) { + return modelNamePrefix + Character.toUpperCase(type.charAt(0)) + type.substring(1) + "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 sanitizeName(String name) + { + name = super.sanitizeName(name); + // TODO: This could be moved to AbstractCPPGenerator, C++ does not support "." in symbol names + name = name.replace(".", "_"); + return name; + } + + public String toBooleanGetter(String name) { + return "Is" + getterAndSetterCapitalize(name); + } + + public String toGetter(String name) { + return "Get" + getterAndSetterCapitalize(name); + } + + public String toSetter(String name) { + return "Set" + getterAndSetterCapitalize(name); + } +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/IgnoreUnknownJacksonFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/IgnoreUnknownJacksonFeatures.java new file mode 100644 index 00000000000..0a4b24d5fb4 --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/IgnoreUnknownJacksonFeatures.java @@ -0,0 +1,10 @@ +package io.swagger.codegen.languages.features; + +public interface IgnoreUnknownJacksonFeatures { + // Language supports generating JsonIgnoreProperties(ignoreUnknown = true) + String IGNORE_UNKNOWN_JACKSON_ANNOTATION = "ignoreUnknownJacksonAnnotation"; + + void setIgnoreUnknownJacksonAnnotation(boolean ignoreUnknownJacksonAnnotation); + + boolean isIgnoreUnknownJacksonAnnotation(); +} diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/NotNullAnnotationFeatures.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/NotNullAnnotationFeatures.java new file mode 100644 index 00000000000..910251a3bee --- /dev/null +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/features/NotNullAnnotationFeatures.java @@ -0,0 +1,10 @@ +package io.swagger.codegen.languages.features; + +public interface NotNullAnnotationFeatures { + // Language supports generating not Null Jackson Annotation + String NOT_NULL_JACKSON_ANNOTATION = "notNullJacksonAnnotation"; + + void setNotNullJacksonAnnotation(boolean notNullJacksonAnnotation); + + boolean isNotNullJacksonAnnotation(); +} diff --git a/modules/swagger-codegen/src/main/resources/Groovy/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Groovy/build.gradle.mustache index cc54061bf46..51150d40c6e 100644 --- a/modules/swagger-codegen/src/main/resources/Groovy/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Groovy/build.gradle.mustache @@ -24,7 +24,7 @@ repositories { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.10.1" + jackson_version = "2.11.4" } dependencies { diff --git a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache index f99ea1dade7..718a7e57129 100644 --- a/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/ApiClient.mustache @@ -646,12 +646,12 @@ public class ApiClient { builder = httpClient.resource(url).accept(accept); } - for (Entry keyValue : headerParams.entrySet()) { - builder = builder.header(keyValue.getKey(), keyValue.getValue()); + for (String key : headerParams.keySet()) { + builder = builder.header(key, headerParams.get(key)); } - for (Map.Entry keyValue : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(keyValue.getKey())) { - builder = builder.header(keyValue.getKey(), keyValue.getValue()); + for (String key : defaultHeaderMap.keySet()) { + if (!headerParams.containsKey(key)) { + builder = builder.header(key, defaultHeaderMap.get(key)); } } diff --git a/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache index a00979fbd73..db2779ee39f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache @@ -102,7 +102,7 @@ if(hasProperty('target') && target == 'android') { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } - + task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource @@ -120,10 +120,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "{{^threetenbp}}2.10.1{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" + swagger_annotations_version = "1.5.24" + jackson_version = "{{^threetenbp}}2.11.4{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" jersey_version = "1.19.4" - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" junit_version = "4.12" } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache index fa1dea42e8a..95a87f2b0e3 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/ApiClient.mustache @@ -53,7 +53,7 @@ public class ApiClient { this(); for(String authName : authNames) { {{#hasAuthMethods}} - RequestInterceptor auth; + RequestInterceptor auth = null; {{#authMethods}}if ("{{name}}".equals(authName)) { {{#isBasic}} auth = new HttpBasicAuth(); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/auth/OAuth.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/auth/OAuth.mustache index 1df88d403a2..9110e16a16f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/auth/OAuth.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/auth/OAuth.mustache @@ -80,19 +80,19 @@ public class OAuth implements RequestInterceptor { } // If first time, get the token if (expirationTimeMillis == null || System.currentTimeMillis() >= expirationTimeMillis) { - updateAccessToken(); + updateAccessToken(template); } if (getAccessToken() != null) { template.header("Authorization", "Bearer " + getAccessToken()); } } - public synchronized void updateAccessToken() { + public synchronized void updateAccessToken(RequestTemplate template) { OAuthJSONAccessTokenResponse accessTokenResponse; try { accessTokenResponse = oauthClient.accessToken(tokenRequestBuilder.buildBodyMessage()); } catch (Exception e) { - throw new RetryableException(e.getMessage(), e,null); + throw new RetryableException(400, e.getMessage(), template.request().httpMethod(), e, null, template.request()); } if (accessTokenResponse != null && accessTokenResponse.getAccessToken() != null) { setAccessToken(accessTokenResponse.getAccessToken(), accessTokenResponse.getExpiresIn()); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache index f27554c165c..6f645bb2d39 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.gradle.mustache @@ -101,7 +101,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.9" - jackson_version = "2.10.1" + jackson_version = "2.11.4" {{#threetenbp}} threepane_version = "2.6.4" {{/threetenbp}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache index d034b3d79e6..652a91e8374 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/build.sbt.mustache @@ -14,10 +14,10 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-jackson" % "9.4.0" % "compile", "io.github.openfeign" % "feign-slf4j" % "9.4.0" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-{{^java8}}joda{{/java8}}{{#java8}}jsr310{{/java8}}" % "2.11.4" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "junit" % "junit" % "4.12" % "test", diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache index 522dad9d89a..7291f083d4e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache @@ -185,6 +185,22 @@ + {{#java11}} + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + {{/java11}} @@ -291,17 +307,17 @@ UTF-8 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.5.18 - 9.4.0 - 2.1.0 - 2.10.1 + 1.5.24 + 11.6 + 3.8.0 + 2.11.4 {{#threetenbp}} 2.6.4 {{/threetenbp}} - 4.12 + 4.13.1 1.0.0 1.0.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache index 32cfca170a7..a6564c7bdf8 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.gradle.mustache @@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -41,7 +41,7 @@ if(hasProperty('target') && target == 'android') { targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -57,7 +57,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -69,12 +69,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -98,7 +98,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = '{{artifactId}}' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath @@ -106,11 +106,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" google_api_client_version = "1.23.0" jersey_common_version = "2.29.1" - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" junit_version = "4.12" {{#threetenbp}} jackson_threeten_version = "2.6.4" diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache index 486a6eb3f07..149d96051bd 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/build.sbt.mustache @@ -12,17 +12,17 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.17", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.29.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", {{#withXml}} - "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.10.1" % "compile", + "com.fasterxml.jackson.dataformat" % "jackson-dataformat-xml" % "2.11.4" % "compile", {{/withXml}} {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.11.4" % "compile", {{/joda}} {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.11.4" % "compile", {{/java8}} {{#threetenbp}} "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/pom.mustache index b5c019b82cb..fb9203a3278 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/pom.mustache @@ -286,14 +286,14 @@ 1.5.17 1.23.0 2.29.1 - 2.10.1 + 2.11.4 {{#joda}} - 2.9.9 + 2.10.5 {{/joda}} {{#threetenbp}} 2.6.4 {{/threetenbp}} 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache index a699e001f17..85db8aa6fab 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/ApiClient.mustache @@ -25,6 +25,7 @@ import java.io.InputStream; {{^supportJava6}} import java.nio.file.Files; +import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; {{/supportJava6}} @@ -296,7 +297,7 @@ public class ApiClient { public int getReadTimeout() { return readTimeout; } - + /** * Set the read timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and @@ -628,9 +629,9 @@ public class ApiClient { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index d442426ad07..5224579fc3b 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache @@ -105,8 +105,8 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" {{#supportJava6}} jersey_version = "2.6" commons_io_version=2.5 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache index ee4854b08ab..38681c33e33 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.sbt.mustache @@ -14,14 +14,14 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.29.1"{{/supportJava6}}, {{^supportJava6}}"org.glassfish.jersey.inject" % "jersey-hk2" % "2.29.1",{{/supportJava6}} "org.glassfish.jersey.media" % "jersey-media-json-jackson" % {{#supportJava6}}"2.6"{{/supportJava6}}{{^supportJava6}}"2.29.1"{{/supportJava6}}, - "com.fasterxml.jackson.core" % "jackson-core" % "{{^threetenbp}}2.10.1{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "{{^threetenbp}}2.10.1{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "{{^threetenbp}}2.10.1{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "{{^threetenbp}}2.11.4{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "{{^threetenbp}}2.11.4{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "{{^threetenbp}}2.11.4{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}}" % "compile", {{#joda}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.11.4" % "compile", {{/joda}} {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.1" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.11.4" % "compile", {{/java8}} {{#threetenbp}} "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache index 7560843591a..1dc01d43ad1 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/pom.mustache @@ -318,7 +318,7 @@ UTF-8 - 1.5.18 + 1.5.24 {{^supportJava6}} 2.29.1 {{/supportJava6}} @@ -327,8 +327,8 @@ 2.5 3.6 {{/supportJava6}} - {{^threetenbp}}2.10.1{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} + {{^threetenbp}}2.11.4{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache index 0ae00335726..dbc02894c22 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/ApiClient.mustache @@ -24,6 +24,8 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.nio.file.Files; +import java.nio.file.Paths; import java.lang.reflect.Type; import java.net.URLConnection; import java.net.URLEncoder; @@ -829,9 +831,9 @@ public class ApiClient { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** @@ -981,7 +983,7 @@ public class ApiClient { * @param formParams The form parameters * @param authNames The authentications to apply * @param progressRequestListener Progress request listener - * @return The HTTP request + * @return The HTTP request * @throws ApiException If fail to serialize the request body object */ public Request buildRequest(String path, String method, List queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache index ffc68bc7b5a..7f92499dc45 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/api.mustache @@ -114,7 +114,7 @@ public class {{classname}} { {{localVariablePrefix}}localVarHeaderParams.put("Content-Type", {{localVariablePrefix}}localVarContentType); if(progressListener != null) { - apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { + {{localVariablePrefix}}apiClient.getHttpClient().networkInterceptors().add(new com.squareup.okhttp.Interceptor() { @Override public com.squareup.okhttp.Response intercept(com.squareup.okhttp.Interceptor.Chain chain) throws IOException { com.squareup.okhttp.Response originalResponse = chain.proceed(chain.request()); @@ -237,7 +237,7 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public com.squareup.okhttp.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{localVariablePrefix}}callback) throws ApiException { + public com.squareup.okhttp.Call {{operationId}}Async({{#allParams}}{{{dataType}}} {{paramName}}, {{/allParams}}final ApiCallback<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> callback) throws ApiException { ProgressResponseBody.ProgressListener progressListener = null; ProgressRequestBody.ProgressRequestListener progressRequestListener = null; @@ -260,9 +260,9 @@ public class {{classname}} { com.squareup.okhttp.Call {{localVariablePrefix}}call = {{operationId}}ValidateBeforeCall({{#allParams}}{{paramName}}, {{/allParams}}progressListener, progressRequestListener); {{#returnType}}Type {{localVariablePrefix}}localVarReturnType = new TypeToken<{{{returnType}}}>(){}.getType(); - {{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, {{localVariablePrefix}}callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}callback);{{/returnType}} + {{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, {{localVariablePrefix}}localVarReturnType, callback);{{/returnType}}{{^returnType}}{{localVariablePrefix}}apiClient.executeAsync({{localVariablePrefix}}call, callback);{{/returnType}} return {{localVariablePrefix}}call; } {{/operation}} } -{{/operations}} \ No newline at end of file +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index fcf788885d6..e0c1943e37f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache @@ -14,12 +14,12 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", "com.google.code.gson" % "gson" % "2.8.1", {{#joda}} - "joda-time" % "joda-time" % "2.9.9" % "compile", + "joda-time" % "joda-time" % "2.10.5" % "compile", {{/joda}} {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", {{/threetenbp}} - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache index b5119774a05..3c66a6eab27 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/pom.mustache @@ -185,6 +185,22 @@ + {{#java11}} + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + {{/java11}} @@ -236,6 +252,22 @@ provided {{/useBeanValidation}} + {{#notNullJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + 2.11.4 + + {{/notNullJacksonAnnotation}} + {{^notNullJacksonAnnotation}} + {{#ignoreUnknownJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + 2.11.4 + + {{/ignoreUnknownJacksonAnnotation}} + {{/notNullJacksonAnnotation}} {{#performBeanValidation}} @@ -267,21 +299,21 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.8.0 - 1.5.18 + 1.8.3 + 1.5.24 2.7.5 2.8.1 {{#joda}} - 2.9.9 + 2.10.5 {{/joda}} {{#threetenbp}} - 1.3.5 + 1.4.1 {{/threetenbp}} 1.0.0 - 4.12 + 4.13.1 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache index 54b90483f4c..cf530e440da 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.gradle.mustache @@ -100,10 +100,10 @@ ext { gson_version = "2.6.1" gson_fire_version = "1.8.2" {{#joda}} - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" {{/joda}} {{#threetenbp}} - threetenbp_version = "1.3.5" + threetenbp_version = "1.4.1" {{/threetenbp}} okio_version = "1.13.0" } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache index 68f3eff08d0..fab561fe6e7 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/build.sbt.mustache @@ -14,10 +14,10 @@ lazy val root = (project in file(".")). "com.google.code.gson" % "gson" % "2.6.1", "io.gsonfire" % "gson-fire" % "1.8.2" % "compile", {{#joda}} - "joda-time" % "joda-time" % "2.9.9" % "compile", + "joda-time" % "joda-time" % "2.10.5" % "compile", {{/joda}} {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", {{/threetenbp}} "com.squareup.okio" % "okio" % "1.13.0" % "compile", "junit" % "junit" % "4.12" % "test", diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/pom.mustache index 85d2b88363d..37ed326d64a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/rest-assured/pom.mustache @@ -196,6 +196,22 @@ + {{#java11}} + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + {{/java11}} @@ -254,12 +270,12 @@ 1.8.2 1.0.0 {{#joda}} - 2.9.9 + 2.10.5 {{/joda}} {{#threetenbp}} - 1.3.5 + 1.4.1 {{/threetenbp}} 1.13.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache index ecd82535a15..7f57b68ace2 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/ApiClient.mustache @@ -8,6 +8,7 @@ import java.io.InputStream; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.file.Files; +import java.nio.file.Paths; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -446,7 +447,7 @@ public class ApiClient { public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { Entity entity = null; if (contentType.startsWith("multipart/form-data")) { - MultipartFormDataOutput multipart = new MultipartFormDataOutput(); + MultipartFormDataOutput multipart = new MultipartFormDataOutput(); //MultiPart multiPart = new MultiPart(); for (Entry param: formParams.entrySet()) { if (param.getValue() instanceof File) { @@ -552,9 +553,9 @@ public class ApiClient { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache index 952d86a3784..1a99155c3dc 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.gradle.mustache @@ -106,7 +106,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.10.1" + jackson_version = "2.11.4" threetenbp_version = "2.6.4" jersey_version = "2.22.2" resteasy_version = "3.1.3.Final" diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.sbt.mustache index 5bc2dc33bde..049cc4526c3 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/build.sbt.mustache @@ -13,14 +13,14 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % "2.22.2", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.22.2", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.2", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4", {{#java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.1", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.11.4", {{/java8}} {{^java8}} - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.1", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.11.4", "joda-time" % "joda-time" % "2.9.4", "com.brsanthu" % "migbase64" % "2.2", {{/java8}} diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache index 6603f1d703c..b0b172bc333 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache @@ -247,18 +247,18 @@ UTF-8 - 1.5.18 + 1.5.24 3.1.3.Final - 2.10.1 + 2.11.4 2.6.4 {{^java8}} - 2.9.9 + 2.10.5 {{/java8}} {{#supportJava6}} 2.5 3.6 {{/supportJava6}} 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache index 9ee9bb42b42..7678e70f27f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/build.gradle.mustache @@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -41,7 +41,7 @@ if(hasProperty('target') && target == 'android') { targetCompatibility JavaVersion.VERSION_1_7 {{/java8}} } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -57,7 +57,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -69,12 +69,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -98,7 +98,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = '{{artifactId}}' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath @@ -106,10 +106,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" spring_web_version = "4.3.9.RELEASE" - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" junit_version = "4.12" {{#threetenbp}} jackson_threeten_version = "2.6.4" diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/pom.mustache index b304cb5dee8..014b2bebcbf 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/resttemplate/pom.mustache @@ -202,6 +202,22 @@ + {{#java11}} + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + {{/java11}} @@ -288,14 +304,14 @@ UTF-8 1.5.17 4.3.9.RELEASE - 2.10.1 + 2.11.4 {{#joda}} - 2.9.9 + 2.10.5 {{/joda}} {{#threetenbp}} 2.6.4 {{/threetenbp}} 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache index b4ceff3aac0..76d02c4f66c 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit/pom.mustache @@ -194,6 +194,22 @@ + {{#java11}} + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + {{/java11}} @@ -243,12 +259,12 @@ UTF-8 - 1.5.18 + 1.5.24 1.9.0 2.7.5 - 2.9.9 + 2.10.5 1.0.1 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache index 50d6bf27913..2ab286a5f5a 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.gradle.mustache @@ -101,18 +101,18 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" + retrofit_version = "2.7.1" {{#usePlayWS}} {{#play24}} - jackson_version = "2.10.1" + jackson_version = "2.11.4" play_version = "2.4.11" {{/play24}} {{#play25}} - jackson_version = "2.10.1" + jackson_version = "2.11.4" play_version = "2.5.14" {{/play25}} {{/usePlayWS}} - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" junit_version = "4.12" {{#useRxJava}} rx_java_version = "1.3.0" @@ -121,12 +121,12 @@ ext { rx_java_version = "2.1.1" {{/useRxJava2}} {{#joda}} - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" {{/joda}} {{#threetenbp}} - threetenbp_version = "1.3.5" + threetenbp_version = "1.4.1" {{/threetenbp}} - json_fire_version = "1.8.0" + json_fire_version = "1.8.3" } dependencies { diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache index c2267623b22..59907e1c9e0 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/build.sbt.mustache @@ -9,23 +9,23 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "retrofit" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.7.1" % "compile", {{^usePlayWS}} - "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.7.1" % "compile", {{/usePlayWS}} {{#usePlayWS}} {{#play24}} "com.typesafe.play" % "play-java-ws_2.11" % "2.4.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", {{/play24}} {{#play25}} "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", {{/play25}} "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", {{/usePlayWS}} @@ -37,15 +37,15 @@ lazy val root = (project in file(".")). "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", {{/useRxJava2}} - "io.swagger" % "swagger-annotations" % "1.5.17" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", {{#joda}} - "joda-time" % "joda-time" % "2.9.9" % "compile", + "joda-time" % "joda-time" % "2.10.5" % "compile", {{/joda}} {{#threetenbp}} - "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", {{/threetenbp}} - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play24/Play24CallFactory.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play24/Play24CallFactory.mustache index 5572ac47619..dde8d402260 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play24/Play24CallFactory.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play24/Play24CallFactory.mustache @@ -3,6 +3,7 @@ package {{invokerPackage}}; import okhttp3.*; import okio.Buffer; import okio.BufferedSource; +import okio.Timeout; import play.libs.F; import play.libs.ws.WSClient; import play.libs.ws.WSRequest; @@ -97,6 +98,10 @@ public class Play24CallFactory implements okhttp3.Call.Factory { return request; } + public Timeout timeout() { + return null; + } + @Override public void enqueue(final okhttp3.Callback responseCallback) { final Call call = this; diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache index 93df7a2718d..755d398d176 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/play25/Play25CallFactory.mustache @@ -3,6 +3,7 @@ package {{invokerPackage}}; import okhttp3.*; import okio.Buffer; import okio.BufferedSource; +import okio.Timeout; import play.libs.ws.WSClient; import play.libs.ws.WSRequest; import play.libs.ws.WSResponse; @@ -32,7 +33,7 @@ public class Play25CallFactory implements okhttp3.Call.Factory { /** Extra query parameters to add to request */ private List extraQueryParams = new ArrayList<>(); - + /** Filters (interceptors) */ private List filters = new ArrayList<>(); @@ -108,6 +109,10 @@ public class Play25CallFactory implements okhttp3.Call.Factory { return request; } + public Timeout timeout() { + return null; + } + @Override public void enqueue(final okhttp3.Callback responseCallback) { final Call call = this; @@ -189,7 +194,7 @@ public class Play25CallFactory implements okhttp3.Call.Factory { } }); - + for (Map.Entry> entry : r.getAllHeaders().entrySet()) { for (String value : entry.getValue()) { builder.addHeader(entry.getKey(), value); diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index bcbd35981d6..31ad1a154df 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache @@ -185,6 +185,22 @@ + {{#java11}} + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + {{/java11}} @@ -327,22 +343,22 @@ UTF-8 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.8.0 - 1.5.18 + 1.8.3 + 1.5.24 {{#usePlayWS}} {{#play24}} - 2.10.1 + 2.11.4 2.4.11 {{/play24}} {{#play25}} - 2.10.1 + 2.11.4 2.5.15 {{/play25}} {{/usePlayWS}} - 2.3.0 + 2.7.1 {{#useRxJava}} 1.3.0 {{/useRxJava}} @@ -350,12 +366,12 @@ 2.1.1 {{/useRxJava2}} {{#joda}} - 2.9.9 + 2.10.5 {{/joda}} {{#threetenbp}} - 1.3.5 + 1.4.1 {{/threetenbp}} 1.0.1 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/build.gradle.mustache index 605bb77cee5..5b22d31287f 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/build.gradle.mustache @@ -26,9 +26,9 @@ task execute(type:JavaExec) { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" {{#threetenbp}}threetenbp_version = "2.6.4"{{/threetenbp}} - jackson_version = "2.10.1" + jackson_version = "2.11.4" vertx_version = "3.4.2" junit_version = "4.12" } diff --git a/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/pom.mustache index 7b873f05351..e5fda21a74e 100644 --- a/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/libraries/vertx/pom.mustache @@ -272,9 +272,9 @@ UTF-8 3.4.2 - 1.5.18 + 1.5.24 {{#threetenbp}}2.6.4{{/threetenbp}} - 2.10.1 - 4.12 + 2.11.4 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache index 209d310172b..17a4f8387d3 100644 --- a/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache @@ -42,13 +42,13 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue{{#jackson}}({{{dataType}}} value){{/jackson}}{{^jackson}}(String text){{/jackson}} { for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (String.valueOf(b.value).equals(text)) { + if ({{#jackson}}b.value.equals(value){{/jackson}}{{^jackson}}String.valueOf(b.value).equals(text){{/jackson}}) { return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + {{#jackson}}value{{/jackson}}{{^jackson}}text{{/jackson}} + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } {{#gson}} @@ -60,8 +60,8 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum @Override public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{{dataType}}} value = jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}; - return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue(String.valueOf(value)); + {{#isNumber}}BigDecimal value = new BigDecimal(jsonReader.nextDouble()){{/isNumber}}{{^isNumber}}{{#isInteger}}Integer value {{/isInteger}}{{^isInteger}}String value {{/isInteger}}= jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}nextString(){{/isInteger}}{{/isNumber}}; + return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#jackson}}value{{/jackson}}{{^jackson}}String.valueOf(value){{/jackson}}); } } {{/gson}} diff --git a/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache index e7ffa65d130..e3d8d9f55ad 100644 --- a/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache @@ -33,13 +33,13 @@ {{#jackson}} @JsonCreator {{/jackson}} - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue{{#jackson}}({{{datatype}}} value){{/jackson}}{{^jackson}}(String text){{/jackson}} { for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (String.valueOf(b.value).equals(text)) { + if ({{#jackson}}b.value.equals(value){{/jackson}}{{^jackson}}String.valueOf(b.value).equals(text){{/jackson}}) { return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + {{#jackson}}value{{/jackson}}{{^jackson}}text{{/jackson}} + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } {{#gson}} @@ -51,8 +51,8 @@ @Override public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{{datatype}}} value = jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}next{{{datatype}}}(){{/isInteger}}; - return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue(String.valueOf(value)); + {{#isNumber}}Object value = new BigDecimal(jsonReader.nextDouble()){{/isNumber}}{{^isNumber}}{{#isInteger}}int value {{/isInteger}}{{^isInteger}}String value {{/isInteger}}= jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}nextString(){{/isInteger}}{{/isNumber}}; + return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue({{#jackson}}value{{/jackson}}{{^jackson}}String.valueOf(value){{/jackson}}); } } {{/gson}} diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache index 83a9494ffb9..fa8816188d1 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache @@ -3,6 +3,12 @@ */{{#description}} @ApiModel(description = "{{{description}}}"){{/description}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} +{{#notNullJacksonAnnotation}} +@JsonInclude(JsonInclude.Include.NON_NULL) +{{/notNullJacksonAnnotation}} +{{#ignoreUnknownJacksonAnnotation}} +@JsonIgnoreProperties(ignoreUnknown = true) +{{/ignoreUnknownJacksonAnnotation}} public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcelableModel}}implements Parcelable {{#serializableModel}}, Serializable {{/serializableModel}}{{/parcelableModel}}{{^parcelableModel}}{{#serializableModel}}implements Serializable {{/serializableModel}}{{/parcelableModel}}{ {{#serializableModel}} private static final long serialVersionUID = 1L; @@ -30,7 +36,8 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{#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}}") + @JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}, {{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}") + @JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#items.xmlName}}{{items.xmlName}}{{/items.xmlName}}{{^items.xmlName}}{{baseName}}{{/items.xmlName}}") {{/isXmlWrapped}} {{/isContainer}} {{/withXml}} @@ -74,7 +81,9 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{/parent}} {{#gson}} {{#discriminator}} + {{^vendorExtensions.x-discriminator-is-enum}} this.{{discriminatorClassVarName}} = this.getClass().getSimpleName(); + {{/vendorExtensions.x-discriminator-is-enum}} {{/discriminator}} {{/gson}} } @@ -82,9 +91,11 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela {{^parcelableModel}} {{#gson}} {{#discriminator}} + {{^vendorExtensions.x-discriminator-is-enum}} public {{classname}}() { this.{{discriminatorClassVarName}} = this.getClass().getSimpleName(); } + {{/vendorExtensions.x-discriminator-is-enum}} {{/discriminator}} {{/gson}} {{/parcelableModel}} diff --git a/modules/swagger-codegen/src/main/resources/Java/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/pom.mustache index 58b8d4bce2b..aa7b0491767 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pom.mustache @@ -202,6 +202,22 @@ + {{#java11}} + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + {{/java11}} @@ -329,8 +345,8 @@ 2.5 3.6 {{/supportJava6}} - {{^threetenbp}}2.10.1{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} + {{^threetenbp}}2.11.4{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/enumClass.mustache index c5c3143cb94..28a623bbbef 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/enumClass.mustache @@ -39,6 +39,6 @@ return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/enumOuterClass.mustache index 76c2cbf5a76..197e62702e0 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/enumOuterClass.mustache @@ -37,6 +37,6 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache index 1737c94615b..207e28eaf82 100644 --- a/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaInflector/pom.mustache @@ -137,6 +137,10 @@ + {{#java11}} + 11 + 11 + {{/java11}} UTF-8 1.0.0 1.0.14 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache index c8c6946fef6..7c347758d8d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache @@ -1,4 +1,16 @@ {{#required}} @NotNull {{/required}} +{{#isContainer}} +{{^isPrimitiveType}} +{{^isEnum}} + @Valid +{{/isEnum}} +{{/isPrimitiveType}} +{{/isContainer}} +{{#isNotContainer}} +{{^isPrimitiveType}} + @Valid +{{/isPrimitiveType}} +{{/isNotContainer}} {{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache index c8c6946fef6..7c347758d8d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/beanValidation.mustache @@ -1,4 +1,16 @@ {{#required}} @NotNull {{/required}} +{{#isContainer}} +{{^isPrimitiveType}} +{{^isEnum}} + @Valid +{{/isEnum}} +{{/isPrimitiveType}} +{{/isContainer}} +{{#isNotContainer}} +{{^isPrimitiveType}} + @Valid +{{/isPrimitiveType}} +{{/isNotContainer}} {{>beanValidationCore}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache index 10bb9d0f4e0..9e2de83c509 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/enumClass.mustache @@ -28,6 +28,6 @@ public enum {{datatypeWithEnum}} { return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache index 225cfd719cc..abd654d57e2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/model.mustache @@ -4,6 +4,7 @@ package {{package}}; {{/imports}} {{#useBeanValidation}} import javax.validation.constraints.*; +import javax.validation.Valid; {{/useBeanValidation}} {{#models}} {{#model}}{{#description}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache index 8b4ef09bf33..612d34f6d62 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf-cdi/pom.mustache @@ -57,9 +57,8 @@ org.apache.cxf cxf-rt-frontend-jaxrs - - - 3.0.2 + + 3.3.8 provided @@ -67,7 +66,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider - 2.10.1 + 2.11.4 @@ -76,7 +75,7 @@ swagger-annotations [1.5.3,1.5.16] - + {{#useBeanValidation}} @@ -89,4 +88,11 @@ + {{#java11}} + + 11 + 11 + + {{/java11}} + diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache index d5a92dd3e74..7dc5883143f 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumClass.mustache @@ -28,6 +28,6 @@ public enum {{datatypeWithEnum}} { return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache index 5e456c65740..cd70d96ecc5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/enumOuterClass.mustache @@ -42,7 +42,7 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache index 8d576a69321..92b92da8cbb 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -122,7 +122,7 @@ ${cxf-version} test - + org.apache.cxf @@ -168,13 +168,13 @@ ${jackson-jaxrs-version} {{/java8}} -{{#useBeanValidationFeature}} +{{#useBeanValidationFeature}} org.hibernate hibernate-validator 5.2.2.Final -{{/useBeanValidationFeature}} +{{/useBeanValidationFeature}} @@ -186,19 +186,19 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 - 4.12 + 4.13.1 1.1.7 2.5 -{{#useBeanValidation}} +{{#useBeanValidation}} 1.1.0.Final -{{/useBeanValidation}} +{{/useBeanValidation}} 3.2.1 - 2.10.1 + 2.11.4 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache index fb8fa1d30d5..d2226c095a9 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/server/pom.mustache @@ -79,7 +79,7 @@ - + maven-war-plugin @@ -131,7 +131,7 @@ ${cxf-version} test - + org.apache.cxf @@ -183,7 +183,7 @@ ${jackson-jaxrs-version} {{/java8}} -{{#generateSpringApplication}} +{{#generateSpringApplication}} org.springframework @@ -194,7 +194,7 @@ org.springframework spring-web ${spring-version} - + {{/generateSpringApplication}} {{#generateSpringBootApplication}} @@ -211,7 +211,7 @@ ${spring.boot-version} test - + org.apache.cxf cxf-spring-boot-starter-jaxrs @@ -237,25 +237,25 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 - 4.12 + 4.13.1 1.1.7 2.5 -{{#useBeanValidation}} +{{#useBeanValidation}} 1.1.0.Final -{{/useBeanValidation}} -{{#generateSpringApplication}} +{{/useBeanValidation}} +{{#generateSpringApplication}} 4.3.13.RELEASE -{{/generateSpringApplication}} +{{/generateSpringApplication}} {{#generateSpringBootApplication}} 1.5.9.RELEASE -{{/generateSpringBootApplication}} +{{/generateSpringBootApplication}} 3.2.1 - 2.10.1 + 2.11.4 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumClass.mustache index d98deed86cc..0f5c597bb89 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumClass.mustache @@ -39,6 +39,6 @@ return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumOuterClass.mustache index 6de036b74eb..e003ac2f3fd 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/enumOuterClass.mustache @@ -37,6 +37,6 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache index 43196ada063..ad5197dee39 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/libraries/jersey1/pom.mustache @@ -175,7 +175,8 @@ validation-api 1.1.0.Final -{{/useBeanValidation}} + +{{/useBeanValidation}} @@ -187,15 +188,15 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 1.19.1 - 2.10.1 + 2.11.4 1.7.21 - 4.12 + 4.13.1 2.5 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache index 1d4785dda12..fce25592536 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/model.mustache @@ -15,6 +15,7 @@ import java.io.Serializable; {{/serializableModel}} {{#useBeanValidation}} import javax.validation.constraints.*; +import javax.validation.Valid; {{/useBeanValidation}} {{#models}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache index 378ec210f2b..5775ba4387e 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pojo.mustache @@ -2,7 +2,8 @@ * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} */{{#description}} @ApiModel(description = "{{{description}}}"){{/description}} -{{>generatedAnnotation}} +{{>generatedAnnotation}}{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#vars}} {{#isEnum}} diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index 1659b8865fe..5f9b453dca0 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -13,7 +13,7 @@ repo - + src/main/java @@ -172,7 +172,7 @@ ${commons_io_version} {{/supportJava6}} - + {{#useBeanValidation}} @@ -193,18 +193,18 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 2.22.2 - 2.10.1 + 2.11.4 {{#supportJava6}} 2.5 3.5 {{/supportJava6}} - 4.12 + 4.13.1 1.1.7 2.5 UTF-8 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/Dockerfile.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/Dockerfile.mustache new file mode 100644 index 00000000000..688a49dc530 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/Dockerfile.mustache @@ -0,0 +1,7 @@ +FROM jboss/wildfly:21.0.2.Final + +ADD target/{{artifactId}}-{{artifactVersion}}.war /opt/jboss/wildfly/standalone/deployments/ + +EXPOSE 8080 9990 8009 + +CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"] diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/README.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/README.mustache index 3551b9e9914..c5db76ad9e2 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/README.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/README.mustache @@ -7,10 +7,14 @@ is an example of building a swagger-enabled JAX-RS server. This example uses the [JAX-RS](https://jax-rs-spec.java.net/) framework. -To run the server, please execute the following: +To run with docker, please execute the following: ``` -mvn clean package jetty:run +mvn package + +docker build -q --rm --tag=swagger-codegen-resteasy . + +docker run -d -p 8080:8080 -p 9990:9990 -p 8009:8009 --name swagger-resteasy -it swagger-codegen-resteasy ``` You can then view the swagger listing here: @@ -18,6 +22,3 @@ You can then view the swagger listing here: ``` http://localhost:{{serverPort}}{{contextPath}}/swagger.json ``` - -Note that if you have configured the `host` to be something other than localhost, the calls through -swagger-ui will be directed to that host and not localhost! \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache index 069226075dc..507a2e5c9c5 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/gradle.mustache @@ -19,11 +19,11 @@ dependencies { providedCompile 'javax.validation:validation-api:1.1.0.Final' {{/useBeanValidation}} {{^java8}} - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.11.4' compile 'joda-time:joda-time:2.7' {{/java8}} {{#java8}} - compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4' {{/java8}} testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index 79caaf93633..674420f5c04 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache @@ -14,8 +14,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} @@ -187,30 +187,30 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.10.1 + 2.11.4 {{/java8}} {{#java8}} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.10.1 + 2.11.4 {{/java8}} com.fasterxml.jackson.core jackson-databind - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-core - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-annotations - 2.10.1 + 2.11.4 org.apache.httpcomponents @@ -229,11 +229,11 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 3.0.11.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache index 1989cbcbd29..f02f6c43c1c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/gradle.mustache @@ -21,10 +21,10 @@ dependencies { providedCompile 'javax.validation:validation-api:1.1.0.Final' {{/useBeanValidation}} {{#java8}} - compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4' {{/java8}} {{^java8}} - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.11.4' compile 'joda-time:joda-time:2.7' {{/java8}} //TODO: swaggerFeature diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache index a94e3ad88cb..28eae6ccd98 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -14,8 +14,8 @@ maven-compiler-plugin 3.6.1 - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} @@ -89,18 +89,6 @@ ${resteasy-version} provided - - org.jboss.resteasy - jaxrs-api - ${resteasy-version} - provided - - - org.jboss.resteasy - resteasy-validator-provider-11 - ${resteasy-version} - provided - org.jboss.resteasy resteasy-multipart-provider @@ -177,8 +165,8 @@ 1.1.0.Final provided -{{/useBeanValidation}} - +{{/useBeanValidation}} + @@ -190,12 +178,12 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 - 3.0.11.Final + 3.13.2.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 - 2.10.1 + 2.11.4 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache index 4589ba05c29..697c0697512 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumClass.mustache @@ -11,7 +11,7 @@ public enum {{datatypeWithEnum}} { value = v; } - public String value() { + public {{datatype}} value() { return value; } @@ -28,6 +28,6 @@ public enum {{datatypeWithEnum}} { return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache index 29c83c9ac05..f1aba630bdf 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/enumOuterClass.mustache @@ -38,6 +38,6 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache index 931d1abff8b..1b7f188a219 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/formParams.mustache @@ -1,2 +1 @@ -{{#isFormParam}}{{#notFile}}@FormParam(value = "{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @FormParam(value = "{{baseName}}") InputStream {{paramName}}InputStream, - @FormParam(value = "{{baseName}}") Attachment {{paramName}}Detail{{/isFile}}{{/isFormParam}} \ No newline at end of file +{{#isFormParam}}{{#notFile}}@FormParam(value = "{{baseName}}") {{{dataType}}} {{paramName}}{{/notFile}}{{#isFile}} @FormParam(value = "{{baseName}}") InputStream {{paramName}}InputStream{{/isFile}}{{/isFormParam}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache index b0316d58730..15e57aedb25 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache @@ -33,15 +33,64 @@ {{/interfaceOnly}} + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + {{#java11}} + + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + + {{/java11}} javax.ws.rs javax.ws.rs-api - 2.0 + 2.1.1 provided + {{#jackson}} + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + + {{/jackson}} io.swagger swagger-annotations @@ -85,6 +134,13 @@ {{/useBeanValidation}} - 4.8.1 + {{#java11}} + 11 + 11 + {{/java11}} + {{#jackson}} + 2.9.9 + {{/jackson}} + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache index 5d5086497d9..229097062e8 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumClass.mustache @@ -39,6 +39,6 @@ return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache index 4bd1206fd55..4bc48db0e22 100644 --- a/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaPlayFramework/enumOuterClass.mustache @@ -37,6 +37,6 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index c5b15481649..bd77741e85d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -49,14 +49,17 @@ import java.util.Optional; {{/useOptional}} {{/jdk8-no-delegate}} {{#async}} -import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture{{/jdk8}}; +import java.util.concurrent.{{^isJava8or11}}Callable{{/isJava8or11}}{{#isJava8or11}}CompletableFuture{{/isJava8or11}}; {{/async}} {{>generatedAnnotation}} +{{#useBeanValidation}} +@Validated +{{/useBeanValidation}} @Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API") {{#operations}} @RequestMapping(value = "{{{contextPath}}}") public interface {{classname}} { -{{#jdk8}} +{{#isJava8or11}} {{^isDelegate}} Logger log = LoggerFactory.getLogger({{classname}}.class); @@ -76,7 +79,7 @@ public interface {{classname}} { {{#isDelegate}} {{classname}}Delegate getDelegate(); {{/isDelegate}} -{{/jdk8}} +{{/isJava8or11}} {{#operation}} @ApiOperation(value = "{{{summary}}}", nickname = "{{{operationId}}}", notes = "{{{notes}}}"{{#returnBaseType}}, response = {{{returnBaseType}}}.class{{/returnBaseType}}{{#returnContainer}}, responseContainer = "{{{returnContainer}}}"{{/returnContainer}}{{#hasAuthMethods}}, authorizations = { @@ -101,7 +104,7 @@ public interface {{classname}} { produces = { {{#produces}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/produces}} }, {{/hasProduces}}{{#hasConsumes}} consumes = { {{#consumes}}"{{{mediaType}}}"{{#hasMore}}, {{/hasMore}}{{/consumes}} },{{/hasConsumes}}{{/singleContentTypes}} method = RequestMethod.{{httpMethod}}) - {{#defaultInterfaces}}default {{/defaultInterfaces}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{^defaultInterfaces}};{{/defaultInterfaces}}{{#defaultInterfaces}} { + {{#isJava8or11}}{{#defaultInterfaces}}default {{/defaultInterfaces}}{{/isJava8or11}}{{#responseWrapper}}{{.}}<{{/responseWrapper}}ResponseEntity<{{>returnTypes}}>{{#responseWrapper}}>{{/responseWrapper}} {{#delegate-method}}_{{/delegate-method}}{{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}){{#isJava8or11}}{{^defaultInterfaces}};{{/defaultInterfaces}}{{#defaultInterfaces}} { {{#delegate-method}} return {{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); } @@ -129,7 +132,7 @@ public interface {{classname}} { {{#isDelegate}} return getDelegate().{{operationId}}({{#allParams}}{{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}); {{/isDelegate}} - }{{/defaultInterfaces}} + }{{/defaultInterfaces}}{{/isJava8or11}} {{/operation}} } diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache index 4d56cdab40a..ba5391e4691 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/apiController.mustache @@ -1,21 +1,21 @@ package {{package}}; -{{^jdk8}} +{{^isJava8or11}} {{#imports}}import {{import}}; {{/imports}} -{{/jdk8}} +{{/isJava8or11}} {{^isDelegate}} import com.fasterxml.jackson.databind.ObjectMapper; {{/isDelegate}} -{{^jdk8}} +{{^isJava8or11}} import io.swagger.annotations.*; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; -{{/jdk8}} +{{/isJava8or11}} import org.springframework.stereotype.Controller; -{{^jdk8}} +{{^isJava8or11}} import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestHeader; @@ -27,19 +27,19 @@ import org.springframework.web.multipart.MultipartFile; import javax.validation.constraints.*; import javax.validation.Valid; {{/useBeanValidation}} -{{/jdk8}} +{{/isJava8or11}} {{^isDelegate}} import javax.servlet.http.HttpServletRequest; - {{#jdk8}} + {{#isJava8or11}} import java.util.Optional; - {{/jdk8}} + {{/isJava8or11}} {{/isDelegate}} {{^jdk8-no-delegate}} {{#useOptional}} import java.util.Optional; {{/useOptional}} {{/jdk8-no-delegate}} -{{^jdk8}} +{{^isJava8or11}} {{^isDelegate}} import java.io.IOException; {{/isDelegate}} @@ -47,7 +47,7 @@ import java.util.List; {{#async}} import java.util.concurrent.Callable; {{/async}} -{{/jdk8}} +{{/isJava8or11}} {{>generatedAnnotation}} @Controller {{#operations}} @@ -60,19 +60,19 @@ public class {{classname}}Controller implements {{classname}} { public {{classname}}Controller({{classname}}Delegate delegate) { this.delegate = delegate; } - {{#jdk8}} + {{#isJava8or11}} @Override public {{classname}}Delegate getDelegate() { return delegate; } - {{/jdk8}} + {{/isJava8or11}} {{/isDelegate}} {{^isDelegate}} - {{^jdk8}} + {{^isJava8or11}} private static final Logger log = LoggerFactory.getLogger({{classname}}Controller.class); - {{/jdk8}} + {{/isJava8or11}} private final ObjectMapper objectMapper; private final HttpServletRequest request; @@ -82,7 +82,7 @@ public class {{classname}}Controller implements {{classname}} { this.objectMapper = objectMapper; this.request = request; } - {{#jdk8}} + {{#isJava8or11}} @Override public Optional getObjectMapper() { @@ -93,10 +93,10 @@ public class {{classname}}Controller implements {{classname}} { public Optional getRequest() { return Optional.ofNullable(request); } - {{/jdk8}} + {{/isJava8or11}} {{/isDelegate}} -{{^jdk8}} +{{^isJava8or11}} {{#operation}} public {{#async}}Callable<{{/async}}ResponseEntity<{{>returnTypes}}>{{#async}}>{{/async}} {{operationId}}({{#allParams}}{{>queryParams}}{{>pathParams}}{{>headerParams}}{{>bodyParams}}{{>formParams}}{{#hasMore}},{{/hasMore}}{{/allParams}}) { {{^isDelegate}} @@ -142,6 +142,6 @@ public class {{classname}}Controller implements {{classname}} { } {{/operation}} -{{/jdk8}} +{{/isJava8or11}} } {{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache index dcdd755a870..ec54b18ad9e 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/apiDelegate.mustache @@ -2,35 +2,35 @@ package {{package}}; {{#imports}}import {{import}}; {{/imports}} -{{#jdk8}} +{{#isJava8or11}} import com.fasterxml.jackson.databind.ObjectMapper; -{{/jdk8}} +{{/isJava8or11}} import io.swagger.annotations.*; -{{#jdk8}} +{{#isJava8or11}} import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.http.HttpStatus; -{{/jdk8}} +{{/isJava8or11}} import org.springframework.http.ResponseEntity; import org.springframework.web.multipart.MultipartFile; -{{#jdk8}} +{{#isJava8or11}} import java.io.IOException; -{{/jdk8}} +{{/isJava8or11}} -{{#jdk8}} +{{#isJava8or11}} import javax.servlet.http.HttpServletRequest; -{{/jdk8}} +{{/isJava8or11}} import java.util.List; -{{#jdk8}} +{{#isJava8or11}} import java.util.Optional; -{{/jdk8}} -{{^jdk8}} +{{/isJava8or11}} +{{^isJava8or11}} {{#useOptional}} import java.util.Optional; {{/useOptional}} -{{/jdk8}} +{{/isJava8or11}} {{#async}} -import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture{{/jdk8}}; +import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#isJava8or11}}CompletableFuture{{/isJava8or11}}; {{/async}} {{#operations}} @@ -40,7 +40,7 @@ import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture */ {{>generatedAnnotation}} public interface {{classname}}Delegate { -{{#jdk8}} +{{#isJava8or11}} Logger log = LoggerFactory.getLogger({{classname}}.class); @@ -55,7 +55,7 @@ public interface {{classname}}Delegate { default Optional getAcceptHeader() { return getRequest().map(r -> r.getHeader("Accept")); } -{{/jdk8}} +{{/isJava8or11}} {{#operation}} /** diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/enumClass.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/enumClass.mustache index c5c3143cb94..28a623bbbef 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/enumClass.mustache @@ -39,6 +39,6 @@ return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/enumOuterClass.mustache index 76c2cbf5a76..197e62702e0 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/enumOuterClass.mustache @@ -37,6 +37,6 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache index 277b97372d5..0dfafb3eaf4 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-boot/pom.mustache @@ -6,7 +6,7 @@ {{artifactId}} {{artifactVersion}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} 2.7.0 @@ -34,6 +34,24 @@ {{/interfaceOnly}} + {{#java11}} + + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + + {{/java11}} org.springframework.boot @@ -60,7 +78,7 @@ com.fasterxml.jackson.dataformat jackson-dataformat-xml - 2.10.1 + 2.11.4 {{/withXml}} @@ -69,7 +87,7 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.10.1 + 2.11.4 {{/java8}} {{#joda}} @@ -77,7 +95,7 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.10.1 + 2.11.4 {{/joda}} {{#threetenbp}} @@ -95,6 +113,22 @@ validation-api {{/useBeanValidation}} + {{#notNullJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + 2.11.4 + + {{/notNullJacksonAnnotation}} + {{^notNullJacksonAnnotation}} + {{#ignoreUnknownJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + 2.11.4 + + {{/ignoreUnknownJacksonAnnotation}} + {{/notNullJacksonAnnotation}} org.springframework.boot spring-boot-starter-test diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache index ac0aaa6ea98..2b7488488c1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/apiClient.mustache @@ -1,10 +1,10 @@ package {{package}}; {{^isOpenFeign}} - import org.springframework.cloud.netflix.feign.FeignClient; +import org.springframework.cloud.netflix.feign.FeignClient; {{/isOpenFeign}} {{#isOpenFeign}} - import org.springframework.cloud.openfeign.FeignClient; +import org.springframework.cloud.openfeign.FeignClient; {{/isOpenFeign}} import {{configPackage}}.ClientConfiguration; diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache index c1c5233d17b..c04a74f72d1 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-cloud/pom.mustache @@ -6,10 +6,10 @@ {{artifactId}} {{artifactVersion}} - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 org.springframework.boot @@ -56,7 +56,7 @@ com.fasterxml.jackson.dataformat jackson-dataformat-xml - 2.10.1 + 2.11.4 {{/withXml}} @@ -65,7 +65,7 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.10.1 + 2.11.4 {{/java8}} {{#joda}} @@ -73,7 +73,7 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.10.1 + 2.11.4 {{/joda}} {{#threetenbp}} @@ -93,6 +93,22 @@ provided {{/useBeanValidation}} + {{#notNullJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + 2.11.4 + + {{/notNullJacksonAnnotation}} + {{^notNullJacksonAnnotation}} + {{#ignoreUnknownJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + 2.11.4 + + {{/ignoreUnknownJacksonAnnotation}} + {{/notNullJacksonAnnotation}} org.springframework.boot spring-boot-starter-test diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache index b6d60cfcf06..23f1b7b9b99 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/libraries/spring-mvc/pom.mustache @@ -65,6 +65,24 @@ + {{#java11}} + + + jdk11 + + [11,) + + + + com.sun.xml.ws + jaxws-rt + 2.3.3 + pom + + + + + {{/java11}} org.slf4j @@ -161,6 +179,22 @@ provided {{/useBeanValidation}} + {{#notNullJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + {{/notNullJacksonAnnotation}} + {{^notNullJacksonAnnotation}} + {{#ignoreUnknownJacksonAnnotation}} + + com.fasterxml.jackson.core + jackson-annotations + 2.11.4 + + {{/ignoreUnknownJacksonAnnotation}} + {{/notNullJacksonAnnotation}} org.testng testng @@ -189,15 +223,15 @@ - {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} + {{#java11}}11{{/java11}}{{^java11}}{{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}}{{/java11}} ${java.version} ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 - 2.10.1 + 2.11.4 2.6.4 4.3.9.RELEASE diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache index c11ca7304cc..3631b9fcc4d 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/pojo.mustache @@ -1,9 +1,25 @@ /** * {{#description}}{{.}}{{/description}}{{^description}}{{classname}}{{/description}} - */{{#description}} -@ApiModel(description = "{{{description}}}"){{/description}} -{{#useBeanValidation}}@Validated{{/useBeanValidation}} -{{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} + */ +{{#description}} +@ApiModel(description = "{{{description}}}") +{{/description}} +{{#useBeanValidation}} +@Validated +{{/useBeanValidation}} +{{>generatedAnnotation}} +{{#discriminator}} +{{>typeInfoAnnotation}} +{{/discriminator}} +{{>xmlAnnotation}} +{{#notNullJacksonAnnotation}} +@JsonInclude(JsonInclude.Include.NON_NULL) +{{/notNullJacksonAnnotation}} +{{#ignoreUnknownJacksonAnnotation}} +@JsonIgnoreProperties(ignoreUnknown = true) +{{/ignoreUnknownJacksonAnnotation}} +{{#additionalModelTypeAnnotations}}{{{.}}} +{{/additionalModelTypeAnnotations}} public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#serializableModel}}implements Serializable{{/serializableModel}} { {{#serializableModel}} private static final long serialVersionUID = 1L; diff --git a/modules/swagger-codegen/src/main/resources/JavaVertXServer/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/JavaVertXServer/enumOuterClass.mustache index 2308e8773d1..ce08f178f99 100644 --- a/modules/swagger-codegen/src/main/resources/JavaVertXServer/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaVertXServer/enumOuterClass.mustache @@ -25,12 +25,12 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return String.valueOf(value); } - public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue(String text) { + public static {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} fromValue({{{dataType}}} value) { for ({{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} b : {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + value + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/JavaVertXServer/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaVertXServer/pom.mustache index 21f386ada11..85b4f72143c 100644 --- a/modules/swagger-codegen/src/main/resources/JavaVertXServer/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaVertXServer/pom.mustache @@ -1,14 +1,14 @@ 4.0.0 - + {{groupId}} {{artifactId}} {{artifactVersion}} jar - + {{appName}} - + UTF-8 1.8 @@ -17,7 +17,7 @@ 3.3 {{vertxSwaggerRouterVersion}} 2.3 - 2.10.1 + 2.11.4 @@ -59,7 +59,7 @@ ${java.version} - + org.apache.maven.plugins maven-shade-plugin @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/modules/swagger-codegen/src/main/resources/Javascript/api-test-response-property.mustache b/modules/swagger-codegen/src/main/resources/Javascript/api-test-response-property.mustache index 7440153fc55..1d1da2b2f5d 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/api-test-response-property.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/api-test-response-property.mustache @@ -14,11 +14,13 @@ }}{{^loadTestDataFromFile}}{{>api-test-property}}{{/loadTestDataFromFile}}); {{/isPrimitiveType}} {{^isPrimitiveType}} - {{#vendorExtensions.x-indent}} - {{#vendorExtensions.x-indent}} + {{^vendorExtensions.x-is-recursive-model}} + {{#vendorExtensions.x-indent}} + {{#vendorExtensions.x-indent}} {{>api-test-response-complex}}{{! - }}{{/vendorExtensions.x-indent}}{{! - }}{{/vendorExtensions.x-indent}}{{! + }}{{/vendorExtensions.x-indent}}{{! + }}{{/vendorExtensions.x-indent}} + {{/vendorExtensions.x-is-recursive-model}}{{! }}{{/isPrimitiveType}}{{! }} } {{/items}} diff --git a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache index 11385bd3cbf..97e007fe22c 100644 --- a/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/Javascript/partial_model_generic.mustache @@ -95,6 +95,10 @@ exports.prototype.{{name}} = {{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}undefined{{/defaultValue}}; {{/vars}} +{{#additionalPropertiesType}} + exports.prototype.additionalProperties = new Map(); +{{/additionalPropertiesType}} + {{#useInheritance}} {{#interfaceModels}} // Implement {{classname}} interface: diff --git a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig index 94628447716..1571aa5db81 100644 --- a/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig +++ b/modules/swagger-codegen/src/main/resources/META-INF/services/io.swagger.codegen.CodegenConfig @@ -87,15 +87,8 @@ io.swagger.codegen.languages.TypeScriptAngularJsClientCodegen io.swagger.codegen.languages.TypeScriptFetchClientCodegen io.swagger.codegen.languages.TypeScriptJqueryClientCodegen io.swagger.codegen.languages.TypeScriptNodeClientCodegen -io.swagger.codegen.languages.TypeScriptFetchClientCodegen io.swagger.codegen.languages.TypeScriptAxiosClientCodegen -io.swagger.codegen.languages.AkkaScalaClientCodegen -io.swagger.codegen.languages.CsharpDotNet2ClientCodegen -io.swagger.codegen.languages.ClojureClientCodegen -io.swagger.codegen.languages.HaskellServantCodegen -io.swagger.codegen.languages.LumenServerCodegen -io.swagger.codegen.languages.GoServerCodegen -io.swagger.codegen.languages.ErlangServerCodegen +io.swagger.codegen.languages.UE4CPPGenerator io.swagger.codegen.languages.UndertowCodegen io.swagger.codegen.languages.ZendExpressivePathHandlerServerCodegen io.swagger.codegen.languages.KotlinServerCodegen diff --git a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache index 579446b86fa..4ef5491b7d4 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache @@ -3,7 +3,7 @@ org.wso2.msf4j msf4j-service 2.0.0 - + 4.0.0 {{groupId}} {{artifactId}} @@ -59,8 +59,8 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.10.1 - + 2.11.4 + @@ -75,10 +75,10 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.2.9.v20150224 2.22.2 - 4.12 + 4.13.1 1.1.7 2.5 2.22.2 diff --git a/modules/swagger-codegen/src/main/resources/android/pom.mustache b/modules/swagger-codegen/src/main/resources/android/pom.mustache index de1ee61bf6a..190e36bdf0e 100644 --- a/modules/swagger-codegen/src/main/resources/android/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/android/pom.mustache @@ -167,9 +167,9 @@ UTF-8 1.5.18 2.3.1 - 4.8.1 + 4.13.1 1.0.0 - 4.8.1 + 4.13.1 4.3.6 diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Dockerfile.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Dockerfile.mustache new file mode 100644 index 00000000000..aaee7ee659a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Dockerfile.mustache @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:{{aspNetCoreVersion}} AS build-env +WORKDIR /app + +ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 + +# copy csproj and restore as distinct layers +COPY *.csproj ./ +RUN dotnet restore + +# copy everything else and build +COPY . ./ +RUN dotnet publish -c Release -o out + +# build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:{{aspNetCoreVersion}} +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "{{packageName}}.dll"] diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Filters/BasePathFilter.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Filters/BasePathFilter.mustache new file mode 100644 index 00000000000..3d2c3b67c74 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Filters/BasePathFilter.mustache @@ -0,0 +1,51 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; + +namespace {{packageName}}.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of Swagger 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 Swagger Doc + /// + /// The BasePath of the Swagger Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// OpenApiDocument + /// FilterContext + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) + { + swaggerDoc.Servers.Add(new OpenApiServer() { Url = this.BasePath }); + + var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); + + foreach (var path in pathsToModify) + { + if (path.Key.StartsWith(this.BasePath)) + { + string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty); + swaggerDoc.Paths.Remove(path.Key); + swaggerDoc.Paths.Add(newKey, path.Value); + } + } + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache new file mode 100644 index 00000000000..2343bcfdc37 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Filters/GeneratePathParamsValidationFilter.mustache @@ -0,0 +1,98 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; + +namespace {{packageName}}.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 swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes; + + if (attributes != null && attributes.Count() > 0 && swaggerParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + swaggerParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + string regex = (string)regexAttr.ConstructorArguments[0].Value; + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.Pattern = regex; + } + } + + // String Length [StringLength] + int? minLenght = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLenght = (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) + { + minLenght = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.MinLength = minLenght; + ((OpenApiParameter)swaggerParam).Schema.MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + if (swaggerParam is OpenApiParameter) + { + ((OpenApiParameter)swaggerParam).Schema.Minimum = rangeMin; + ((OpenApiParameter)swaggerParam).Schema.Maximum = rangeMax; + } + } + } + } + } + } +} + diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Program.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Program.mustache new file mode 100644 index 00000000000..49b1837ce6c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Program.mustache @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore; + +namespace {{packageName}} +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + /// + /// Create the web host builder. + /// + /// + /// IWebHostBuilder + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Project.csproj.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Project.csproj.mustache new file mode 100644 index 00000000000..82f6e1a838b --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Project.csproj.mustache @@ -0,0 +1,20 @@ + + + {{packageName}} + {{packageName}} + netcoreapp{{aspNetCoreVersion}} + true + true + {{packageName}} + {{packageName}} + + + + + + + + + + + diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Startup.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Startup.mustache new file mode 100644 index 00000000000..54f620910a0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/Startup.mustache @@ -0,0 +1,154 @@ +{{>partial_header}} +using System; +using System.IO; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.Extensions.Logging; +using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using {{packageName}}.Filters; +{{#hasAuthMethods}}using {{packageName}}.Security;{{/hasAuthMethods}} + +namespace {{packageName}} +{ + /// + /// Startup + /// + public class Startup + { + private readonly IWebHostEnvironment _hostingEnv; + + private IConfiguration Configuration { get; } + + /// + /// Constructor + /// + /// + /// + public Startup(IWebHostEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); + }) + .AddXmlSerializerFormatters(); + + {{#authMethods}} + {{#isBasic}} + services.AddAuthentication(BasicAuthenticationHandler.SchemeName) + .AddScheme(BasicAuthenticationHandler.SchemeName, null); + + {{/isBasic}} + {{#isBearer}} + services.AddAuthentication(BearerAuthenticationHandler.SchemeName) + .AddScheme(BearerAuthenticationHandler.SchemeName, null); + + {{/isBearer}} + {{#isApiKey}} + services.AddAuthentication(ApiKeyAuthenticationHandler.SchemeName) + .AddScheme(ApiKeyAuthenticationHandler.SchemeName, null); + + {{/isApiKey}} + {{/authMethods}} + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", new OpenApiInfo + { + Version = "{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}", + Title = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}", + Description = "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} (ASP.NET Core {{aspNetCoreVersion}})", + Contact = new OpenApiContact() + { + Name = "{{#infoName}}{{{infoName}}}{{/infoName}}{{^infoName}}Swagger Codegen Contributors{{/infoName}}", + Url = new Uri("{{#infoUrl}}{{{infoUrl}}}{{/infoUrl}}{{^infoUrl}}https://github.com/swagger-api/swagger-codegen{{/infoUrl}}"), + Email = "{{#infoEmail}}{{{infoEmail}}}{{/infoEmail}}" + }, + TermsOfService = new Uri("{{#termsOfService}}{{{termsOfService}}}{{/termsOfService}}") + }); + c.CustomSchemaIds(type => type.FullName); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + {{#basePathWithoutHost}} + // Sets the basePath property in the Swagger document generated + c.DocumentFilter("{{{basePathWithoutHost}}}"); + {{/basePathWithoutHost}} + + // Include DataAnnotation attributes on Controller Action parameters as Swagger 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, ILoggerFactory loggerFactory) + { + app.UseRouting(); + + //TODO: Uncomment this if you need wwwroot folder + // app.UseStaticFiles(); + + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/{{#version}}{{{version}}}{{/version}}{{^version}}v1{{/version}}/swagger.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}}"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "{{#appName}}{{{appName}}}{{/appName}}{{^appName}}{{packageName}}{{/appName}} Original"); + }); + + //TODO: Use Https Redirection + // app.UseHttpsRedirection(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) + app.UseExceptionHandler("/Error"); + + app.UseHsts(); + } + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/controller.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/controller.mustache new file mode 100644 index 00000000000..08519fc0e92 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/3.0/controller.mustache @@ -0,0 +1,71 @@ +{{>partial_header}} +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using {{packageName}}.Attributes; +{{#hasAuthMethods}}using {{packageName}}.Security;{{/hasAuthMethods}} +using Microsoft.AspNetCore.Authorization; +using {{modelPackage}}; + +namespace {{packageName}}.Controllers +{ {{#operations}} + /// + /// {{description}} + /// {{#description}} + [Description("{{description}}")]{{/description}} + [ApiController] + public class {{classname}}Controller : ControllerBase{{#interfaceController}}, I{{classname}}Controller{{/interfaceController}} + { {{#operation}} + /// + /// {{#summary}}{{summary}}{{/summary}} + /// + {{#notes}}/// {{notes}}{{/notes}}{{#allParams}} + /// {{description}}{{/allParams}}{{#responses}} + /// {{message}}{{/responses}} + [{{httpMethod}}] + [Route("{{{basePathWithoutHost}}}{{{path}}}")] + {{#authMethods}} + {{#-first}} + {{#isBasic}} + [Authorize(AuthenticationSchemes = BasicAuthenticationHandler.SchemeName)] + {{/isBasic}} + {{#isBearer}} + [Authorize(AuthenticationSchemes = BearerAuthenticationHandler.SchemeName)] + {{/isBearer}} + {{#isApiKey}} + [Authorize(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + {{/isApiKey}} + {{/-first}} + {{/authMethods}} + [ValidateModelState] + [SwaggerOperation("{{operationId}}")]{{#responses}}{{#dataType}} + [SwaggerResponse(statusCode: {{code}}, type: typeof({{&dataType}}), description: "{{message}}")]{{/dataType}}{{^dataType}}{{/dataType}}{{/responses}} + public virtual IActionResult {{operationId}}({{#allParams}}{{>pathParam}}{{>queryParam}}{{>bodyParam}}{{>formParam}}{{>headerParam}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) + { {{#responses}} +{{#dataType}} + //TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode({{code}}, default({{&dataType}})); +{{/dataType}} +{{^dataType}} + //TODO: Uncomment the next line to return response {{code}} or use other options such as return this.NotFound(), return this.BadRequest(..), ... + // return StatusCode({{code}}); +{{/dataType}}{{/responses}} +{{#returnType}} + string exampleJson = null; + {{#examples}} + exampleJson = "{{{example}}}"; + {{/examples}} + {{#isListCollection}}{{>listReturn}}{{/isListCollection}}{{^isListCollection}}{{#isMapContainer}}{{>mapReturn}}{{/isMapContainer}}{{^isMapContainer}}{{>objectReturn}}{{/isMapContainer}}{{/isListCollection}} + {{!TODO: defaultResponse, examples, auth, consumes, produces, nickname, externalDocs, imports, security}} + //TODO: Change the data returned + return new ObjectResult(example);{{/returnType}}{{^returnType}} + throw new NotImplementedException();{{/returnType}} + } + {{/operation}} + } +{{/operations}} +} diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/README.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/README.mustache index 03f23c1916a..425e0b5ae33 100644 --- a/modules/swagger-codegen/src/main/resources/aspnetcore/README.mustache +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/README.mustache @@ -1,4 +1,4 @@ -# {{packageName}} - ASP.NET Core 2.0 Server +# {{packageName}} - ASP.NET Core {{aspNetCoreVersion}} Server {{#appDescription}} {{{appDescription}}} diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/Solution.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/Solution.mustache index 80e5f652101..8c6d69ea93d 100644 --- a/modules/swagger-codegen/src/main/resources/aspnetcore/Solution.mustache +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/Solution.mustache @@ -1,21 +1,22 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26114.2 +VisualStudioVersion = 15.0.27428.2043 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "{{packageName}}", "src\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "{{packageName}}", "{{sourceFolder}}\{{packageName}}\{{packageName}}.csproj", "{{packageGuid}}" EndProject Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU - {{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU - {{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {{packageGuid}}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {{packageGuid}}.Debug|Any CPU.Build.0 = Debug|Any CPU + {{packageGuid}}.Release|Any CPU.ActiveCfg = Release|Any CPU + {{packageGuid}}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection EndGlobal diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/model.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/model.mustache index 00521d0a5f2..8f054f2f5ea 100644 --- a/modules/swagger-codegen/src/main/resources/aspnetcore/model.mustache +++ b/modules/swagger-codegen/src/main/resources/aspnetcore/model.mustache @@ -19,7 +19,7 @@ namespace {{packageName}}.Models /// [DataContract] public partial class {{classname}} : {{#parent}}{{{parent}}}, {{/parent}}IEquatable<{{classname}}> - { {{#vars}}{{#isEnum}}{{>enumClass}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{>enumClass}}{{/items}}{{/items.isEnum}} + { {{#vars}}{{#isEnum}}{{^complexType}}{{>enumClass}}{{/complexType}}{{/isEnum}}{{#items.isEnum}}{{#items}}{{^complexType}}{{>enumClass}}{{/complexType}}{{/items}}{{/items.isEnum}} /// /// {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}} /// @@ -28,7 +28,12 @@ namespace {{packageName}}.Models {{/description}} {{#required}} [Required] - {{/required}} + {{/required}}{{#pattern}} + [RegularExpression("{{{pattern}}}")]{{/pattern}}{{#minLength}}{{#maxLength}} + [StringLength({{maxLength}}, MinimumLength={{minLength}})]{{/maxLength}}{{/minLength}}{{#minLength}}{{^maxLength}} + [MinLength({{minLength}})]{{/maxLength}}{{/minLength}}{{^minLength}}{{#maxLength}} + [MaxLength({{maxLength}})]{{/maxLength}}{{/minLength}}{{#minimum}}{{#maximum}} + [Range({{minimum}}, {{maximum}})]{{/maximum}}{{/minimum}} [DataMember(Name="{{baseName}}")] {{#isEnum}} public {{{datatypeWithEnum}}}{{#isEnum}}{{^isContainer}}?{{/isContainer}}{{/isEnum}} {{name}} { get; set; } diff --git a/modules/swagger-codegen/src/main/resources/aspnetcore/wwwroot/README.md b/modules/swagger-codegen/src/main/resources/aspnetcore/wwwroot/README.md deleted file mode 100644 index 6a0b78471a3..00000000000 --- a/modules/swagger-codegen/src/main/resources/aspnetcore/wwwroot/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# 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/modules/swagger-codegen/src/main/resources/codegen/myFile.template b/modules/swagger-codegen/src/main/resources/codegen/myFile.template new file mode 100644 index 00000000000..ac29967fb6e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/codegen/myFile.template @@ -0,0 +1,2 @@ + +# This is a sample supporting file mustache template. diff --git a/modules/swagger-codegen/src/main/resources/codegen/pom.mustache b/modules/swagger-codegen/src/main/resources/codegen/pom.mustache index 2d01469c986..37cf7df1705 100644 --- a/modules/swagger-codegen/src/main/resources/codegen/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/codegen/pom.mustache @@ -118,6 +118,6 @@ UTF-8 {{swaggerCodegenVersion}} 1.0.0 - 4.8.1 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/csharp-dotnet2/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/Configuration.mustache index a175367ab74..e09f39fc601 100644 --- a/modules/swagger-codegen/src/main/resources/csharp-dotnet2/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/Configuration.mustache @@ -84,7 +84,7 @@ namespace {{clientPackage}} private static string _dateTimeFormat = ISO8601_DATETIME_FORMAT; /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/modules/swagger-codegen/src/main/resources/csharp-dotnet2/compile-mono.sh.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/compile-mono.sh.mustache index 2287344892a..cbf5af813e7 100644 --- a/modules/swagger-codegen/src/main/resources/csharp-dotnet2/compile-mono.sh.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/compile-mono.sh.mustache @@ -1,4 +1,4 @@ -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; +curl --location --request GET 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' --output './nuget.exe' mozroots --import --sync mono nuget.exe install vendor/packages.config -o vendor; mkdir -p bin; diff --git a/modules/swagger-codegen/src/main/resources/csharp-dotnet2/csproj.mustache b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/csproj.mustache new file mode 100644 index 00000000000..7894c816a8a --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/csharp-dotnet2/csproj.mustache @@ -0,0 +1,23 @@ + + + + netstandard2.0 + {{clientPackage}} + + + + + {{packageName}} + {{packageVersion}} + {{packageAuthors}} + {{packageCompany}} + {{packageTitle}} + {{packageDescription}} + {{packageCopyright}} + + + + + + + \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache index 9e4cf95b55d..cd508c9119f 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/Configuration.mustache @@ -323,7 +323,7 @@ namespace {{packageName}}.Client } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache b/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache index 015e7142dbc..f97bf82d888 100644 --- a/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/csharp/enumClass.mustache @@ -11,7 +11,7 @@ /// /// Enum {{name}} for {{{value}}} /// - [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{{value}}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] + [EnumMember(Value = {{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isFloat}}"{{/isFloat}}{{#isDouble}}"{{/isDouble}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isLong}}"{{/isLong}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isFloat}}"{{/isFloat}})] {{name}}{{#isLong}} = {{{value}}}{{/isLong}}{{#isInteger}} = {{{value}}}{{/isInteger}}{{^isInteger}} = {{-index}}{{/isInteger}}{{^-last}}, {{/-last}}{{/enumVars}}{{/allowableValues}} } diff --git a/modules/swagger-codegen/src/main/resources/dart/api.mustache b/modules/swagger-codegen/src/main/resources/dart/api.mustache index 75846638d85..5573641de20 100644 --- a/modules/swagger-codegen/src/main/resources/dart/api.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/api.mustache @@ -12,6 +12,9 @@ class {{classname}} { /// {{summary}} /// /// {{notes}} + {{#isDeprecated}} + @deprecated + {{/isDeprecated}} {{#returnType}}Future<{{{returnType}}}> {{/returnType}}{{^returnType}}Future {{/returnType}}{{nickname}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{ {{#allParams}}{{^required}}{{{dataType}}} {{paramName}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}} }{{/hasOptionalParams}}) async { Object postBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; diff --git a/modules/swagger-codegen/src/main/resources/dart/class.mustache b/modules/swagger-codegen/src/main/resources/dart/class.mustache index 930bf61d2d8..f940c624821 100644 --- a/modules/swagger-codegen/src/main/resources/dart/class.mustache +++ b/modules/swagger-codegen/src/main/resources/dart/class.mustache @@ -28,7 +28,12 @@ class {{classname}} { (json['{{baseName}}'] as List).map((item) => item as {{items.datatype}}).toList() {{/isListContainer}} {{^isListContainer}} + {{#isDouble}} + json['{{baseName}}'] == null ? null : json['{{baseName}}'].toDouble() + {{/isDouble}} + {{^isDouble}} json['{{baseName}}'] + {{/isDouble}} {{/isListContainer}} {{/complexType}}; {{/isDateTime}} diff --git a/modules/swagger-codegen/src/main/resources/finch/api.mustache b/modules/swagger-codegen/src/main/resources/finch/api.mustache index 8365f59b5bd..86ab4ab9b27 100644 --- a/modules/swagger-codegen/src/main/resources/finch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/finch/api.mustache @@ -16,6 +16,8 @@ import com.twitter.util.Future import com.twitter.io.Buf import io.finch._, items._ import java.io.File +import java.nio.file.Files +import java.nio.file.Paths import java.time._ object {{classname}} { @@ -81,7 +83,7 @@ object {{classname}} { } private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmp{{classname}}", null) + val file = Files.createTempFile("tmp{{classname}}", null).toFile() val output = new FileOutputStream(file) output.write(input) file diff --git a/modules/swagger-codegen/src/main/resources/go-server/Dockerfile b/modules/swagger-codegen/src/main/resources/go-server/Dockerfile new file mode 100644 index 00000000000..36e3f7ce2aa --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/go-server/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.10 AS build +WORKDIR /go/src +COPY go ./go +COPY main.go . + +ENV CGO_ENABLED=0 +RUN go get -d -v ./... + +RUN go build -a -installsuffix cgo -o swagger . + +FROM scratch AS runtime +COPY --from=build /go/src/swagger ./ +EXPOSE 8080/tcp +ENTRYPOINT ["./swagger"] diff --git a/modules/swagger-codegen/src/main/resources/go-server/model.mustache b/modules/swagger-codegen/src/main/resources/go-server/model.mustache index 7c9e5c88aab..82dcd584fef 100644 --- a/modules/swagger-codegen/src/main/resources/go-server/model.mustache +++ b/modules/swagger-codegen/src/main/resources/go-server/model.mustache @@ -11,7 +11,7 @@ type {{{name}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{/form const ( {{#allowableValues}} {{#enumVars}} - {{name}} {{{classname}}} = "{{{value}}}" + {{name}} {{{classname}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} ){{/isEnum}}{{^isEnum}}{{#description}} diff --git a/modules/swagger-codegen/src/main/resources/go/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index dcf982d3e80..e7f3c36c6a0 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -1,3 +1,4 @@ + {{>partial_header}} package {{packageName}} @@ -20,24 +21,24 @@ var ( type {{classname}}Service service {{#operation}} -/* +/* {{{classname}}}Service{{#summary}} {{.}}{{/summary}}{{#notes}} {{notes}}{{/notes}} * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). {{#allParams}}{{#required}} * @param {{paramName}}{{#description}} {{.}}{{/description}} -{{/required}}{{/allParams}}{{#hasOptionalParams}} * @param optional nil or *{{{nickname}}}Opts - Optional Parameters: +{{/required}}{{/allParams}}{{#hasOptionalParams}} * @param optional nil or *{{{classname}}}{{{nickname}}}Opts - Optional Parameters: {{#allParams}}{{^required}} * @param "{{vendorExtensions.x-exportParamName}}" ({{#isPrimitiveType}}optional.{{vendorExtensions.x-optionalDataType}}{{/isPrimitiveType}}{{^isPrimitiveType}}optional.Interface of {{dataType}}{{/isPrimitiveType}}) - {{#description}} {{.}}{{/description}} {{/required}}{{/allParams}}{{/hasOptionalParams}} {{#returnType}}@return {{{returnType}}}{{/returnType}} */ {{#hasOptionalParams}} -type {{{nickname}}}Opts struct { {{#allParams}}{{^required}} +type {{{classname}}}{{{nickname}}}Opts struct { {{#allParams}}{{^required}} {{#isPrimitiveType}} {{vendorExtensions.x-exportParamName}} optional.{{vendorExtensions.x-optionalDataType}}{{/isPrimitiveType}}{{^isPrimitiveType}} {{vendorExtensions.x-exportParamName}} optional.Interface{{/isPrimitiveType}}{{/required}}{{/allParams}} } {{/hasOptionalParams}} -func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) { +func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams}}, {{/hasParams}}{{#allParams}}{{#required}}{{paramName}} {{{dataType}}}{{#hasMore}}, {{/hasMore}}{{/required}}{{/allParams}}{{#hasOptionalParams}}localVarOptionals *{{{classname}}}{{{nickname}}}Opts{{/hasOptionalParams}}) ({{#returnType}}{{{returnType}}}, {{/returnType}}*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("{{httpMethod}}") localVarPostBody interface{} @@ -148,8 +149,11 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} {{#hasFormParams}} {{#formParams}} {{#isFile}} - var localVarFile {{dataType}} +{{#required}} + localVarFile := {{paramName}} +{{/required}} {{^required}} + var localVarFile {{dataType}} if localVarOptionals != nil && localVarOptionals.{{vendorExtensions.x-exportParamName}}.IsSet() { localVarFileOk := false localVarFile, localVarFileOk = localVarOptionals.{{vendorExtensions.x-exportParamName}}.Value().({{dataType}}) @@ -231,9 +235,7 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err - } + return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, err } {{/returnType}} @@ -259,4 +261,4 @@ func (a *{{{classname}}}Service) {{{nickname}}}(ctx context.Context{{#hasParams} return {{#returnType}}localVarReturnValue, {{/returnType}}localVarHttpResponse, nil } -{{/operation}}{{/operations}} \ No newline at end of file +{{/operation}}{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/go/api_doc.mustache b/modules/swagger-codegen/src/main/resources/go/api_doc.mustache index 76e823ebb83..b7621f825ed 100644 --- a/modules/swagger-codegen/src/main/resources/go/api_doc.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api_doc.mustache @@ -22,10 +22,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.{{/-last}}{{/allParams}}{{#allParams}}{{#required}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}{{/required}}{{/allParams}}{{#hasOptionalParams}} - **optional** | ***{{{nickname}}}Opts** | optional parameters | nil if no parameters + **optional** | ***{{{classname}}}{{{nickname}}}Opts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a {{{nickname}}}Opts struct +Optional parameters are passed through a pointer to a {{{classname}}}{{{nickname}}}Opts struct {{#allParams}}{{#-last}} Name | Type | Description | Notes ------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}{{#allParams}} diff --git a/modules/swagger-codegen/src/main/resources/go/client.mustache b/modules/swagger-codegen/src/main/resources/go/client.mustache index d243a859571..39df7c3d830 100644 --- a/modules/swagger-codegen/src/main/resources/go/client.mustache +++ b/modules/swagger-codegen/src/main/resources/go/client.mustache @@ -25,8 +25,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the {{appName}} API v{{version}} @@ -185,7 +185,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -224,6 +224,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -465,4 +475,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/go/model.mustache b/modules/swagger-codegen/src/main/resources/go/model.mustache index 89057420bd2..b01d7fc21e2 100644 --- a/modules/swagger-codegen/src/main/resources/go/model.mustache +++ b/modules/swagger-codegen/src/main/resources/go/model.mustache @@ -11,9 +11,7 @@ type {{{classname}}} {{^format}}{{dataType}}{{/format}}{{#format}}{{{format}}}{{ const ( {{#allowableValues}} {{#enumVars}} - {{^-first}} - {{/-first}} - {{name}}_{{{classname}}} {{{classname}}} = "{{{value}}}" + {{name}} {{{classname}}} = {{{value}}} {{/enumVars}} {{/allowableValues}} ){{/isEnum}}{{^isEnum}}{{#description}} diff --git a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache index 955e91e6eea..c71d5efce9a 100644 --- a/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache +++ b/modules/swagger-codegen/src/main/resources/htmlDocs/index.mustache @@ -83,7 +83,7 @@ {{#hasHeaderParams}}

Request headers

- {{#headerParam}}{{>headerParam}}{{/headerParam}} + {{#headerParams}}{{>headerParam}}{{/headerParams}}
{{/hasHeaderParams}} diff --git a/modules/swagger-codegen/src/main/resources/java-pkmst/enumClass.mustache b/modules/swagger-codegen/src/main/resources/java-pkmst/enumClass.mustache index c5c3143cb94..28a623bbbef 100644 --- a/modules/swagger-codegen/src/main/resources/java-pkmst/enumClass.mustache +++ b/modules/swagger-codegen/src/main/resources/java-pkmst/enumClass.mustache @@ -39,6 +39,6 @@ return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/java-pkmst/enumOuterClass.mustache b/modules/swagger-codegen/src/main/resources/java-pkmst/enumOuterClass.mustache index 76c2cbf5a76..197e62702e0 100644 --- a/modules/swagger-codegen/src/main/resources/java-pkmst/enumOuterClass.mustache +++ b/modules/swagger-codegen/src/main/resources/java-pkmst/enumOuterClass.mustache @@ -37,6 +37,6 @@ public enum {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum return b; } } - return null; + {{^errorOnUnknownEnum}}return null;{{/errorOnUnknownEnum}}{{#errorOnUnknownEnum}}throw new IllegalArgumentException("Unexpected value '" + text + "' for '{{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}' enum.");{{/errorOnUnknownEnum}} } } diff --git a/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache b/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache index 7d8d30fdeba..7f547ebca33 100644 --- a/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache +++ b/modules/swagger-codegen/src/main/resources/kotlin-client/infrastructure/ApiClient.kt.mustache @@ -3,6 +3,7 @@ package {{packageName}}.infrastructure import okhttp3.* import java.io.File import java.io.IOException +import java.nio.file.Files; import java.util.regex.Pattern open class ApiClient(val baseUrl: String, val baseHeaders: Map = emptyMap()) { @@ -62,16 +63,16 @@ open class ApiClient(val baseUrl: String, val baseHeaders: Map = } inline protected fun responseBody(response: Response, mediaType: String = JsonMediaType): T? { - if (response.body() == null) return null - - if (T::class.java == java.io.File::class.java) { + if(response.body() == null) return null + + if(T::class.java == java.io.File::class.java){ return downloadFileFromResponse(response) as T } else if(T::class == kotlin.Unit::class) { return kotlin.Unit as T } - + var contentType = response.headers().get("Content-Type") - + if(contentType == null) { contentType = JsonMediaType } @@ -84,7 +85,7 @@ open class ApiClient(val baseUrl: String, val baseHeaders: Map = TODO("Fill in more types!") } } - + fun isJsonMime(mime: String?): Boolean { val jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$" return mime != null && (mime.matches(jsonMime.toRegex()) || mime == "*/*") @@ -166,7 +167,7 @@ open class ApiClient(val baseUrl: String, val baseHeaders: Map = ) } } - + @Throws(IOException::class) fun downloadFileFromResponse(response: Response): File { val file = prepareDownloadFile(response) @@ -210,6 +211,6 @@ open class ApiClient(val baseUrl: String, val baseHeaders: Map = prefix = "download-" } - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); } -} \ No newline at end of file +} diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index ba70d0e903f..e0b01e1f678 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -454,7 +454,7 @@ use {{invokerPackage}}\ObjectSerializer; } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -497,7 +497,7 @@ use {{invokerPackage}}\ObjectSerializer; $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( '{{httpMethod}}', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/modules/swagger-codegen/src/main/resources/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 89fcc0c82fc..20db06822a1 100644 --- a/modules/swagger-codegen/src/main/resources/python/api.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api.mustache @@ -100,8 +100,8 @@ class {{classname}}(object): {{#allParams}} {{#required}} # verify the required parameter '{{paramName}}' is set - if ('{{paramName}}' not in params or - params['{{paramName}}'] is None): + if self.api_client.client_side_validation and ('{{paramName}}' not in params or + params['{{paramName}}'] is None): # noqa: E501 raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 {{/required}} {{/allParams}} @@ -109,35 +109,35 @@ class {{classname}}(object): {{#allParams}} {{#hasValidation}} {{#maxLength}} - if ('{{paramName}}' in params and - len(params['{{paramName}}']) > {{maxLength}}): + if self.api_client.client_side_validation and ('{{paramName}}' in params and + len(params['{{paramName}}']) > {{maxLength}}): raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 {{/maxLength}} {{#minLength}} - if ('{{paramName}}' in params and - len(params['{{paramName}}']) < {{minLength}}): + if self.api_client.client_side_validation and ('{{paramName}}' in params and + len(params['{{paramName}}']) < {{minLength}}): raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 {{/minLength}} {{#maximum}} - if '{{paramName}}' in params and params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 + if self.api_client.client_side_validation and ('{{paramName}}' in params and params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501 raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 {{/maximum}} {{#minimum}} - if '{{paramName}}' in params and params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 + if self.api_client.client_side_validation and ('{{paramName}}' in params and params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501 raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 {{/minimum}} {{#pattern}} - if '{{paramName}}' in params and not re.search(r'{{{vendorExtensions.x-regex}}}', params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + if self.api_client.client_side_validation and ('{{paramName}}' in params and not re.search(r'{{{vendorExtensions.x-regex}}}', params['{{paramName}}']{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501 raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must conform to the pattern `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} - if ('{{paramName}}' in params and - len(params['{{paramName}}']) > {{maxItems}}): + if self.api_client.client_side_validation and ('{{paramName}}' in params and + len(params['{{paramName}}']) > {{maxItems}}): raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 {{/maxItems}} {{#minItems}} - if ('{{paramName}}' in params and - len(params['{{paramName}}']) < {{minItems}}): + if self.api_client.client_side_validation and ('{{paramName}}' in params and + len(params['{{paramName}}']) < {{minItems}}): raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 {{/minItems}} {{/hasValidation}} diff --git a/modules/swagger-codegen/src/main/resources/python/api_client.mustache b/modules/swagger-codegen/src/main/resources/python/api_client.mustache index 5decd411e1d..d03ae4a0d4a 100644 --- a/modules/swagger-codegen/src/main/resources/python/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/python/api_client.mustache @@ -69,6 +69,7 @@ class ApiClient(object): self.cookie = cookie # Set default User-Agent. self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/python{{/httpUserAgent}}' + self.client_side_validation = configuration.client_side_validation def __del__(self): if self._pool is not None: @@ -539,7 +540,7 @@ class ApiClient(object): content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) - with open(path, "wb") as f: + with open(path, {{^writeBinary}}"w"{{/writeBinary}}{{#writeBinary}}"wb"{{/writeBinary}}) as f: f.write(response.data) return path diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index a2838d338e6..e76b93d6998 100644 --- a/modules/swagger-codegen/src/main/resources/python/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/python/configuration.mustache @@ -90,6 +90,9 @@ class Configuration(object): # Safe chars for path_param self.safe_chars_for_path_param = '' + # Disable client side validation + self.client_side_validation = True + @classmethod def set_default(cls, default): cls._default = default @@ -199,7 +202,7 @@ class Configuration(object): if self.refresh_api_key_hook: self.refresh_api_key_hook(self) - + key = self.api_key.get(identifier) if key: prefix = self.api_key_prefix.get(identifier) diff --git a/modules/swagger-codegen/src/main/resources/python/model.mustache b/modules/swagger-codegen/src/main/resources/python/model.mustache index 9b647633f55..c7686b57042 100644 --- a/modules/swagger-codegen/src/main/resources/python/model.mustache +++ b/modules/swagger-codegen/src/main/resources/python/model.mustache @@ -7,6 +7,8 @@ import re # noqa: F401 import six +from {{packageName}}.configuration import Configuration + {{#models}} {{#model}} @@ -50,8 +52,11 @@ class {{classname}}(object): } {{/discriminator}} - def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501 + def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}, _configuration=None): # noqa: E501 """{{classname}} - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration {{#vars}}{{#-first}} {{/-first}} self._{{name}} = None @@ -94,14 +99,15 @@ class {{classname}}(object): :type: {{datatype}} """ {{#required}} - if {{name}} is None: + if self._configuration.client_side_validation and {{name}} is None: raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 {{/required}} {{#isEnum}} {{#isContainer}} allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 {{#isListContainer}} - if not set({{{name}}}).issubset(set(allowed_values)): + if (self._configuration.client_side_validation and + not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501 raise ValueError( "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 @@ -109,7 +115,8 @@ class {{classname}}(object): ) {{/isListContainer}} {{#isMapContainer}} - if not set({{{name}}}.keys()).issubset(set(allowed_values)): + if (self._configuration.client_side_validation and + not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501 raise ValueError( "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501 @@ -119,7 +126,8 @@ class {{classname}}(object): {{/isContainer}} {{^isContainer}} allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^-last}}, {{/-last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if {{{name}}} not in allowed_values: + if (self._configuration.client_side_validation and + {{{name}}} not in allowed_values): raise ValueError( "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 .format({{{name}}}, allowed_values) @@ -129,31 +137,38 @@ class {{classname}}(object): {{^isEnum}} {{#hasValidation}} {{#maxLength}} - if {{name}} is not None and len({{name}}) > {{maxLength}}: + if (self._configuration.client_side_validation and + {{name}} is not None and len({{name}}) > {{maxLength}}): raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 {{/maxLength}} {{#minLength}} - if {{name}} is not None and len({{name}}) < {{minLength}}: + if (self._configuration.client_side_validation and + {{name}} is not None and len({{name}}) < {{minLength}}): raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 {{/minLength}} {{#maximum}} - if {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}: # noqa: E501 + if (self._configuration.client_side_validation and + {{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501 raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 {{/maximum}} {{#minimum}} - if {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}: # noqa: E501 + if (self._configuration.client_side_validation and + {{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501 raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 {{/minimum}} {{#pattern}} - if {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}}): # noqa: E501 + if (self._configuration.client_side_validation and + {{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#-first}}, flags={{/-first}}re.{{.}}{{^-last}} | {{/-last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501 raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 {{/pattern}} {{#maxItems}} - if {{name}} is not None and len({{name}}) > {{maxItems}}: + if (self._configuration.client_side_validation and + {{name}} is not None and len({{name}}) > {{maxItems}}): raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 {{/maxItems}} {{#minItems}} - if {{name}} is not None and len({{name}}) < {{minItems}}: + if (self._configuration.client_side_validation and + {{name}} is not None and len({{name}}) < {{minItems}}): raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 {{/minItems}} {{/hasValidation}} @@ -209,10 +224,13 @@ class {{classname}}(object): if not isinstance(other, {{classname}}): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, {{classname}}): + return True + + return self.to_dict() != other.to_dict() {{/model}} {{/models}} diff --git a/modules/swagger-codegen/src/main/resources/python/rest.mustache b/modules/swagger-codegen/src/main/resources/python/rest.mustache index ff9b019dc58..6c5dd3f2b69 100644 --- a/modules/swagger-codegen/src/main/resources/python/rest.mustache +++ b/modules/swagger-codegen/src/main/resources/python/rest.mustache @@ -147,7 +147,7 @@ class RESTClientObject(object): if query_params: url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None + request_body = '{}' if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( diff --git a/modules/swagger-codegen/src/main/resources/r/NAMESPACE.mustache b/modules/swagger-codegen/src/main/resources/r/NAMESPACE.mustache index 0fe95acd6df..c7ee82a7ae8 100644 --- a/modules/swagger-codegen/src/main/resources/r/NAMESPACE.mustache +++ b/modules/swagger-codegen/src/main/resources/r/NAMESPACE.mustache @@ -6,3 +6,9 @@ export({{{classname}}}) {{/model}} {{/models}} +{{#apiInfo}} +{{#apis}} +export({{{classname}}}) +{{/apis}} +{{/apiInfo}} +export(ApiClient) \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ruby/Gemfile.mustache b/modules/swagger-codegen/src/main/resources/ruby/Gemfile.mustache index d255a3ab238..f58bec06367 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/Gemfile.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/Gemfile.mustache @@ -3,5 +3,5 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rake', '~> 12.0.0' + gem 'rake', '~> 12.3.3' end diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache index c7a23c0243c..d2b08a3933d 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_client.mustache @@ -7,7 +7,7 @@ require 'json' require 'logger' require 'tempfile' require 'typhoeus' -require 'uri' +require 'addressable/uri' module {{moduleName}} class ApiClient @@ -55,7 +55,7 @@ module {{moduleName}} :message => response.return_message) else fail ApiError.new(:code => response.code, - :response_headers => response.headers, + :response_headers => response.headers.to_h, :response_body => response.body), response.status_message end @@ -106,6 +106,8 @@ module {{moduleName}} :verbose => @config.debugging } + req_opts.merge!(multipart: true) if header_params['Content-Type'].start_with? "multipart/" + # set custom cert, if provided req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert @@ -258,7 +260,7 @@ module {{moduleName}} def build_request_url(path) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - URI.encode(@config.base_url + path) + Addressable::URI.encode(@config.base_url + path) end # Builds the HTTP request body diff --git a/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache b/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache index b887b92f31a..4291fc60509 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/api_client_spec.mustache @@ -81,6 +81,23 @@ describe {{moduleName}}::ApiClient do end end + describe '#build_request' do + let(:config) { {{moduleName}}::Configuration.new } + let(:api_client) { {{moduleName}}::ApiClient.new(config) } + + it 'does not send multipart to request' do + expect(Typhoeus::Request).to receive(:new).with(anything, hash_not_including(:multipart)) + api_client.build_request(:get, '/test') + end + + context 'when the content type is multipart' do + it 'sends multipart to request' do + expect(Typhoeus::Request).to receive(:new).with(anything, hash_including(multipart: true)) + api_client.build_request(:get, '/test', {header_params: { 'Content-Type' => 'multipart/form-data'}}) + end + end + end + describe '#deserialize' do it "handles Array" do api_client = {{moduleName}}::ApiClient.new diff --git a/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache b/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache index 10b51530eed..7fe359a0b07 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/base_object.mustache @@ -5,7 +5,7 @@ return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -100,4 +100,4 @@ else value end - end \ No newline at end of file + end diff --git a/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache b/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache index 7c7e1d82dc5..e1dd752acff 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/configuration.mustache @@ -2,7 +2,7 @@ {{> api_info}} =end -require 'uri' +require 'addressable/uri' module {{moduleName}} class Configuration @@ -167,7 +167,7 @@ module {{moduleName}} def base_url url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - URI.encode(url) + Addressable::URI.encode(url) end # Gets API key (with prefix if set). diff --git a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache index b17260ca527..3da9d99277a 100644 --- a/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache +++ b/modules/swagger-codegen/src/main/resources/ruby/gemspec.mustache @@ -26,6 +26,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' diff --git a/modules/swagger-codegen/src/main/resources/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index 5cfa0e2f198..14eea6ed272 100644 --- a/modules/swagger-codegen/src/main/resources/scala/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/scala/pom.mustache @@ -240,12 +240,12 @@ 1.9.2 2.9.9 1.19.4 - 1.5.18 + 1.5.24 1.0.5 1.0.0 2.9.2 - 4.12 + 4.13.1 3.1.5 3.0.4 0.3.5 diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/APIHelper.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/APIHelper.mustache new file mode 100644 index 00000000000..81e7286d6d4 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/APIHelper.mustache @@ -0,0 +1,65 @@ +// APIHelper.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +public struct APIHelper { + public static func rejectNil(_ source: [String:Any?]) -> [String:Any]? { + let destination = source.reduce(into: [String: Any]()) { (result, item) in + if let value = item.value { + result[item.key] = value + } + } + + if destination.isEmpty { + return nil + } + return destination + } + + public static func rejectNilHeaders(_ source: [String:Any?]) -> [String:String] { + return source.reduce(into: [String: String]()) { (result, item) in + if let collection = item.value as? Array { + result[item.key] = collection.filter({ $0 != nil }).map{ "\($0!)" }.joined(separator: ",") + } else if let value: Any = item.value { + result[item.key] = "\(value)" + } + } + } + + public static func convertBoolToString(_ source: [String: Any]?) -> [String:Any]? { + guard let source = source else { + return nil + } + + return source.reduce(into: [String: Any](), { (result, item) in + switch item.value { + case let x as Bool: + result[item.key] = x.description + default: + result[item.key] = item.value + } + }) + } + + + public static func mapValuesToQueryItems(_ source: [String:Any?]) -> [URLQueryItem]? { + let destination = source.filter({ $0.value != nil}).reduce(into: [URLQueryItem]()) { (result, item) in + if let collection = item.value as? Array { + let value = collection.filter({ $0 != nil }).map({"\($0!)"}).joined(separator: ",") + result.append(URLQueryItem(name: item.key, value: value)) + } else if let value = item.value { + result.append(URLQueryItem(name: item.key, value: "\(value)")) + } + } + + if destination.isEmpty { + return nil + } + return destination + } +} + diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/APIs.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/APIs.mustache new file mode 100644 index 00000000000..f96d56963e7 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/APIs.mustache @@ -0,0 +1,61 @@ +// APIs.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class {{projectName}}API { + public static var basePath = "{{{basePath}}}" + public static var credential: URLCredential? + public static var customHeaders: [String:String] = [:] + public static var requestBuilderFactory: RequestBuilderFactory = AlamofireRequestBuilderFactory() +} + +open class RequestBuilder { + var credential: URLCredential? + var headers: [String:String] + public let parameters: [String:Any]? + public let isBody: Bool + public let method: String + public let URLString: String + + /// Optional block to obtain a reference to the request's progress instance when available. + public var onProgressReady: ((Progress) -> ())? + + required public init(method: String, URLString: String, parameters: [String:Any]?, isBody: Bool, headers: [String:String] = [:]) { + self.method = method + self.URLString = URLString + self.parameters = parameters + self.isBody = isBody + self.headers = headers + + addHeaders({{projectName}}API.customHeaders) + } + + open func addHeaders(_ aHeaders:[String:String]) { + for (header, value) in aHeaders { + headers[header] = value + } + } + + open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { } + + public func addHeader(name: String, value: String) -> Self { + if !value.isEmpty { + headers[name] = value + } + return self + } + + open func addCredential() -> Self { + self.credential = {{projectName}}API.credential + return self + } +} + +public protocol RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type + func getBuilder() -> RequestBuilder.Type +} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/AlamofireImplementations.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/AlamofireImplementations.mustache new file mode 100644 index 00000000000..f072650e79d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/AlamofireImplementations.mustache @@ -0,0 +1,422 @@ +// AlamofireImplementations.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + +class AlamofireRequestBuilderFactory: RequestBuilderFactory { + func getNonDecodableBuilder() -> RequestBuilder.Type { + return AlamofireRequestBuilder.self + } + + func getBuilder() -> RequestBuilder.Type { + return AlamofireDecodableRequestBuilder.self + } +} + +// Store manager to retain its reference +private var managerStore: [String: Alamofire.SessionManager] = [:] + +// Sync queue to manage safe access to the store manager +private let syncQueue = DispatchQueue(label: "thread-safe-sync-queue", attributes: .concurrent) + +open class AlamofireRequestBuilder: RequestBuilder { + required public init(method: String, URLString: String, parameters: [String : Any]?, isBody: Bool, headers: [String : String] = [:]) { + super.init(method: method, URLString: URLString, parameters: parameters, isBody: isBody, headers: headers) + } + + /** + May be overridden by a subclass if you want to control the session + configuration. + */ + open func createSessionManager() -> Alamofire.SessionManager { + let configuration = URLSessionConfiguration.default + configuration.httpAdditionalHeaders = buildHeaders() + return Alamofire.SessionManager(configuration: configuration) + } + + /** + May be overridden by a subclass if you want to control the Content-Type + that is given to an uploaded form part. + + Return nil to use the default behavior (inferring the Content-Type from + the file extension). Return the desired Content-Type otherwise. + */ + open func contentTypeForFormPart(fileURL: URL) -> String? { + return nil + } + + /** + May be overridden by a subclass if you want to control the request + configuration (e.g. to override the cache policy). + */ + open func makeRequest(manager: SessionManager, method: HTTPMethod, encoding: ParameterEncoding, headers: [String:String]) -> DataRequest { + return manager.request(URLString, method: method, parameters: parameters, encoding: encoding, headers: headers) + } + + override open func execute(_ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + let managerId:String = UUID().uuidString + // Create a new manager for each request to customize its request header + let manager = createSessionManager() + syncQueue.async(flags: .barrier) { + managerStore[managerId] = manager + } + + let encoding:ParameterEncoding = isBody ? JSONDataEncoding() : URLEncoding() + + let xMethod = Alamofire.HTTPMethod(rawValue: method) + let fileKeys = parameters == nil ? [] : parameters!.filter { $1 is NSURL } + .map { $0.0 } + + if fileKeys.count > 0 { + manager.upload(multipartFormData: { mpForm in + for (k, v) in self.parameters! { + switch v { + case let fileURL as URL: + if let mimeType = self.contentTypeForFormPart(fileURL: fileURL) { + mpForm.append(fileURL, withName: k, fileName: fileURL.lastPathComponent, mimeType: mimeType) + } + else { + mpForm.append(fileURL, withName: k) + } + case let string as String: + mpForm.append(string.data(using: String.Encoding.utf8)!, withName: k) + case let number as NSNumber: + mpForm.append(number.stringValue.data(using: String.Encoding.utf8)!, withName: k) + default: + fatalError("Unprocessable value \(v) with key \(k)") + } + } + }, to: URLString, method: xMethod!, headers: nil, encodingCompletion: { encodingResult in + switch encodingResult { + case .success(let upload, _, _): + if let onProgressReady = self.onProgressReady { + onProgressReady(upload.uploadProgress) + } + self.processRequest(request: upload, managerId, completion) + case .failure(let encodingError): + completion(nil, ErrorResponse.error(415, nil, encodingError)) + } + }) + } else { + let request = makeRequest(manager: manager, method: xMethod!, encoding: encoding, headers: headers) + if let onProgressReady = self.onProgressReady { + onProgressReady(request.progress) + } + processRequest(request: request, managerId, completion) + } + + } + + fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + syncQueue.async(flags: .barrier) { + _ = managerStore.removeValue(forKey: managerId) + } + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is URL.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + do { + + guard !dataResponse.result.isFailure else { + throw DownloadException.responseFailed + } + + guard let data = dataResponse.data else { + throw DownloadException.responseDataMissing + } + + guard let request = request.request else { + throw DownloadException.requestMissing + } + + let fileManager = FileManager.default + let urlRequest = try request.asURLRequest() + let documentsDirectory = fileManager.urls(for: .documentDirectory, in: .userDomainMask)[0] + let requestURL = try self.getURL(from: urlRequest) + + var requestPath = try self.getPath(from: requestURL) + + if let headerFileName = self.getFileName(fromContentDisposition: dataResponse.response?.allHeaderFields["Content-Disposition"] as? String) { + requestPath = requestPath.appending("/\(headerFileName)") + } + + let filePath = documentsDirectory.appendingPathComponent(requestPath) + let directoryPath = filePath.deletingLastPathComponent().path + + try fileManager.createDirectory(atPath: directoryPath, withIntermediateDirectories: true, attributes: nil) + try data.write(to: filePath, options: .atomic) + + completion( + Response( + response: dataResponse.response!, + body: (filePath as! T) + ), + nil + ) + + } catch let requestParserError as DownloadException { + completion(nil, ErrorResponse.error(400, dataResponse.data, requestParserError)) + } catch let error { + completion(nil, ErrorResponse.error(400, dataResponse.data, error)) + } + return + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + } + } + + open func buildHeaders() -> [String: String] { + var httpHeaders = SessionManager.defaultHTTPHeaders + for (key, value) in self.headers { + httpHeaders[key] = value + } + return httpHeaders + } + + fileprivate func getFileName(fromContentDisposition contentDisposition : String?) -> String? { + + guard let contentDisposition = contentDisposition else { + return nil + } + + let items = contentDisposition.components(separatedBy: ";") + + var filename : String? = nil + + for contentItem in items { + + let filenameKey = "filename=" + guard let range = contentItem.range(of: filenameKey) else { + break + } + + filename = contentItem + return filename? + .replacingCharacters(in: range, with:"") + .replacingOccurrences(of: "\"", with: "") + .trimmingCharacters(in: .whitespacesAndNewlines) + } + + return filename + + } + + fileprivate func getPath(from url : URL) throws -> String { + + guard var path = URLComponents(url: url, resolvingAgainstBaseURL: true)?.path else { + throw DownloadException.requestMissingPath + } + + if path.hasPrefix("/") { + path.remove(at: path.startIndex) + } + + return path + + } + + fileprivate func getURL(from urlRequest : URLRequest) throws -> URL { + + guard let url = urlRequest.url else { + throw DownloadException.requestMissingURL + } + + return url + } + +} + +fileprivate enum DownloadException : Error { + case responseDataMissing + case responseFailed + case requestMissing + case requestMissingPath + case requestMissingURL +} + +public enum AlamofireDecodableRequestBuilderError: Error { + case emptyDataResponse + case nilHTTPResponse + case jsonDecoding(DecodingError) + case generalError(Error) +} + +open class AlamofireDecodableRequestBuilder: AlamofireRequestBuilder { + + override fileprivate func processRequest(request: DataRequest, _ managerId: String, _ completion: @escaping (_ response: Response?, _ error: Error?) -> Void) { + if let credential = self.credential { + request.authenticate(usingCredential: credential) + } + + let cleanupRequest = { + syncQueue.async(flags: .barrier) { + _ = managerStore.removeValue(forKey: managerId) + } + } + + let validatedRequest = request.validate() + + switch T.self { + case is String.Type: + validatedRequest.responseString(completionHandler: { (stringResponse) in + cleanupRequest() + + if stringResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(stringResponse.response?.statusCode ?? 500, stringResponse.data, stringResponse.result.error!) + ) + return + } + + completion( + Response( + response: stringResponse.response!, + body: ((stringResponse.result.value ?? "") as! T) + ), + nil + ) + }) + case is Void.Type: + validatedRequest.responseData(completionHandler: { (voidResponse) in + cleanupRequest() + + if voidResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(voidResponse.response?.statusCode ?? 500, voidResponse.data, voidResponse.result.error!) + ) + return + } + + completion( + Response( + response: voidResponse.response!, + body: nil), + nil + ) + }) + case is Data.Type: + validatedRequest.responseData(completionHandler: { (dataResponse) in + cleanupRequest() + + if dataResponse.result.isFailure { + completion( + nil, + ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!) + ) + return + } + + completion( + Response( + response: dataResponse.response!, + body: (dataResponse.data as! T) + ), + nil + ) + }) + default: + validatedRequest.responseData(completionHandler: { (dataResponse: DataResponse) in + cleanupRequest() + + guard dataResponse.result.isSuccess else { + completion(nil, ErrorResponse.error(dataResponse.response?.statusCode ?? 500, dataResponse.data, dataResponse.result.error!)) + return + } + + guard let data = dataResponse.data, !data.isEmpty else { + completion(nil, ErrorResponse.error(-1, nil, AlamofireDecodableRequestBuilderError.emptyDataResponse)) + return + } + + guard let httpResponse = dataResponse.response else { + completion(nil, ErrorResponse.error(-2, nil, AlamofireDecodableRequestBuilderError.nilHTTPResponse)) + return + } + + var responseObj: Response? = nil + + let decodeResult: (decodableObj: T?, error: Error?) = CodableHelper.decode(T.self, from: data) + if decodeResult.error == nil { + responseObj = Response(response: httpResponse, body: decodeResult.decodableObj) + } + + completion(responseObj, decodeResult.error) + }) + } + } + +} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Cartfile.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Cartfile.mustache new file mode 100644 index 00000000000..f71be5049a5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Cartfile.mustache @@ -0,0 +1,3 @@ +github "Alamofire/Alamofire" ~> 4.9.0{{#usePromiseKit}} +github "mxcl/PromiseKit" ~> 4.4{{/usePromiseKit}}{{#useRxSwift}} +github "ReactiveX/RxSwift" ~> 4.0{{/useRxSwift}} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/CodableHelper.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/CodableHelper.mustache new file mode 100644 index 00000000000..c3039419df0 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/CodableHelper.mustache @@ -0,0 +1,93 @@ +// +// CodableHelper.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +public typealias EncodeResult = (data: Data?, error: Error?) + +enum DateError: String, Error { + case invalidDate +} + +open class CodableHelper { + + public static var dateformatter: DateFormatter? + + open class func decode(_ type: T.Type, from data: Data) -> (decodableObj: T?, error: Error?) where T : Decodable { + var returnedDecodable: T? = nil + var returnedError: Error? = nil + + let decoder = JSONDecoder() + + if let df = self.dateformatter { + decoder.dateDecodingStrategy = .formatted(df) + } else { + decoder.dataDecodingStrategy = .base64 + decoder.dateDecodingStrategy = .custom({ (decoder) -> Date in + let container = try decoder.singleValueContainer() + let dateStr = try container.decode(String.self) + + let formatters = [ + "yyyy-MM-dd", + "yyyy-MM-dd'T'HH:mm:ssZZZZZ", + "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ", + "yyyy-MM-dd'T'HH:mm:ss'Z'", + "yyyy-MM-dd'T'HH:mm:ss.SSS", + "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", + "yyyy-MM-dd HH:mm:ss" + ].map { (format: String) -> DateFormatter in + let formatter = DateFormatter() + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.dateFormat = format + return formatter + } + + for formatter in formatters { + + if let date = formatter.date(from: dateStr) { + return date + } + } + + throw DateError.invalidDate + }) + } + + do { + returnedDecodable = try decoder.decode(type, from: data) + } catch { + returnedError = error + } + + return (returnedDecodable, returnedError) + } + + open class func encode(_ value: T, prettyPrint: Bool = false) -> EncodeResult where T : Encodable { + var returnedData: Data? + var returnedError: Error? = nil + + let encoder = JSONEncoder() + if prettyPrint { + encoder.outputFormatting = .prettyPrinted + } + encoder.dataEncodingStrategy = .base64 + let formatter = DateFormatter() + formatter.calendar = Calendar(identifier: .iso8601) + formatter.locale = Locale(identifier: "en_US_POSIX") + formatter.timeZone = TimeZone(secondsFromGMT: 0) + formatter.dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX" + encoder.dateEncodingStrategy = .formatted(formatter) + + do { + returnedData = try encoder.encode(value) + } catch { + returnedError = error + } + + return (returnedData, returnedError) + } +} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Configuration.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Configuration.mustache new file mode 100644 index 00000000000..139bced0521 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Configuration.mustache @@ -0,0 +1,15 @@ +// Configuration.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +open class Configuration { + + // This value is used to configure the date formatter that is used to serialize dates into JSON format. + // You must set it prior to encoding any dates, and it will only be read once. + public static var dateFormat = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZZZ" + +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Extensions.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Extensions.mustache new file mode 100644 index 00000000000..d5a43b407de --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Extensions.mustache @@ -0,0 +1,186 @@ +// Extensions.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire{{#usePromiseKit}} +import PromiseKit{{/usePromiseKit}} + +extension Bool: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Float: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension Int32: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int32) } +} + +extension Int64: JSONEncodable { + func encodeToJSON() -> Any { return NSNumber(value: self as Int64) } +} + +extension Double: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +extension String: JSONEncodable { + func encodeToJSON() -> Any { return self as Any } +} + +private func encodeIfPossible(_ object: T) -> Any { + if let encodableObject = object as? JSONEncodable { + return encodableObject.encodeToJSON() + } else { + return object as Any + } +} + +extension Array: JSONEncodable { + func encodeToJSON() -> Any { + return self.map(encodeIfPossible) + } +} + +extension Dictionary: JSONEncodable { + func encodeToJSON() -> Any { + var dictionary = [AnyHashable: Any]() + for (key, value) in self { + dictionary[key] = encodeIfPossible(value) + } + return dictionary as Any + } +} + +extension Data: JSONEncodable { + func encodeToJSON() -> Any { + return self.base64EncodedString(options: Data.Base64EncodingOptions()) + } +} + +private let dateFormatter: DateFormatter = { + let fmt = DateFormatter() + fmt.dateFormat = Configuration.dateFormat + fmt.locale = Locale(identifier: "en_US_POSIX") + return fmt +}() + +extension Date: JSONEncodable { + func encodeToJSON() -> Any { + return dateFormatter.string(from: self) as Any + } +} + +extension UUID: JSONEncodable { + func encodeToJSON() -> Any { + return self.uuidString + } +} + +extension String: CodingKey { + + public var stringValue: String { + return self + } + + public init?(stringValue: String) { + self.init(stringLiteral: stringValue) + } + + public var intValue: Int? { + return nil + } + + public init?(intValue: Int) { + return nil + } + +} + +extension KeyedEncodingContainerProtocol { + + public mutating func encodeArray(_ values: [T], forKey key: Self.Key) throws where T : Encodable { + var arrayContainer = nestedUnkeyedContainer(forKey: key) + try arrayContainer.encode(contentsOf: values) + } + + public mutating func encodeArrayIfPresent(_ values: [T]?, forKey key: Self.Key) throws where T : Encodable { + if let values = values { + try encodeArray(values, forKey: key) + } + } + + public mutating func encodeMap(_ pairs: [Self.Key: T]) throws where T : Encodable { + for (key, value) in pairs { + try encode(value, forKey: key) + } + } + + public mutating func encodeMapIfPresent(_ pairs: [Self.Key: T]?) throws where T : Encodable { + if let pairs = pairs { + try encodeMap(pairs) + } + } + +} + +extension KeyedDecodingContainerProtocol { + + public func decodeArray(_ type: T.Type, forKey key: Self.Key) throws -> [T] where T : Decodable { + var tmpArray = [T]() + + var nestedContainer = try nestedUnkeyedContainer(forKey: key) + while !nestedContainer.isAtEnd { + let arrayValue = try nestedContainer.decode(T.self) + tmpArray.append(arrayValue) + } + + return tmpArray + } + + public func decodeArrayIfPresent(_ type: T.Type, forKey key: Self.Key) throws -> [T]? where T : Decodable { + var tmpArray: [T]? = nil + + if contains(key) { + tmpArray = try decodeArray(T.self, forKey: key) + } + + return tmpArray + } + + public func decodeMap(_ type: T.Type, excludedKeys: Set) throws -> [Self.Key: T] where T : Decodable { + var map: [Self.Key : T] = [:] + + for key in allKeys { + if !excludedKeys.contains(key) { + let value = try decode(T.self, forKey: key) + map[key] = value + } + } + + return map + } + +} + +{{#usePromiseKit}}extension RequestBuilder { + public func execute() -> Promise> { + let deferred = Promise>.pending() + self.execute { (response: Response?, error: Error?) in + if let response = response { + deferred.fulfill(response) + } else { + deferred.reject(error!) + } + } + return deferred.promise + } +}{{/usePromiseKit}} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONEncodableEncoding.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONEncodableEncoding.mustache new file mode 100644 index 00000000000..472e955ee8e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONEncodableEncoding.mustache @@ -0,0 +1,54 @@ +// +// JSONDataEncoding.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + +public struct JSONDataEncoding: ParameterEncoding { + + // MARK: Properties + + private static let jsonDataKey = "jsonData" + + // MARK: Encoding + + /// Creates a URL request by encoding parameters and applying them onto an existing request. + /// + /// - parameter urlRequest: The request to have parameters applied. + /// - parameter parameters: The parameters to apply. This should have a single key/value + /// pair with "jsonData" as the key and a Data object as the value. + /// + /// - throws: An `Error` if the encoding process encounters an error. + /// + /// - returns: The encoded request. + public func encode(_ urlRequest: URLRequestConvertible, with parameters: Parameters?) throws -> URLRequest { + var urlRequest = try urlRequest.asURLRequest() + + guard let jsonData = parameters?[JSONDataEncoding.jsonDataKey] as? Data, !jsonData.isEmpty else { + return urlRequest + } + + if urlRequest.value(forHTTPHeaderField: "Content-Type") == nil { + urlRequest.setValue("application/json", forHTTPHeaderField: "Content-Type") + } + + urlRequest.httpBody = jsonData + + return urlRequest + } + + public static func encodingParameters(jsonData: Data?) -> Parameters? { + var returnedParams: Parameters? = nil + if let jsonData = jsonData, !jsonData.isEmpty { + var params = Parameters() + params[jsonDataKey] = jsonData + returnedParams = params + } + return returnedParams + } + +} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONEncodingHelper.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONEncodingHelper.mustache new file mode 100644 index 00000000000..19ee06b1f48 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONEncodingHelper.mustache @@ -0,0 +1,43 @@ +// +// JSONEncodingHelper.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire + +open class JSONEncodingHelper { + + open class func encodingParameters(forEncodableObject encodableObj: T?) -> Parameters? { + var params: Parameters? = nil + + // Encode the Encodable object + if let encodableObj = encodableObj { + let encodeResult = CodableHelper.encode(encodableObj, prettyPrint: true) + if encodeResult.error == nil { + params = JSONDataEncoding.encodingParameters(jsonData: encodeResult.data) + } + } + + return params + } + + open class func encodingParameters(forEncodableObject encodableObj: Any?) -> Parameters? { + var params: Parameters? = nil + + if let encodableObj = encodableObj { + do { + let data = try JSONSerialization.data(withJSONObject: encodableObj, options: .prettyPrinted) + params = JSONDataEncoding.encodingParameters(jsonData: data) + } catch { + print(error) + return nil + } + } + + return params + } + +} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONValue.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONValue.mustache new file mode 100644 index 00000000000..21a93ac8bb4 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/JSONValue.mustache @@ -0,0 +1,99 @@ +// +// JSONEncodingHelper.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +public enum JSONValue: Codable, Equatable { + case string(String) + case int(Int) + case double(Double) + case bool(Bool) + case object([String: JSONValue]) + case array([JSONValue]) + case null + + public func encode(to encoder: Encoder) throws { + var container = encoder.singleValueContainer() + switch self { + case .string(let string): try container.encode(string) + case .int(let int): try container.encode(int) + case .double(let double): try container.encode(double) + case .bool(let bool): try container.encode(bool) + case .object(let object): try container.encode(object) + case .array(let array): try container.encode(array) + case .null: try container.encode(Optional.none) + } + } + + public init(from decoder: Decoder) throws { + let container = try decoder.singleValueContainer() + self = try ((try? container.decode(String.self)).map(JSONValue.string)) + .or((try? container.decode(Int.self)).map(JSONValue.int)) + .or((try? container.decode(Double.self)).map(JSONValue.double)) + .or((try? container.decode(Bool.self)).map(JSONValue.bool)) + .or((try? container.decode([String: JSONValue].self)).map(JSONValue.object)) + .or((try? container.decode([JSONValue].self)).map(JSONValue.array)) + .or((container.decodeNil() ? .some(JSONValue.null) : .none)) + .resolve( + with: DecodingError.typeMismatch( + JSONValue.self, + DecodingError.Context( + codingPath: container.codingPath, + debugDescription: "Not a JSON value" + ) + ) + ) + } + +} + +extension JSONValue: ExpressibleByStringLiteral { + public init(stringLiteral value: String) { + self = .string(value) + } +} +extension JSONValue: ExpressibleByIntegerLiteral { + public init(integerLiteral value: Int) { + self = .int(value) + } +} +extension JSONValue: ExpressibleByFloatLiteral { + public init(floatLiteral value: Double) { + self = .double(value) + } +} +extension JSONValue: ExpressibleByBooleanLiteral { + public init(booleanLiteral value: Bool) { + self = .bool(value) + } +} +extension JSONValue: ExpressibleByDictionaryLiteral { + public init(dictionaryLiteral elements: (String, JSONValue)...) { + self = .object([String: JSONValue](uniqueKeysWithValues: elements)) + } +} +extension JSONValue: ExpressibleByArrayLiteral { + public init(arrayLiteral elements: JSONValue...) { + self = .array(elements) + } +} + +fileprivate extension Optional { + func or(_ other: Optional) -> Optional { + switch self { + case .none: return other + case .some: return self + } + } + func resolve(with error: @autoclosure () -> Error) throws -> Wrapped { + switch self { + case .none: throw error() + case .some(let wrapped): return wrapped + } + } +} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Models.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Models.mustache new file mode 100644 index 00000000000..d7dfe637dfc --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Models.mustache @@ -0,0 +1,36 @@ +// Models.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +protocol JSONEncodable { + func encodeToJSON() -> Any +} + +public enum ErrorResponse : Error { + case error(Int, Data?, Error) +} + +open class Response { + public let statusCode: Int + public let header: [String: String] + public let body: T? + + public init(statusCode: Int, header: [String: String], body: T?) { + self.statusCode = statusCode + self.header = header + self.body = body + } + + public convenience init(response: HTTPURLResponse, body: T?) { + let rawHeader = response.allHeaderFields + var header = [String:String]() + for case let (key, value) as (String, String) in rawHeader { + header[key] = value + } + self.init(statusCode: response.statusCode, header: header, body: body) + } +} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Podspec.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Podspec.mustache new file mode 100644 index 00000000000..855f1c96a74 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/Podspec.mustache @@ -0,0 +1,22 @@ +Pod::Spec.new do |s| + s.name = '{{projectName}}'{{#projectDescription}} + s.summary = '{{projectDescription}}'{{/projectDescription}} + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.11' + s.tvos.deployment_target = '9.0' + s.version = '{{#podVersion}}{{podVersion}}{{/podVersion}}{{^podVersion}}0.0.1{{/podVersion}}' + s.source = {{#podSource}}{{& podSource}}{{/podSource}}{{^podSource}}{ :git => 'git@github.com:swagger-api/swagger-mustache.git', :tag => 'v1.0.0' }{{/podSource}}{{#podAuthors}} + s.authors = '{{podAuthors}}'{{/podAuthors}}{{#podSocialMediaURL}} + s.social_media_url = '{{podSocialMediaURL}}'{{/podSocialMediaURL}}{{#podDocsetURL}} + s.docset_url = '{{podDocsetURL}}'{{/podDocsetURL}} + s.license = {{#podLicense}}{{& podLicense}}{{/podLicense}}{{^podLicense}}'Proprietary'{{/podLicense}}{{#podHomepage}} + s.homepage = '{{podHomepage}}'{{/podHomepage}}{{#podSummary}} + s.summary = '{{podSummary}}'{{/podSummary}}{{#podDescription}} + s.description = '{{podDescription}}'{{/podDescription}}{{#podScreenshots}} + s.screenshots = {{& podScreenshots}}{{/podScreenshots}}{{#podDocumentationURL}} + s.documentation_url = '{{podDocumentationURL}}'{{/podDocumentationURL}} + s.source_files = '{{projectName}}/Classes/**/*.swift'{{#usePromiseKit}} + s.dependency 'PromiseKit/CorePromise', '~> 4.4.0'{{/usePromiseKit}}{{#useRxSwift}} + s.dependency 'RxSwift', '~> 4.0'{{/useRxSwift}} + s.dependency 'Alamofire', '~> 4.9.0' +end diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/README.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/README.mustache new file mode 100644 index 00000000000..4faf1ea04a9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/README.mustache @@ -0,0 +1,66 @@ +# Swift5-ProtocolOriented API client for {{packageName}} + +{{#appDescription}} +{{{appDescription}}} +{{/appDescription}} + +## Overview +This API client was generated by the [swagger-codegen](https://github.com/swagger-api/swagger-codegen) project. By using the [swagger-spec](https://github.com/swagger-api/swagger-spec) from a remote server, you can easily generate an API client. +What is [Protocol-Oriented Programing](https://en.wikipedia.org/wiki/Protocol_(object-oriented_programming))? + +- API version: {{appVersion}} +- Package version: {{packageVersion}} +{{^hideGenerationTimestamp}} +- Build date: {{generatedDate}} +{{/hideGenerationTimestamp}} +- Build package: {{generatorClass}} +{{#infoUrl}} +For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) +{{/infoUrl}} + +## Installation +Put the package under your project folder and add the following in import: +``` + "./{{packageName}}" +``` + +## 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}}{{summary}}{{/summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation For Authorization + +{{^authMethods}} All endpoints do not require authorization. +{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} +{{#authMethods}}## {{{name}}} + +{{#isApiKey}}- **Type**: API key +- **API key parameter name**: {{{keyParamName}}} +- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} +{{/isApiKey}} +{{#isBasic}}- **Type**: HTTP basic authentication +{{/isBasic}} +{{#isOAuth}}- **Type**: OAuth +- **Flow**: {{{flow}}} +- **Authorization URL**: {{{authorizationUrl}}} +- **Scopes**: {{^scopes}}N/A{{/scopes}} +{{#scopes}} - **{{{scope}}}**: {{{description}}} +{{/scopes}} +{{/isOAuth}} + +{{/authMethods}} + +## Author + +{{#apiInfo}}{{#apis}}{{^hasMore}}{{infoEmail}} +{{/hasMore}}{{/apis}}{{/apiInfo}} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/_param.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/_param.mustache new file mode 100644 index 00000000000..5caacbc6005 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/_param.mustache @@ -0,0 +1 @@ +"{{baseName}}": {{paramName}}{{^isEnum}}{{#isInteger}}{{^required}}?{{/required}}.encodeToJSON(){{/isInteger}}{{#isLong}}{{^required}}?{{/required}}.encodeToJSON(){{/isLong}}{{/isEnum}}{{#isEnum}}{{^isContainer}}{{^required}}?{{/required}}.rawValue{{/isContainer}}{{/isEnum}}{{#isDate}}{{^required}}?{{/required}}.encodeToJSON(){{/isDate}}{{#isDateTime}}{{^required}}?{{/required}}.encodeToJSON(){{/isDateTime}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/api.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/api.mustache new file mode 100644 index 00000000000..c09287cb6ee --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/api.mustache @@ -0,0 +1,182 @@ +{{#operations}}// +// {{classname}}.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation +import Alamofire{{#usePromiseKit}} +import PromiseKit{{/usePromiseKit}}{{#useRxSwift}} +import RxSwift{{/useRxSwift}} + +{{#swiftUseApiNamespace}} +extension {{projectName}}API { +{{/swiftUseApiNamespace}} + +{{#operation}} + +{{#allParams}} + {{#isEnum}} + /** + * enum for parameter {{paramName}} + */ + public enum {{enumName}}_{{operationId}}: {{^isContainer}}{{{dataType}}}{{/isContainer}}{{#isContainer}}String{{/isContainer}} { {{#allowableValues}}{{#enumVars}} + case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}} + } + + {{/isEnum}} + {{/allParams}} + +public typealias {{operationId}}Completation = ((_ data: {{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}?,_ error: Error?) -> Void) + +public protocol {{operationId}}Protocol { + func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping {{operationId}}Completation) +} + +extension {{classname}}: {{operationId}}Protocol{ + /** + {{#summary}} + {{{summary}}} + {{/summary}}{{#allParams}} + - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + - parameter completion: completion handler to receive the data and the error objects + */ + public func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}{{#hasParams}}, {{/hasParams}}completion: @escaping {{operationId}}Completation) { + {{classname}}.{{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}).execute { (response, error) -> Void in + {{#returnType}} + completion(response?.body, error) + {{/returnType}} + {{^returnType}} + if error == nil { + completion((), error) + } else { + completion(nil, error) + } + {{/returnType}} + } + } +} +{{/operation}} + + + +{{#description}} +/** {{description}} */{{/description}} +public class {{classname}} { + +public init(){ + +} + +{{#operation}} + +{{#usePromiseKit}} + /** + {{#summary}} + {{{summary}}} + {{/summary}}{{#allParams}} + - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + - returns: Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + */ + open class func {{operationId}}({{#allParams}} {{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { + let deferred = Promise<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.pending() + {{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { data, error in + if let error = error { + deferred.reject(error) + } else { + deferred.fulfill(data!) + } + } + return deferred.promise + } +{{/usePromiseKit}} +{{#useRxSwift}} + /** + {{#summary}} + {{{summary}}} + {{/summary}}{{#allParams}} + - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + - returns: Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> + */ + open class func {{operationId}}({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> Observable<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { + return Observable.create { observer -> Disposable in + {{operationId}}({{#allParams}}{{paramName}}: {{paramName}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) { data, error in + if let error = error { + observer.on(.error(error)) + } else { + observer.on(.next(data!)) + } + observer.on(.completed) + } + return Disposables.create() + } + } +{{/useRxSwift}} + + /** + {{#summary}} + {{{summary}}} + {{/summary}} + - {{httpMethod}} {{{path}}}{{#notes}} + - {{{notes}}}{{/notes}}{{#subresourceOperation}} + - subresourceOperation: {{subresourceOperation}}{{/subresourceOperation}}{{#defaultResponse}} + - defaultResponse: {{defaultResponse}}{{/defaultResponse}}{{#authMethods}} + - {{#isBasic}}BASIC{{/isBasic}}{{#isOAuth}}OAuth{{/isOAuth}}{{#isApiKey}}API Key{{/isApiKey}}: + - type: {{type}}{{#keyParamName}} {{keyParamName}} {{#isKeyInQuery}}(QUERY){{/isKeyInQuery}}{{#isKeyInHeaer}}(HEADER){{/isKeyInHeaer}}{{/keyParamName}} + - name: {{name}}{{/authMethods}}{{#responseHeaders}} + - responseHeaders: {{responseHeaders}}{{/responseHeaders}}{{#examples}} + - examples: {{{examples}}}{{/examples}}{{#externalDocs}} + - externalDocs: {{externalDocs}}{{/externalDocs}}{{#hasParams}} + {{/hasParams}}{{#allParams}} + - parameter {{paramName}}: ({{#isFormParam}}form{{/isFormParam}}{{#isQueryParam}}query{{/isQueryParam}}{{#isPathParam}}path{{/isPathParam}}{{#isHeaderParam}}header{{/isHeaderParam}}{{#isBodyParam}}body{{/isBodyParam}}) {{description}} {{^required}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/required}}{{/allParams}} + + - returns: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> {{description}} + */ + open class func {{operationId}}WithRequestBuilder({{#allParams}}{{paramName}}: {{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}{{{datatypeWithEnum}}}_{{operationId}}{{/isContainer}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}{{^required}}? = nil{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) -> RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}> { + {{^pathParams}}let{{/pathParams}}{{#pathParams}}{{^secondaryParam}}var{{/secondaryParam}}{{/pathParams}} path = "{{{path}}}"{{#pathParams}} + let {{paramName}}PreEscape = "\({{paramName}}{{#isEnum}}{{#isContainer}}{{{dataType}}}{{/isContainer}}{{^isContainer}}.rawValue{{/isContainer}}{{/isEnum}})" + let {{paramName}}PostEscape = {{paramName}}PreEscape.addingPercentEncoding(withAllowedCharacters: .urlPathAllowed) ?? "" + path = path.replacingOccurrences(of: "{{=<% %>=}}{<%baseName%>}<%={{ }}=%>", with: {{paramName}}PostEscape, options: .literal, range: nil){{/pathParams}} + let URLString = {{projectName}}API.basePath + path + {{#bodyParam}} + let parameters = JSONEncodingHelper.encodingParameters(forEncodableObject: {{paramName}}) + {{/bodyParam}} + {{^bodyParam}} + {{#hasFormParams}} + let formParams: [String:Any?] = [ + {{#formParams}} + {{> _param}}{{#hasMore}},{{/hasMore}} + {{/formParams}} + ] + + let nonNullParameters = APIHelper.rejectNil(formParams) + let parameters = APIHelper.convertBoolToString(nonNullParameters) + {{/hasFormParams}} + {{^hasFormParams}} + let parameters: [String:Any]? = nil + {{/hasFormParams}} + {{/bodyParam}}{{#hasQueryParams}} + var url = URLComponents(string: URLString) + url?.queryItems = APIHelper.mapValuesToQueryItems([ + {{#queryParams}} + {{> _param}}{{#hasMore}}, {{/hasMore}} + {{/queryParams}} + ]){{/hasQueryParams}}{{^hasQueryParams}} + let url = URLComponents(string: URLString){{/hasQueryParams}}{{#headerParams}}{{^secondaryParam}} + let nillableHeaders: [String: Any?] = [{{/secondaryParam}} + {{> _param}}{{#hasMore}},{{/hasMore}}{{^hasMore}} + ] + let headerParameters = APIHelper.rejectNilHeaders(nillableHeaders){{/hasMore}}{{/headerParams}} + + let requestBuilder: RequestBuilder<{{#returnType}}{{{returnType}}}{{/returnType}}{{^returnType}}Void{{/returnType}}>.Type = {{projectName}}API.requestBuilderFactory.{{#returnType}}getBuilder(){{/returnType}}{{^returnType}}getNonDecodableBuilder(){{/returnType}} + + return requestBuilder.init(method: "{{httpMethod}}", URLString: (url?.string ?? URLString), parameters: parameters, isBody: {{hasBodyParam}}{{#headerParams}}{{^secondaryParam}}, headers: headerParameters{{/secondaryParam}}{{/headerParams}}) + } + +{{/operation}} +} +{{#swiftUseApiNamespace}} +} +{{/swiftUseApiNamespace}} +{{/operations}} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/git_push.sh.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/git_push.sh.mustache new file mode 100755 index 00000000000..a2d75234837 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/git_push.sh.mustache @@ -0,0 +1,52 @@ +#!/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 swagger-petstore-perl "minor update" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 + +if [ "$git_user_id" = "" ]; then + git_user_id="{{{gitUserId}}}" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="{{{gitRepoId}}}" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="{{{releaseNote}}}" + 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://github.com/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${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://github.com/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' + diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/gitignore.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/gitignore.mustache new file mode 100644 index 00000000000..5e5d5cebcf4 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/gitignore.mustache @@ -0,0 +1,63 @@ +# Xcode +# +# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore + +## Build generated +build/ +DerivedData + +## Various settings +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata + +## Other +*.xccheckout +*.moved-aside +*.xcuserstate +*.xcscmblueprint + +## Obj-C/Swift specific +*.hmap +*.ipa + +## Playgrounds +timeline.xctimeline +playground.xcworkspace + +# Swift Package Manager +# +# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies. +# Packages/ +.build/ + +# CocoaPods +# +# We recommend against adding the Pods directory to your .gitignore. However +# you should judge for yourself, the pros and cons are mentioned at: +# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control +# +# Pods/ + +# Carthage +# +# Add this line if you want to avoid checking in source code from Carthage dependencies. +# Carthage/Checkouts + +Carthage/Build + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md + +fastlane/report.xml +fastlane/screenshots diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/model.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/model.mustache new file mode 100644 index 00000000000..189acedc53d --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/model.mustache @@ -0,0 +1,25 @@ +{{#models}}{{#model}}// +// {{classname}}.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + +{{#description}} + +/** {{description}} */{{/description}} +{{#isArrayModel}} +{{> modelArray}} +{{/isArrayModel}} +{{^isArrayModel}} +{{#isEnum}} +{{> modelEnum}} +{{/isEnum}} +{{^isEnum}} +{{> modelObject}} +{{/isEnum}} +{{/isArrayModel}} +{{/model}} +{{/models}} diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelArray.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelArray.mustache new file mode 100644 index 00000000000..843626158cd --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelArray.mustache @@ -0,0 +1 @@ +public typealias {{classname}} = {{parent}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelEnum.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelEnum.mustache new file mode 100644 index 00000000000..0b5bebe0ebd --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelEnum.mustache @@ -0,0 +1,4 @@ +public enum {{classname}}: {{dataType}}, Codable { +{{#allowableValues}}{{#enumVars}} case {{name}} = "{{{value}}}" +{{/enumVars}}{{/allowableValues}} +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelInlineEnumDeclaration.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelInlineEnumDeclaration.mustache new file mode 100644 index 00000000000..c713edb31e2 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelInlineEnumDeclaration.mustache @@ -0,0 +1,3 @@ + public enum {{enumName}}: {{^isContainer}}{{datatype}}{{/isContainer}}{{#isContainer}}String{{/isContainer}}, Codable { {{#allowableValues}}{{#enumVars}} + case {{name}} = {{#isContainer}}"{{/isContainer}}{{#isString}}"{{/isString}}{{{value}}}{{#isString}}"{{/isString}}{{#isContainer}}"{{/isContainer}}{{/enumVars}}{{/allowableValues}} + } \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelObject.mustache b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelObject.mustache new file mode 100644 index 00000000000..bd142696352 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/swift5-protocol-oriented/modelObject.mustache @@ -0,0 +1,82 @@ + +public {{#useModelClasses}}class{{/useModelClasses}}{{^useModelClasses}}struct{{/useModelClasses}} {{classname}}: Codable { + +{{#allVars}} +{{#isEnum}} +{{> modelInlineEnumDeclaration}} +{{/isEnum}} +{{/allVars}} +{{#allVars}} +{{#isEnum}} + {{#description}}/** {{description}} */ + {{/description}}public var {{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}} +{{/isEnum}} +{{^isEnum}} + {{#description}}/** {{description}} */ + {{/description}}public var {{name}}: {{{datatype}}}{{^required}}?{{/required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{#objcCompatible}}{{#vendorExtensions.x-swift-optional-scalar}} + public var {{name}}Num: NSNumber? { + get { + return {{name}}.map({ return NSNumber(value: $0) }) + } + }{{/vendorExtensions.x-swift-optional-scalar}}{{/objcCompatible}} +{{/isEnum}} +{{/allVars}} + +{{#hasVars}} + public init({{#allVars}}{{name}}: {{{datatypeWithEnum}}}{{^required}}?{{/required}}{{#hasMore}}, {{/hasMore}}{{/allVars}}) { + {{#allVars}} + self.{{name}} = {{name}} + {{/allVars}} + } +{{/hasVars}} +{{#additionalPropertiesType}} + public var additionalProperties: [String:{{{additionalPropertiesType}}}] = [:] + + public subscript(key: String) -> {{{additionalPropertiesType}}}? { + get { + if let value = additionalProperties[key] { + return value + } + return nil + } + + set { + additionalProperties[key] = newValue + } + } + + // Encodable protocol methods + + public func encode(to encoder: Encoder) throws { + + var container = encoder.container(keyedBy: String.self) + + {{#allVars}} + try container.encode{{^required}}IfPresent{{/required}}({{{name}}}, forKey: "{{{baseName}}}") + {{/allVars}} + try container.encodeMap(additionalProperties) + } + + // Decodable protocol methods + + public init(from decoder: Decoder) throws { + let container = try decoder.container(keyedBy: String.self) + + {{#allVars}} + {{name}} = try container.decode{{^required}}IfPresent{{/required}}({{{datatypeWithEnum}}}.self, forKey: "{{{baseName}}}") + {{/allVars}} + var nonAdditionalPropertyKeys = Set() + {{#allVars}} + nonAdditionalPropertyKeys.insert("{{{baseName}}}") + {{/allVars}} + additionalProperties = try container.decodeMap({{{additionalPropertiesType}}}.self, excludedKeys: nonAdditionalPropertyKeys) + } + +{{/additionalPropertiesType}} +{{^additionalPropertiesType}}{{#vendorExtensions.x-codegen-has-escaped-property-names}} + public enum CodingKeys: String, CodingKey { {{#allVars}} + case {{name}}{{#vendorExtensions.x-codegen-escaped-property-name}} = "{{{baseName}}}"{{/vendorExtensions.x-codegen-escaped-property-name}}{{/allVars}} + } +{{/vendorExtensions.x-codegen-has-escaped-property-names}}{{/additionalPropertiesType}} + +} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache index 06dad036e62..2953814b3c0 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache @@ -18,7 +18,7 @@ import { {{classname}} } from './{{importPath}}'; {{/hasMore}}{{/apis}}{{/apiInfo}} ] }) export class ApiModule { - public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders { + public static forRoot(configurationFactory: () => Configuration): ModuleWithProviders{{#genericModuleWithProviders}}{{/genericModuleWithProviders}} { return { ngModule: ApiModule, providers: [ { provide: Configuration, useFactory: configurationFactory } ] diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache index 1dd20307db1..b4a04c98cb2 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/api.service.mustache @@ -197,13 +197,13 @@ export class {{classname}} { // authentication ({{name}}) required {{#isApiKey}} {{#isKeyInHeader}} - if (this.configuration.apiKeys["{{keyParamName}}"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) { {{#useHttpClient}}headers = {{/useHttpClient}}headers.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); } {{/isKeyInHeader}} {{#isKeyInQuery}} - if (this.configuration.apiKeys["{{keyParamName}}"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["{{keyParamName}}"]) { {{#useHttpClient}}queryParameters = {{/useHttpClient}}queryParameters.set('{{keyParamName}}', this.configuration.apiKeys["{{keyParamName}}"]); } @@ -262,7 +262,12 @@ export class {{classname}} { {{#hasFormParams}} const canConsumeForm = this.canConsumeForm(consumes); +{{^useHttpClient}} let formParams: { append(param: string, value: any): void; }; +{{/useHttpClient}} +{{#useHttpClient}} + let formParams: { append(param: string, value: any): void | HttpParams; }; +{{/useHttpClient}} let useForm = false; let convertFormParamsToString = false; {{#formParams}} diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/index.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/index.mustache index c312b70fa3e..d4b4725af87 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/index.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/index.mustache @@ -1,5 +1,9 @@ export * from './api/api'; +{{#models}} +{{#-first}} export * from './model/models'; +{{/-first}} +{{/models}} export * from './variables'; export * from './configuration'; export * from './api.module'; \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache index 586890a29d6..c31ad12707a 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-angular/package.mustache @@ -23,26 +23,28 @@ {{/useNgPackagr}} "peerDependencies": { "@angular/core": "^{{ngVersion}}", + {{^skipHttpImport}} "@angular/http": "^{{ngVersion}}", + {{/skipHttpImport}} "@angular/common": "^{{ngVersion}}", "@angular/compiler": "^{{ngVersion}}", - "core-js": "^2.4.0", - "reflect-metadata": "^0.1.3", - "rxjs": "{{#useRxJS6}}{{#supportedNgVersion}}~6.3.3{{/supportedNgVersion}}{{^supportedNgVersion}}^6.1.0{{/supportedNgVersion}}{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}", - "zone.js": "^0.7.6" + "rxjs": "^{{rxjsVersion}}", + "zone.js": "^{{zonejsVersion}}" }, "devDependencies": { "@angular/compiler-cli": "^{{ngVersion}}", "@angular/core": "^{{ngVersion}}", + {{^skipHttpImport}} "@angular/http": "^{{ngVersion}}", + {{/skipHttpImport}} "@angular/common": "^{{ngVersion}}", "@angular/compiler": "^{{ngVersion}}", - "@angular/platform-browser": "^{{ngVersion}}",{{#useNgPackagr}} - "ng-packagr": {{#useOldNgPackagr}}"^1.6.0"{{/useOldNgPackagr}}{{^useOldNgPackagr}}{{#supportedNgVersion}}"5.3.0"{{/supportedNgVersion}}{{^supportedNgVersion}}"^2.4.1"{{/supportedNgVersion}}{{/useOldNgPackagr}},{{/useNgPackagr}} + "@angular/platform-browser": "^{{ngVersion}}", + "ng-packagr": "^{{ngPackagrVersion}}", "reflect-metadata": "^0.1.3", - "rxjs": "{{#useRxJS6}}{{#supportedNgVersion}}~6.3.3{{/supportedNgVersion}}{{^supportedNgVersion}}^6.1.0{{/supportedNgVersion}}{{/useRxJS6}}{{^useRxJS6}}^5.4.0{{/useRxJS6}}", - "zone.js": "^0.7.6", - "typescript": ">=2.1.5 <2.8" + "rxjs": "^{{rxjsVersion}}", + "zone.js": "^{{zonejsVersion}}", + "typescript": "^{{{tsVersion}}}" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig": { diff --git a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache index d149d5ff2ee..b278963b871 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/api.mustache @@ -29,7 +29,7 @@ export interface FetchAPI { } /** - * + * * @export * @interface FetchArgs */ @@ -39,7 +39,7 @@ export interface FetchArgs { } /** - * + * * @export * @class BaseAPI */ @@ -55,7 +55,7 @@ export class BaseAPI { }; /** - * + * * @export * @class RequiredError * @extends {Error} @@ -164,7 +164,9 @@ export const {{classname}}FetchParamCreator = function (configuration?: Configur {{/isDateTime}} {{^isDateTime}} {{#isDate}} - localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any).toISOString(); + localVarQueryParameter['{{baseName}}'] = ({{paramName}} as any instanceof Date) ? + ({{paramName}} as any).toISOString().substr(0,10) : + {{paramName}}; {{/isDate}} {{^isDate}} localVarQueryParameter['{{baseName}}'] = {{paramName}}; diff --git a/modules/swagger-codegen/src/main/resources/typescript-fetch/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/package.mustache index 1eae586cf42..a7b5cbae4dd 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-fetch/package.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-fetch/package.mustache @@ -21,7 +21,7 @@ }, "devDependencies": { "@types/node": "^8.0.9", - "typescript": "^2.0" + "typescript": "^4.0.3" }{{#npmRepository}},{{/npmRepository}} {{#npmRepository}} "publishConfig":{ diff --git a/modules/swagger-codegen/src/main/resources/typescript-inversify/api.service.mustache b/modules/swagger-codegen/src/main/resources/typescript-inversify/api.service.mustache index 25958375576..50588fdcc5e 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-inversify/api.service.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-inversify/api.service.mustache @@ -1,14 +1,14 @@ {{>licenseInfo}} /* tslint:disable:no-unused-variable member-ordering */ -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/toPromise'; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; {{#imports}} import { {{classname}} } from '../{{filename}}'; @@ -34,13 +34,10 @@ export class {{classname}} implements {{classname}}Interface { {{^withInterfaces}} export class {{classname}} { {{/withInterfaces}} - private basePath: string = '{{{basePath}}}'; + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration; + @inject('IApiHttpClient') private httpClient: IHttpClient; + - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { - if(this.APIConfiguration.basePath) - this.basePath = this.APIConfiguration.basePath; - } {{#operation}} /** @@ -68,21 +65,21 @@ export class {{classname}} { if ({{paramName}}) { {{#isCollectionFormatMulti}} {{paramName}}.forEach((element) => { - queryParameters.push("{{paramName}}="+encodeURIComponent(String({{paramName}}))); + queryParameters.push('{{paramName}}='+encodeURIComponent(String({{paramName}}))); }) {{/isCollectionFormatMulti}} {{^isCollectionFormatMulti}} - queryParameters.push("{{paramName}}="+encodeURIComponent({{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']))); + queryParameters.push('{{paramName}}='+encodeURIComponent({{paramName}}.join(COLLECTION_FORMATS['{{collectionFormat}}']))); {{/isCollectionFormatMulti}} } {{/isListContainer}} {{^isListContainer}} if ({{paramName}} !== undefined) { {{#isDateTime}} - queryParameters.push("{{paramName}}="+encodeURIComponent({{paramName}}.toISOString())); + queryParameters.push('{{paramName}}='+encodeURIComponent({{paramName}}.toISOString())); {{/isDateTime}} {{^isDateTime}} - queryParameters.push("{{paramName}}="+encodeURIComponent(String({{paramName}}))); + queryParameters.push('{{paramName}}='+encodeURIComponent(String({{paramName}}))); {{/isDateTime}} } {{/isListContainer}} @@ -106,13 +103,13 @@ export class {{classname}} { // authentication ({{name}}) required {{#isApiKey}} {{#isKeyInHeader}} - if (this.APIConfiguration.apiKeys["{{keyParamName}}"]) { - headers['{{keyParamName}}'] = this.APIConfiguration.apiKeys["{{keyParamName}}"]; + if (this.APIConfiguration.apiKeys['{{keyParamName}}']) { + headers['{{keyParamName}}'] = this.APIConfiguration.apiKeys['{{keyParamName}}']; } {{/isKeyInHeader}} {{#isKeyInQuery}} - if (this.APIConfiguration.apiKeys["{{keyParamName}}"]) { - queryParameters.push("{{paramName}}="+encodeURIComponent(String(this.APIConfiguration.apiKeys["{{keyParamName}}"]))); + if (this.APIConfiguration.apiKeys['{{keyParamName}}']) { + queryParameters.push('{{paramName}}='+encodeURIComponent(String(this.APIConfiguration.apiKeys['{{keyParamName}}']))); } {{/isKeyInQuery}} {{/isApiKey}} @@ -169,9 +166,9 @@ export class {{classname}} { {{/formParams}} {{/hasFormParams}} - const response: Observable> = this.httpClient.{{httpMethod}}(`${this.basePath}{{{path}}}{{#hasQueryParams}}?${queryParameters.join('&')}{{/hasQueryParams}}`{{#bodyParam}}, {{paramName}} {{/bodyParam}}{{#hasFormParams}}, body{{/hasFormParams}}, headers); - if (observe == 'body') { - return response.map(httpResponse => <{{#returnType}}{{{returnType}}}{{#isResponseTypeFile}}|undefined{{/isResponseTypeFile}}{{/returnType}}{{^returnType}}any{{/returnType}}>(httpResponse.response)){{#usePromise}}.toPromise(){{/usePromise}}; + const response: Observable> = this.httpClient.{{httpMethod}}(`${this.APIConfiguration.basePath}{{{path}}}{{#hasQueryParams}}?${queryParameters.join('&')}{{/hasQueryParams}}`{{#bodyParam}}, {{paramName}}{{/bodyParam}} as any{{#hasFormParams}}, body{{/hasFormParams}}, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response){{#usePromise}}.toPromise(){{/usePromise}}; } return response{{#usePromise}}.toPromise(){{/usePromise}}; } diff --git a/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache index abb089af45c..ab92fb6bac6 100644 --- a/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache +++ b/modules/swagger-codegen/src/main/resources/typescript-node/package.mustache @@ -19,7 +19,8 @@ "@types/request": "*" }, "devDependencies": { - "typescript": "^2.4.2" + "typescript": "^2.4.2", + "minimist": "^1.2.5" }{{#npmRepository}}, "publishConfig":{ "registry":"{{npmRepository}}" diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/Build.cs.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/Build.cs.mustache new file mode 100644 index 00000000000..a6fe9bd84ec --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/Build.cs.mustache @@ -0,0 +1,19 @@ +{{>licenseInfo}} +using System; +using System.IO; +using UnrealBuildTool; + +public class {{unrealModuleName}} : ModuleRules +{ + public {{unrealModuleName}}(ReadOnlyTargetRules Target) : base(Target) + { + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "Http", + "Json", + } + ); + } +} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/api-header.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/api-header.mustache new file mode 100644 index 00000000000..6629cf47cb1 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/api-header.mustache @@ -0,0 +1,42 @@ +{{>licenseInfo}} +#pragma once + +#include "CoreMinimal.h" +#include "{{modelNamePrefix}}BaseModel.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +class {{dllapi}} {{classname}} +{ +public: + {{classname}}(); + ~{{classname}}(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + {{#operations}}{{#operation}}class {{operationIdCamelCase}}Request; + class {{operationIdCamelCase}}Response; + {{/operation}}{{/operations}} + {{#operations}}{{#operation}}DECLARE_DELEGATE_OneParam(F{{operationIdCamelCase}}Delegate, const {{operationIdCamelCase}}Response&); + {{/operation}}{{/operations}} + {{#operations}}{{#operation}}{{#description}}/* {{{description}}} */ + {{/description}}bool {{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate = F{{operationIdCamelCase}}Delegate()) const; + {{/operation}}{{/operations}} +private: + {{#operations}}{{#operation}}void On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const; + {{/operation}}{{/operations}} + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/api-operations-header.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/api-operations-header.mustache new file mode 100644 index 00000000000..1486ef60e2c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/api-operations-header.mustache @@ -0,0 +1,64 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" +#include "{{classname}}.h" + +{{#imports}}{{{import}}} +{{/imports}} + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +{{#operations}} +{{#operation}} +/* {{summary}} +{{#notes}} * + * {{notes}}{{/notes}} +*/ +class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Request : public Request +{ +public: + virtual ~{{operationIdCamelCase}}Request() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + {{#allParams}} + {{#isEnum}} + {{#allowableValues}} + enum class {{{enumName}}} + { + {{#enumVars}} + {{name}}, + {{/enumVars}} + }; + {{/allowableValues}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{^isEnum}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{dataType}}}{{^required}}>{{/required}} {{paramName}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{/allParams}} +}; + +class {{dllapi}} {{classname}}::{{operationIdCamelCase}}Response : public Response +{ +public: + virtual ~{{operationIdCamelCase}}Response() {} + {{#responses.0}} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + {{/responses.0}} + bool FromJson(const TSharedPtr& JsonObject) final; + + {{#returnType}}{{{returnType}}} Content;{{/returnType}} +}; + +{{/operation}} +{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/api-operations-source.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/api-operations-source.mustache new file mode 100644 index 00000000000..8ab14a704cf --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/api-operations-source.mustache @@ -0,0 +1,284 @@ +{{>licenseInfo}} +#include "{{classname}}Operations.h" + +#include "{{unrealModuleName}}Module.h" +#include "{{modelNamePrefix}}Helpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#operations}}{{#operation}} +{{#allParams}} +{{#isEnum}} +inline FString ToString(const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + {{#allowableValues}} + switch (Value) + { + {{#enumVars}} + case {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}::{{name}}: + return TEXT({{{value}}}); + {{/enumVars}} + } + {{/allowableValues}} + + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}} Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}& Value) +{ + {{#allowableValues}} + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { {{#enumVars}} + { TEXT({{{value}}}), {{classname}}::{{operationIdCamelCase}}Request::{{{enumName}}}::{{name}} },{{/enumVars}} }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + {{/allowableValues}} + return false; +} + +{{/isEnum}} +{{/allParams}} +FString {{classname}}::{{operationIdCamelCase}}Request::ComputePath() const +{ + {{^pathParams.0}} + FString Path(TEXT("{{{path}}}")); + {{/pathParams.0}} + {{#pathParams.0}} + TMap PathParams = { {{#pathParams}} + { TEXT("{{baseName}}"), ToStringFormatArg({{paramName}}) }{{#hasMore}},{{/hasMore}}{{/pathParams}} }; + + FString Path = FString::Format(TEXT("{{{path}}}"), PathParams); + + {{/pathParams.0}} + {{#queryParams.0}} + TArray QueryParams; + {{#queryParams}} + {{#required}} + {{^collectionFormat}} + QueryParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}})); + {{/collectionFormat}} + {{#collectionFormat}} + QueryParams.Add(FString(TEXT("{{baseName}}=")) + CollectionToUrlString_{{collectionFormat}}({{paramName}}, TEXT("{{baseName}}"))); + {{/collectionFormat}} + {{/required}} + {{^required}} + {{^collectionFormat}} + if({{paramName}}.IsSet()) + { + QueryParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}}.GetValue())); + } + {{/collectionFormat}} + {{#collectionFormat}} + if({{paramName}}.IsSet()) + { + QueryParams.Add(FString(TEXT("{{baseName}}=")) + CollectionToUrlString_{{collectionFormat}}({{paramName}}.GetValue(), TEXT("{{baseName}}"))); + } + {{/collectionFormat}} + {{/required}} + {{/queryParams}} + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + {{/queryParams.0}} + return Path; +} + +void {{classname}}::{{operationIdCamelCase}}Request::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { {{#consumes}}TEXT("{{{mediaType}}}"){{#hasMore}}, {{/hasMore}}{{/consumes}} }; + //static const TArray Produces = { {{#produces}}TEXT("{{{mediaType}}}"){{#hasMore}}, {{/hasMore}}{{/produces}} }; + + HttpRequest->SetVerb(TEXT("{{httpMethod}}")); + {{#headerParams.0}} + + // Header parameters + {{#headerParams}} + {{#required}} + HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet()) + { + HttpRequest->SetHeader(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + } + {{/required}} + {{/headerParams}} + {{/headerParams.0}} + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + {{#bodyParams.0}} + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + {{#bodyParams}} + {{#required}} + WriteJsonValue(Writer, {{paramName}}); + {{/required}} + {{^required}} + if ({{paramName}}.IsSet()) + { + WriteJsonValue(Writer, {{paramName}}.GetValue()); + } + {{/required}} + {{/bodyParams}} + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + {{/bodyParams.0}} + {{#formParams.0}} + {{#formParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, cannot be used in JsonBody")); + {{/formParams}} + {{/formParams.0}} + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + {{#formParams.0}} + HttpMultipartFormData FormData; + {{#formParams}} + {{#isContainer}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Collections are not supported in multipart form")); + {{/isContainer}} + {{^isContainer}} + {{#required}} + {{#isFile}} + FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}); + {{/isFile}} + {{^isFile}} + {{#isBinary}} + FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}); + {{/isBinary}} + {{^isBinary}} + FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}})); + {{/isBinary}} + {{/isFile}} + {{/required}} + {{^required}} + if({{paramName}}.IsSet()) + { + {{#isFile}} + FormData.AddFilePart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + {{/isFile}} + {{^isFile}} + {{#isBinary}} + FormData.AddBinaryPart(TEXT("{{baseName}}"), {{paramName}}.GetValue()); + {{/isBinary}} + {{^isBinary}} + FormData.AddStringPart(TEXT("{{baseName}}"), *ToUrlString({{paramName}}.GetValue())); + {{/isBinary}} + {{/isFile}} + } + {{/required}} + {{/isContainer}} + {{/formParams}} + + FormData.SetupHttpRequest(HttpRequest); + {{/formParams.0}} + {{#bodyParams.0}} + {{#bodyParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Body parameter ({{baseName}}) was ignored, not supported in multipart form")); + {{/bodyParams}} + {{/bodyParams.0}} + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + {{#formParams.0}} + TArray FormParams; + {{#formParams}} + {{#isContainer}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Collections are not supported in urlencoded requests")); + {{/isContainer}} + {{#isFile}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Form parameter ({{baseName}}) was ignored, Files are not supported in urlencoded requests")); + {{/isFile}} + {{^isFile}} + {{^isContainer}} + {{#required}} + FormParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}})); + {{/required}} + {{^required}} + if({{paramName}}.IsSet()) + { + FormParams.Add(FString(TEXT("{{baseName}}=")) + ToUrlString({{paramName}}.GetValue())); + } + {{/required}} + {{/isContainer}} + {{/isFile}} + {{/formParams}} + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + {{/formParams.0}} + {{#bodyParams.0}} + {{#bodyParams}} + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Body parameter ({{baseName}}) was ignored, not supported in urlencoded requests")); + {{/bodyParams}} + {{/bodyParams.0}} + } + else + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +{{#responses.0}} +void {{classname}}::{{operationIdCamelCase}}Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + {{#responses}} + case {{code}}: + {{#isDefault}} + default: + {{/isDefault}} + SetResponseString(TEXT("{{message}}")); + break; + {{/responses}} + } +} +{{/responses.0}} + +bool {{classname}}::{{operationIdCamelCase}}Response::FromJson(const TSharedPtr& JsonValue) +{ + {{#returnType}} + return TryGetJsonValue(JsonValue, Content); + {{/returnType}} + {{^returnType}} + return true; + {{/returnType}} +} +{{/operation}}{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/api-source.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/api-source.mustache new file mode 100644 index 00000000000..c1ca56649e5 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/api-source.mustache @@ -0,0 +1,120 @@ +{{>licenseInfo}} +#include "{{classname}}.h" + +#include "{{classname}}Operations.h" +#include "{{unrealModuleName}}Module.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +{{classname}}::{{classname}}() +: Url(TEXT("{{basePath}}")) +{ +} + +{{classname}}::~{{classname}}() {} + +void {{classname}}::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void {{classname}}::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void {{classname}}::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool {{classname}}::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("{{classname}}: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void {{classname}}::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +{{#operations}} +{{#operation}} +bool {{classname}}::{{operationIdCamelCase}}(const {{operationIdCamelCase}}Request& Request, const F{{operationIdCamelCase}}Delegate& Delegate /*= F{{operationIdCamelCase}}Delegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &{{classname}}::On{{operationIdCamelCase}}Response, Delegate); + return HttpRequest->ProcessRequest(); +} + +void {{classname}}::On{{operationIdCamelCase}}Response(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, F{{operationIdCamelCase}}Delegate Delegate) const +{ + {{operationIdCamelCase}}Response Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +{{/operation}} +{{/operations}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/helpers-header.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/helpers-header.mustache new file mode 100644 index 00000000000..adbff0c0e88 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/helpers-header.mustache @@ -0,0 +1,405 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" + +class IHttpRequest; + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +typedef TSharedRef> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class {{dllapi}} HttpFileInput +{ +public: + HttpFileInput(const TCHAR* InFilePath); + HttpFileInput(const FString& InFilePath); + + // This will automatically set the content type if not already set + void SetFilePath(const TCHAR* InFilePath); + void SetFilePath(const FString& InFilePath); + + // Optional if it can be deduced from the FilePath + void SetContentType(const TCHAR* ContentType); + + HttpFileInput& operator=(const HttpFileInput& Other) = default; + HttpFileInput& operator=(const FString& InFilePath) { SetFilePath(*InFilePath); return*this; } + HttpFileInput& operator=(const TCHAR* InFilePath) { SetFilePath(InFilePath); return*this; } + + const FString& GetFilePath() const { return FilePath; } + const FString& GetContentType() const { return ContentType; } + + // Returns the filename with extension + FString GetFilename() const; + +private: + FString FilePath; + FString ContentType; +}; + +////////////////////////////////////////////////////////////////////////// + +class HttpMultipartFormData +{ +public: + void SetBoundary(const TCHAR* InBoundary); + void SetupHttpRequest(const TSharedRef& HttpRequest); + + void AddStringPart(const TCHAR* Name, const TCHAR* Data); + void AddJsonPart(const TCHAR* Name, const FString& JsonString); + void AddBinaryPart(const TCHAR* Name, const TArray& ByteArray); + void AddFilePart(const TCHAR* Name, const HttpFileInput& File); + +private: + void AppendString(const TCHAR* Str); + const FString& GetBoundary() const; + + mutable FString Boundary; + TArray FormData; + + static const TCHAR* Delimiter; + static const TCHAR* Newline; +}; + +////////////////////////////////////////////////////////////////////////// + +// Decodes Base64Url encoded strings, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +bool Base64UrlDecode(const FString& Base64String, T& Value) +{ + FString TmpCopy(Base64String); + TmpCopy.ReplaceInline(TEXT("-"), TEXT("+")); + TmpCopy.ReplaceInline(TEXT("_"), TEXT("/")); + + return FBase64::Decode(TmpCopy, Value); +} + +// Encodes strings in Base64Url, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +FString Base64UrlEncode(const T& Value) +{ + FString Base64String = FBase64::Encode(Value); + Base64String.ReplaceInline(TEXT("+"), TEXT("-")); + Base64String.ReplaceInline(TEXT("/"), TEXT("_")); + return Base64String; +} + +template +inline FStringFormatArg ToStringFormatArg(const T& Value) +{ + return FStringFormatArg(Value); +} + +inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) +{ + return FStringFormatArg(Value.ToIso8601()); +} + +inline FStringFormatArg ToStringFormatArg(const TArray& Value) +{ + return FStringFormatArg(Base64UrlEncode(Value)); +} + +template::value, int>::type = 0> +inline FString ToString(const T& Value) +{ + return FString::Format(TEXT("{0}"), { ToStringFormatArg(Value) }); +} + +inline FString ToString(const FString& Value) +{ + return Value; +} + +inline FString ToString(const TArray& Value) +{ + return Base64UrlEncode(Value); +} + +inline FString ToString(const Model& Value) +{ + FString String; + JsonWriter Writer = TJsonWriterFactory<>::Create(&String); + Value.WriteJson(Writer); + Writer->Close(); + return String; +} + +template +inline FString ToUrlString(const T& Value) +{ + return FPlatformHttp::UrlEncode(ToString(Value)); +} + +template +inline FString CollectionToUrlString(const TArray& Collection, const TCHAR* Separator) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += ToUrlString(Collection[0]); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("{0}{1}"), { Separator, *ToUrlString(Collection[i]) }); + } + return Output; +} + +template +inline FString CollectionToUrlString_csv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(",")); +} + +template +inline FString CollectionToUrlString_ssv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(" ")); +} + +template +inline FString CollectionToUrlString_tsv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("\t")); +} + +template +inline FString CollectionToUrlString_pipes(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("|")); +} + +template +inline FString CollectionToUrlString_multi(const TArray& Collection, const TCHAR* BaseName) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[0]) }); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[i]) }); + } + return Output; +} + +////////////////////////////////////////////////////////////////////////// + +template::value, int>::type = 0> +inline void WriteJsonValue(JsonWriter& Writer, const T& Value) +{ + Writer->WriteValue(Value); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) +{ + Writer->WriteValue(Value.ToIso8601()); +} + +inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) +{ + Value.WriteJson(Writer); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) +{ + Writer->WriteObjectStart(); + for (const auto& It : Value) + { + Writer->WriteIdentifierPrefix(It.Key); + WriteJsonValue(Writer, It.Value); + } + Writer->WriteObjectEnd(); +} + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteValue(ToString(Value)); +} + +////////////////////////////////////////////////////////////////////////// + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, T& Value) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + return TryGetJsonValue(JsonValue, Value); + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, TOptional& OptionalValue) +{ + if(JsonObject->HasField(Key)) + { + T Value; + if (TryGetJsonValue(JsonObject, Key, Value)) + { + OptionalValue = Value; + return true; + } + else + return false; + } + return true; // Absence of optional value is not a parsing error +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FString& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + return FDateTime::Parse(TmpValue, Value); + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) +{ + bool TmpValue; + if (JsonValue->TryGetBool(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +template::value, int>::type = 0> +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, T& Value) +{ + T TmpValue; + if (JsonValue->TryGetNumber(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, Model& Value) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + return Value.FromJson(*Object); + else + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& ArrayValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + ArrayValue.Reset(Count); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + ArrayValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + MapValue.Reset(); + bool ParseSuccess = true; + for (const auto& It : (*Object)->Values) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue(It.Value, TmpValue); + MapValue.Emplace(It.Key, MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + JsonObjectValue = *Object; + return true; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Base64UrlDecode(TmpValue, Value); + return true; + } + else + return false; +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/helpers-source.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/helpers-source.mustache new file mode 100644 index 00000000000..1ae8bad54c6 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/helpers-source.mustache @@ -0,0 +1,187 @@ +{{>licenseInfo}} +#include "{{modelNamePrefix}}Helpers.h" + +#include "{{unrealModuleName}}Module.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +HttpFileInput::HttpFileInput(const TCHAR* InFilePath) +{ + SetFilePath(InFilePath); +} + +HttpFileInput::HttpFileInput(const FString& InFilePath) +{ + SetFilePath(InFilePath); +} + +void HttpFileInput::SetFilePath(const TCHAR* InFilePath) +{ + FilePath = InFilePath; + if(ContentType.IsEmpty()) + { + ContentType = FPlatformHttp::GetMimeType(InFilePath); + } +} + +void HttpFileInput::SetFilePath(const FString& InFilePath) +{ + SetFilePath(*InFilePath); +} + +void HttpFileInput::SetContentType(const TCHAR* InContentType) +{ + ContentType = InContentType; +} + +FString HttpFileInput::GetFilename() const +{ + return FPaths::GetCleanFilename(FilePath); +} + +////////////////////////////////////////////////////////////////////////// + +const TCHAR* HttpMultipartFormData::Delimiter = TEXT("--"); +const TCHAR* HttpMultipartFormData::Newline = TEXT("\r\n"); + +void HttpMultipartFormData::SetBoundary(const TCHAR* InBoundary) +{ + checkf(Boundary.IsEmpty(), TEXT("Boundary must be set before usage")); + Boundary = InBoundary; +} + +const FString& HttpMultipartFormData::GetBoundary() const +{ + if (Boundary.IsEmpty()) + { + // Generate a random boundary with enough entropy, should avoid occurences of the boundary in the data. + // Since the boundary is generated at every request, in case of failure, retries should succeed. + Boundary = FGuid::NewGuid().ToString(EGuidFormats::Short); + } + + return Boundary; +} + +void HttpMultipartFormData::SetupHttpRequest(const TSharedRef& HttpRequest) +{ + if(HttpRequest->GetVerb() != TEXT("POST")) + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Expected POST verb when using multipart form data")); + } + + // Append final boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Delimiter); + + HttpRequest->SetHeader("Content-Type", FString::Printf(TEXT("multipart/form-data; boundary=%s"), *GetBoundary())); + HttpRequest->SetContent(FormData); +} + +void HttpMultipartFormData::AddStringPart(const TCHAR* Name, const TCHAR* Data) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name = \"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: text/plain; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(Data); + AppendString(Newline); +} + +void HttpMultipartFormData::AddJsonPart(const TCHAR* Name, const FString& JsonString) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/json; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(*JsonString); + AppendString(Newline); +} + +void HttpMultipartFormData::AddBinaryPart(const TCHAR* Name, const TArray& ByteArray) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/octet-stream"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(ByteArray); + AppendString(Newline); +} + +void HttpMultipartFormData::AddFilePart(const TCHAR* Name, const HttpFileInput& File) +{ + TArray FileContents; + if (!FFileHelper::LoadFileToArray(FileContents, *File.GetFilePath())) + { + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Failed to load file (%s)"), *File.GetFilePath()); + return; + } + + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\"; filename=\"%s\""), Name, *File.GetFilename())); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: %s"), *File.GetContentType())); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(FileContents); + AppendString(Newline); +} + +void HttpMultipartFormData::AppendString(const TCHAR* Str) +{ + FTCHARToUTF8 utf8Str(Str); + FormData.Append((uint8*)utf8Str.Get(), utf8Str.Length()); +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/licenseInfo.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/licenseInfo.mustache new file mode 100644 index 00000000000..7d61c4ee055 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/licenseInfo.mustache @@ -0,0 +1,11 @@ +/** + * {{{appName}}} + * {{{appDescription}}} + * + * {{#version}}OpenAPI spec version: {{{version}}}{{/version}} + * {{#infoEmail}}Contact: {{{infoEmail}}}{{/infoEmail}} + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/model-base-header.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/model-base-header.mustache new file mode 100644 index 00000000000..67280bde989 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/model-base-header.mustache @@ -0,0 +1,59 @@ +{{>licenseInfo}} +#pragma once + +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" +#include "Serialization/JsonWriter.h" +#include "Dom/JsonObject.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +typedef TSharedRef> JsonWriter; + +class {{dllapi}} Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; +}; + +class {{dllapi}} Request +{ +public: + virtual ~Request() {} + virtual void SetupHttpRequest(const TSharedRef& HttpRequest) const = 0; + virtual FString ComputePath() const = 0; +}; + +class {{dllapi}} Response +{ +public: + virtual ~Response() {} + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; + + void SetSuccessful(bool InSuccessful) { Successful = InSuccessful; } + bool IsSuccessful() const { return Successful; } + + virtual void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode); + EHttpResponseCodes::Type GetHttpResponseCode() const { return ResponseCode; } + + void SetResponseString(const FString& InResponseString) { ResponseString = InResponseString; } + const FString& GetResponseString() const { return ResponseString; } + + void SetHttpResponse(const FHttpResponsePtr& InHttpResponse) { HttpResponse = InHttpResponse; } + const FHttpResponsePtr& GetHttpResponse() const { return HttpResponse; } + +private: + bool Successful; + EHttpResponseCodes::Type ResponseCode; + FString ResponseString; + FHttpResponsePtr HttpResponse; +}; + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/model-base-source.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/model-base-source.mustache new file mode 100644 index 00000000000..12decd77211 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/model-base-source.mustache @@ -0,0 +1,21 @@ +{{>licenseInfo}} +#include "{{modelNamePrefix}}BaseModel.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} + +void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + ResponseCode = InHttpResponseCode; + SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode)); + if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout) + { + SetResponseString(TEXT("Request Timeout")); + } +} + +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} \ No newline at end of file diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/model-header.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/model-header.mustache new file mode 100644 index 00000000000..6af8c720f0e --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/model-header.mustache @@ -0,0 +1,51 @@ +{{>licenseInfo}} +#pragma once + +#include "{{modelNamePrefix}}BaseModel.h" +{{#imports}}{{{import}}} +{{/imports}} + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#models}} +{{#model}} + +/* + * {{classname}} + * + * {{description}} + */ +class {{dllapi}} {{classname}} : public Model +{ +public: + virtual ~{{classname}}() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + {{#vars}} + {{#isEnum}} + {{#allowableValues}} + enum class {{{enumName}}} + { + {{#enumVars}} + {{name}}, + {{/enumVars}} + }; + {{/allowableValues}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatypeWithEnum}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{^isEnum}} + {{#description}}/* {{{description}}} */ + {{/description}}{{^required}}TOptional<{{/required}}{{{datatype}}}{{^required}}>{{/required}} {{name}}{{#required}}{{#defaultValue}} = {{{defaultValue}}}{{/defaultValue}}{{/required}}; + {{/isEnum}} + {{/vars}} +}; + +{{/model}} +{{/models}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/model-source.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/model-source.mustache new file mode 100644 index 00000000000..4850fb9859c --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/model-source.mustache @@ -0,0 +1,98 @@ +{{>licenseInfo}} +#include "{{classname}}.h" + +#include "{{unrealModuleName}}Module.h" +#include "{{modelNamePrefix}}Helpers.h" + +#include "Templates/SharedPointer.h" + +{{#cppNamespaceDeclarations}} +namespace {{this}} +{ +{{/cppNamespaceDeclarations}} +{{#models}}{{#model}} +{{#hasEnums}} +{{#vars}} +{{#isEnum}} +inline FString ToString(const {{classname}}::{{{enumName}}}& Value) +{ + {{#allowableValues}} + switch (Value) + { + {{#enumVars}} + case {{classname}}::{{{enumName}}}::{{name}}: + return TEXT({{{value}}}); + {{/enumVars}} + } + {{/allowableValues}} + + UE_LOG(Log{{unrealModuleName}}, Error, TEXT("Invalid {{classname}}::{{{enumName}}} Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const {{classname}}::{{{enumName}}}& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const {{classname}}::{{{enumName}}}& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, {{classname}}::{{{enumName}}}& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { {{#enumVars}} + { TEXT({{{value}}}), {{classname}}::{{{enumName}}}::{{name}} },{{/enumVars}} }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +{{/isEnum}} +{{/vars}} +{{/hasEnums}} +void {{classname}}::WriteJson(JsonWriter& Writer) const +{ + {{#parent}} + #error inheritance not handled right now + {{/parent}} + Writer->WriteObjectStart(); + {{#vars}} + {{#required}} + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}); + {{/required}} + {{^required}} + if ({{name}}.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("{{baseName}}")); WriteJsonValue(Writer, {{name}}.GetValue()); + } + {{/required}} + {{/vars}} + Writer->WriteObjectEnd(); +} + +bool {{classname}}::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + {{#vars}} + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("{{baseName}}"), {{name}}); + {{/vars}} + + return ParseSuccess; +} +{{/model}} +{{/models}} +{{#cppNamespaceDeclarations}} +} +{{/cppNamespaceDeclarations}} diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/module-header.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/module-header.mustache new file mode 100644 index 00000000000..f27de891f9f --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/module-header.mustache @@ -0,0 +1,15 @@ +{{>licenseInfo}} +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(Log{{unrealModuleName}}, Log, All); + +class {{dllapi}} {{unrealModuleName}}Module : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/modules/swagger-codegen/src/main/resources/ue4cpp/module-source.mustache b/modules/swagger-codegen/src/main/resources/ue4cpp/module-source.mustache new file mode 100644 index 00000000000..676633ea0d9 --- /dev/null +++ b/modules/swagger-codegen/src/main/resources/ue4cpp/module-source.mustache @@ -0,0 +1,14 @@ +{{>licenseInfo}} +#include "{{unrealModuleName}}Module.h" + +IMPLEMENT_MODULE({{unrealModuleName}}Module, {{unrealModuleName}}); +DEFINE_LOG_CATEGORY(Log{{unrealModuleName}}); + +void {{unrealModuleName}}Module::StartupModule() +{ +} + +void {{unrealModuleName}}Module::ShutdownModule() +{ +} + diff --git a/modules/swagger-codegen/src/main/resources/undertow/pom.mustache b/modules/swagger-codegen/src/main/resources/undertow/pom.mustache index 599bb153963..4f6f71a2ccb 100644 --- a/modules/swagger-codegen/src/main/resources/undertow/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/undertow/pom.mustache @@ -16,7 +16,7 @@ 1.8 UTF-8 0.1.1 - 2.10.1 + 2.11.4 1.7.21 0.5.2 4.5.3 diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java index 1dd543f5570..0e58137f1ff 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/CodegenTest.java @@ -26,7 +26,7 @@ public void propertiesInComposedModelTest() { Assert.assertEquals(composed.vars.get(0).baseName, "modelOneProp"); Assert.assertEquals(composed.vars.get(1).baseName, "properties"); Assert.assertEquals(composed.vars.get(2).baseName, "zones"); - Assert.assertNull(composed.parent); + Assert.assertNotNull(composed.parent); } @Test(description = "test sanitizeTag") @@ -267,11 +267,10 @@ public void simpleCompositionTest() { final Model model = swagger.getDefinitions().get("SimpleComposition"); CodegenModel composed = codegen.fromModel("SimpleComposition", model, swagger.getDefinitions()); - Assert.assertEquals(composed.vars.size(), 3); - Assert.assertEquals(composed.vars.get(0).baseName, "modelOneProp"); - Assert.assertEquals(composed.vars.get(1).baseName, "modelTwoProp"); - Assert.assertEquals(composed.vars.get(2).baseName, "simpleCompositionProp"); - Assert.assertNull(composed.parent); + Assert.assertEquals(composed.vars.size(), 2); + Assert.assertEquals(composed.vars.get(0).baseName, "modelTwoProp"); + Assert.assertEquals(composed.vars.get(1).baseName, "simpleCompositionProp"); + Assert.assertNotNull(composed.parent); } @Test(description = "handle multi level composition") @@ -282,13 +281,10 @@ public void multiCompositionTest() { final Model model = swagger.getDefinitions().get("CompositionOfSimpleComposition"); CodegenModel composed = codegen.fromModel("CompositionOfSimpleComposition", model, swagger.getDefinitions()); - Assert.assertEquals(composed.vars.size(), 5); - Assert.assertEquals(composed.vars.get(0).baseName, "modelOneProp"); - Assert.assertEquals(composed.vars.get(1).baseName, "modelTwoProp"); - Assert.assertEquals(composed.vars.get(2).baseName, "simpleCompositionProp"); - Assert.assertEquals(composed.vars.get(3).baseName, "modelThreeProp"); - Assert.assertEquals(composed.vars.get(4).baseName, "compositionOfSimpleCompositionProp"); - Assert.assertNull(composed.parent); + Assert.assertEquals(composed.vars.size(), 2); + Assert.assertEquals(composed.vars.get(0).baseName, "modelThreeProp"); + Assert.assertEquals(composed.vars.get(1).baseName, "compositionOfSimpleCompositionProp"); + Assert.assertNotNull(composed.parent); } @Test(description = "handle simple inheritance") @@ -299,10 +295,11 @@ public void simpleInheritanceTest() { final Model model = swagger.getDefinitions().get("ChildOfSimpleParent"); CodegenModel child = codegen.fromModel("ChildOfSimpleParent", model, swagger.getDefinitions()); - Assert.assertEquals(child.vars.size(), 2); - Assert.assertEquals(child.vars.get(0).baseName, "modelOneProp"); - Assert.assertEquals(child.vars.get(1).baseName, "childOfSimpleParentProp"); - Assert.assertEquals(child.parent, "SimpleParent"); + Assert.assertEquals(child.vars.size(), 3); + Assert.assertEquals(child.vars.get(0).baseName, "disc"); + Assert.assertEquals(child.vars.get(1).baseName, "simpleParentProp"); + Assert.assertEquals(child.vars.get(2).baseName, "childOfSimpleParentProp"); + Assert.assertEquals(child.parent, "ModelOne"); } @Test(description = "handle multi level inheritance") diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/DefaultGeneratorTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/DefaultGeneratorTest.java index 55b21bdbf5c..b717c2d4665 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/DefaultGeneratorTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/DefaultGeneratorTest.java @@ -7,6 +7,7 @@ import io.swagger.models.Swagger; import io.swagger.models.Tag; import io.swagger.parser.SwaggerParser; +import io.swagger.parser.util.ParseOptions; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.junit.rules.TemporaryFolder; @@ -52,6 +53,448 @@ public void tearDown() throws Exception { folder.delete(); } + @Test + public void testNotNullJacksonAnnotationJava_True() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("java"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + //additionalProperties.put("library", "feign"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("notNullJacksonAnnotation", true); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertTrue(FileUtils.readFileToString(model).contains("@JsonInclude(JsonInclude.Include.NON_NULL)")); + assertTrue(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonInclude;")); + } + + @Test + public void testNotNullJacksonAnnotationJava_False() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("java"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + additionalProperties.put("library", "feign"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("notNullJacksonAnnotation", false); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertFalse(FileUtils.readFileToString(model).contains("@JsonInclude(JsonInclude.Include.NON_NULL)")); + assertFalse(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonInclude;")); + } + + @Test + public void testNotNullJacksonAnnotationSpring_True() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("spring"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + //additionalProperties.put("library", "feign"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("notNullJacksonAnnotation", true); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertTrue(FileUtils.readFileToString(model).contains("@JsonInclude(JsonInclude.Include.NON_NULL)")); + assertTrue(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonInclude;")); + } + + @Test + public void testNotNullJacksonAnnotationSpring_False() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("spring"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + additionalProperties.put("library", "spring-boot"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("notNullJacksonAnnotation", false); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertFalse(FileUtils.readFileToString(model).contains("@JsonInclude(JsonInclude.Include.NON_NULL)")); + assertFalse(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonInclude;")); + } + + @Test + public void testIgnoreUnknownJacksonAnnotationJava_True() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("java"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + //additionalProperties.put("library", "feign"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("ignoreUnknownJacksonAnnotation", true); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertTrue(FileUtils.readFileToString(model).contains("@JsonIgnoreProperties(ignoreUnknown = true)")); + assertTrue(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonIgnoreProperties;")); + } + + @Test + public void testIgnoreUnknownJacksonAnnotationJava_False() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("java"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + additionalProperties.put("library", "feign"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("ignoreUnknownJacksonAnnotation", false); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertFalse(FileUtils.readFileToString(model).contains("@JsonIgnoreProperties(ignoreUnknown = true)")); + assertFalse(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonIgnoreProperties;")); + } + + @Test + public void testIgnoreUnknownJacksonAnnotationSpring_True() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("spring"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + //additionalProperties.put("library", "feign"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("ignoreUnknownJacksonAnnotation", true); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertTrue(FileUtils.readFileToString(model).contains("@JsonIgnoreProperties(ignoreUnknown = true)")); + assertTrue(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonIgnoreProperties;")); + } + + @Test + public void testIgnoreUnknownJacksonAnnotationSpring_False() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("spring"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + additionalProperties.put("library", "spring-boot"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("ignoreUnknownJacksonAnnotation", false); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/main/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertFalse(FileUtils.readFileToString(model).contains("@JsonIgnoreProperties(ignoreUnknown = true)")); + assertFalse(FileUtils.readFileToString(model).contains("import com.fasterxml.jackson.annotation.JsonIgnoreProperties;")); + } + + @Test + public void testAdditionalModelTypeAnnotations() throws IOException { + final File output = folder.getRoot(); + + CodegenConfigurator codegenConfigurator = new CodegenConfigurator(); + codegenConfigurator.setInputSpec("src/test/resources/2_0/allOfTest.yaml"); + codegenConfigurator.setOutputDir(output.getAbsolutePath()); + codegenConfigurator.setLang("jaxrs"); + + Map additionalProperties = new HashMap<>(); + additionalProperties.put("dateLibrary", "java8"); + additionalProperties.put("apiTests", false); + additionalProperties.put("hideGenerationTimestamp", true); + additionalProperties.put("invokerPackage", "com.mycompany.generated.client"); + additionalProperties.put("modelPackage", "com.mycompany.generated.client.model"); + additionalProperties.put("apiPackage", "com.mycompany.generated.client.api"); + additionalProperties.put("additionalModelTypeAnnotations", + "@com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true);" + + "@com.fasterxml.jackson.annotation.JsonInclude(JsonInclude.Include.NON_NULL)"); + + codegenConfigurator.setAdditionalProperties(additionalProperties); + + Map importMapping = new HashMap<>(); + + importMapping.put("LocalDateTime", "java.time.LocalDateTime"); + importMapping.put("LocalTime", "java.time.LocalTime"); + importMapping.put("DayOfWeek", "java.time.DayOfWeek"); + importMapping.put("Duration", "java.time.Duration"); + importMapping.put("ChronoUnit", "java.time.temporal.ChronoUnit"); + importMapping.put("Currency", "java.util.Currency"); + importMapping.put("LocalDate", "java.time.LocalDate"); + importMapping.put("Locale", "java.util.Locale"); + importMapping.put("ZoneId", "java.time.ZoneId"); + + codegenConfigurator.setImportMappings(importMapping); + + DefaultGenerator generator = new DefaultGenerator(); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.MODEL_DOCS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_TESTS, "false"); + generator.setGeneratorPropertyDefault(CodegenConstants.API_DOCS, "false"); + + //generate + generator.opts(codegenConfigurator.toClientOptInput()).generate(); + final File model = new File(output, "src/gen/java/com/mycompany/generated/client/model/ModelOne.java"); + assertTrue(model.exists()); + assertTrue(FileUtils.readFileToString(model).contains("@com.fasterxml.jackson.annotation.JsonIgnoreProperties(ignoreUnknown = true)")); + assertTrue(FileUtils.readFileToString(model).contains("@com.fasterxml.jackson.annotation.JsonInclude(JsonInclude.Include.NON_NULL)")); + } + @Test public void testSecurityWithoutGlobal() throws Exception { final Swagger swagger = new SwaggerParser().read("src/test/resources/2_0/petstore.json"); @@ -230,8 +673,10 @@ public void testIssue9132() throws Exception { @Test public void testIssue9725() throws Exception { final File output = folder.getRoot(); + ParseOptions parseOptions = new ParseOptions(); + parseOptions.setFlatten(true); - Swagger swagger = new SwaggerParser().read("src/test/resources/2_0/ticket-9725.json"); + Swagger swagger = new SwaggerParser().read("src/test/resources/2_0/ticket-9725.json",null, parseOptions); CodegenConfig codegenConfig = new SpringCodegen(); codegenConfig.setLibrary("spring-cloud"); codegenConfig.setOutputDir(output.getAbsolutePath()); @@ -248,8 +693,9 @@ public void testIssue9725() throws Exception { @Test public void testIssue9725Map() throws Exception { final File output = folder.getRoot(); - - Swagger swagger = new SwaggerParser().read("src/test/resources/2_0/ticket-9725-map.json"); + ParseOptions parseOptions = new ParseOptions(); + parseOptions.setFlatten(true); + Swagger swagger = new SwaggerParser().read("src/test/resources/2_0/ticket-9725-map.json",null, parseOptions); CodegenConfig codegenConfig = new SpringCodegen(); codegenConfig.setLibrary("spring-cloud"); codegenConfig.setOutputDir(output.getAbsolutePath()); diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java index 5f5a3e644a3..7f17213adb7 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/config/CodegenConfiguratorTest.java @@ -9,6 +9,7 @@ import io.swagger.models.Swagger; import io.swagger.models.auth.AuthorizationValue; import io.swagger.parser.SwaggerParser; +import io.swagger.parser.util.ParseOptions; import mockit.Expectations; import mockit.FullVerifications; import mockit.Injectable; @@ -44,6 +45,9 @@ public class CodegenConfiguratorTest { @Injectable List authorizationValues; + @Mocked + ParseOptions options; + @Tested CodegenConfigurator configurator; @@ -158,14 +162,12 @@ public void testAdditionalProperties() throws Exception { configurator.addAdditionalProperty("foo", "bar") .addAdditionalProperty("hello", "world") - .addAdditionalProperty("supportJava6", false) .addAdditionalProperty("useRxJava", true); final ClientOptInput clientOptInput = setupAndRunGenericTest(configurator); assertValueInMap(clientOptInput.getConfig().additionalProperties(), "foo", "bar"); assertValueInMap(clientOptInput.getConfig().additionalProperties(), "hello", "world"); - assertValueInMap(clientOptInput.getConfig().additionalProperties(), "supportJava6", false); assertValueInMap(clientOptInput.getConfig().additionalProperties(), "useRxJava", true); } @@ -246,13 +248,11 @@ public void testLibrary() throws Exception { @Test public void testDynamicProperties() throws Exception { configurator.addDynamicProperty(CodegenConstants.LOCAL_VARIABLE_PREFIX, "_"); - configurator.addDynamicProperty("supportJava6", false); configurator.addDynamicProperty("useRxJava", true); final ClientOptInput clientOptInput = setupAndRunGenericTest(configurator); assertValueInMap(clientOptInput.getConfig().additionalProperties(), CodegenConstants.LOCAL_VARIABLE_PREFIX, "_"); - assertValueInMap(clientOptInput.getConfig().additionalProperties(), "supportJava6", false); assertValueInMap(clientOptInput.getConfig().additionalProperties(), "useRxJava", true); } @@ -351,11 +351,17 @@ private void setupStandardExpectations(final String spec, final String languageN AuthParser.parse(auth); times=1; result = authorizationValues; + new ParseOptions(); + times = 1; + result = options; + options.setResolve(true); + options.setFlatten(true); + new SwaggerParser(); times = 1; result = parser; - parser.read(spec, authorizationValues, true); + parser.read(spec, authorizationValues, options); times = 1; result = swagger; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/java/JavaModelEnumTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/java/JavaModelEnumTest.java index 5ac5f788590..cb541fe286c 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/java/JavaModelEnumTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/java/JavaModelEnumTest.java @@ -1,5 +1,6 @@ package io.swagger.codegen.java; +import io.swagger.codegen.CodegenConfig; import io.swagger.codegen.CodegenModel; import io.swagger.codegen.CodegenProperty; import io.swagger.codegen.DefaultCodegen; @@ -8,8 +9,10 @@ import io.swagger.models.Model; import io.swagger.models.ModelImpl; import io.swagger.models.RefModel; +import io.swagger.models.Swagger; import io.swagger.models.properties.Property; import io.swagger.models.properties.StringProperty; +import io.swagger.parser.SwaggerParser; import org.testng.Assert; import org.testng.annotations.Test; @@ -92,4 +95,18 @@ public void overrideEnumTest() { Assert.assertEquals(enumVar.datatypeWithEnum, "UnsharedThingEnum"); Assert.assertTrue(enumVar.isEnum); } + + @Test(description = "not override identical parent enums") + public void testEnumTypes() { + //final Swagger swagger = parser.read("src/test/resources/issue-913/BS/ApiSpecification.yaml"); + final CodegenConfig codegenConfig = new JavaClientCodegen(); + + final Swagger swagger = new SwaggerParser().read("2_0/issue-10546.yaml", null, true); + final Model booleanModel = swagger.getDefinitions().get("Boolean"); + + CodegenModel codegenModel = codegenConfig.fromModel("Boolean", booleanModel); + + Assert.assertTrue(codegenModel.isEnum); + Assert.assertEquals(codegenModel.dataType, "Boolean"); + } } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavascriptClientCodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavascriptClientCodegenTest.java index e211e465706..64cdb62b50d 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavascriptClientCodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/javascript/JavascriptClientCodegenTest.java @@ -1,11 +1,18 @@ package io.swagger.codegen.javascript; +import io.swagger.codegen.ClientOptInput; +import io.swagger.codegen.DefaultGenerator; +import io.swagger.codegen.config.CodegenConfigurator; +import org.junit.rules.TemporaryFolder; import org.testng.Assert; import org.testng.annotations.Test; import io.swagger.codegen.CodegenConstants; import io.swagger.codegen.languages.JavascriptClientCodegen; +import java.io.File; +import java.io.IOException; + public class JavascriptClientCodegenTest { @Test @@ -43,4 +50,26 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); } + @Test + public void testRecursiveModel() throws IOException { + final TemporaryFolder folder = new TemporaryFolder(); + + folder.create(); + final File output = folder.getRoot(); + + final CodegenConfigurator configurator = new CodegenConfigurator() + .setLang("javascript") + .setInputSpec("src/test/resources/2_0/recursive_model.yaml") + .setOutputDir(output.getAbsolutePath()); + + final ClientOptInput clientOptInput = configurator.toClientOptInput(); + new DefaultGenerator().opts(clientOptInput).generate(); + + final File orderFile = new File(output, "src/api/TestClassApi.js"); + Assert.assertTrue(orderFile.exists()); + + folder.delete(); + + } + } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxRSServerOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxRSServerOptionsTest.java index 8b0641af6bb..67fb60b9624 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxRSServerOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/jaxrs/JaxRSServerOptionsTest.java @@ -72,10 +72,8 @@ protected void setExpectations() { times = 1; clientCodegen.setDateLibrary("joda"); times = 1; - clientCodegen.setSupportJava6(false); - times = 1; clientCodegen.setUseBeanValidation(Boolean.valueOf(JaxRSServerOptionsProvider.USE_BEANVALIDATION)); - times = 1; + times = 1; clientCodegen.setUseTags(Boolean.valueOf(JaxRSServerOptionsProvider.USE_TAGS)); times = 1; }}; diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java index 5c309c0b532..dc04167a235 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaClientOptionsProvider.java @@ -21,12 +21,13 @@ public Map createOptions() { options.put(JavaClientCodegen.USE_PLAY_WS, "false"); options.put(JavaClientCodegen.PLAY_VERSION, JavaClientCodegen.PLAY_25); options.put(JavaClientCodegen.PARCELABLE_MODEL, "false"); - options.put(JavaClientCodegen.SUPPORT_JAVA6, "false"); options.put(JavaClientCodegen.USE_BEANVALIDATION, "false"); options.put(JavaClientCodegen.PERFORM_BEANVALIDATION, PERFORM_BEANVALIDATION); options.put(JavaClientCodegen.USE_GZIP_FEATURE, "false"); options.put(JavaClientCodegen.USE_RUNTIME_EXCEPTION, "false"); options.put(JavaClientCodegen.JAVA8_MODE, "false"); + options.put(JavaClientCodegen.NOT_NULL_JACKSON_ANNOTATION, "false"); + options.put(JavaClientCodegen.IGNORE_UNKNOWN_JACKSON_ANNOTATION, "false"); return options; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaOptionsProvider.java index f870adef42f..96a6baceab7 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaOptionsProvider.java @@ -31,10 +31,12 @@ public class JavaOptionsProvider implements OptionsProvider { public static final String FULL_JAVA_UTIL_VALUE = "true"; public static final String WITH_XML_VALUE = "false"; public static final String JAVA8_MODE_VALUE = "true"; + public static final String JAVA11_MODE_VALUE = "true"; public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; //public static final String SUPPORT_JAVA6 = "true"; public static final String USE_BEANVALIDATION = "false"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; + public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "@TestAnnotation"; private ImmutableMap options; @@ -69,12 +71,15 @@ public JavaOptionsProvider() { .put(JavaClientCodegen.FULL_JAVA_UTIL, FULL_JAVA_UTIL_VALUE) .put(JavaClientCodegen.WITH_XML, WITH_XML_VALUE) .put(JavaClientCodegen.JAVA8_MODE, JAVA8_MODE_VALUE) + .put(JavaClientCodegen.JAVA11_MODE, JAVA11_MODE_VALUE) .put(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, "true") .put(JavaClientCodegen.DATE_LIBRARY, "joda") .put(JavaClientCodegen.DISABLE_HTML_ESCAPING, "false") .put("hideGenerationTimestamp", "true") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) + .put(JavaClientCodegen.CHECK_DUPLICATED_MODEL_NAME, "false") //.put("supportJava6", "true") + .put(JavaClientCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, ADDITIONAL_MODEL_TYPE_ANNOTATIONS) .build(); } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JaxRSServerOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JaxRSServerOptionsProvider.java index a36534cf083..6141a919385 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JaxRSServerOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JaxRSServerOptionsProvider.java @@ -39,8 +39,10 @@ public class JaxRSServerOptionsProvider implements OptionsProvider { public static final String USE_BEANVALIDATION = "true"; public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; public static final String JAVA8_MODE_VALUE = "false"; + public static final String JAVA11_MODE_VALUE = "false"; public static final String WITH_XML_VALUE = "false"; public static final String USE_TAGS = "useTags"; + public static final String ADDITIONAL_MODEL_TYPE_ANNOTATIONS = "@TestAnnotation"; @Override @@ -58,7 +60,6 @@ public Map createOptions() { ImmutableMap.Builder builder = new ImmutableMap.Builder(); builder.put(CodegenConstants.IMPL_FOLDER, IMPL_FOLDER_VALUE) .put(JavaClientCodegen.DATE_LIBRARY, "joda") //java.lang.IllegalArgumentException: Multiple entries with same key: dateLibrary=joda and dateLibrary=joda - .put(JavaClientCodegen.SUPPORT_JAVA6, "false") .put("title", "Test title") .put(CodegenConstants.MODEL_PACKAGE, MODEL_PACKAGE_VALUE) .put(CodegenConstants.API_PACKAGE, API_PACKAGE_VALUE) @@ -86,14 +87,16 @@ public Map createOptions() { .put(CodegenConstants.LIBRARY, JAXRS_DEFAULT_LIBRARY_VALUE) .put(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, "true") .put(JavaClientCodegen.JAVA8_MODE, JAVA8_MODE_VALUE) + .put(JavaClientCodegen.JAVA11_MODE, JAVA11_MODE_VALUE) .put(JavaClientCodegen.WITH_XML, WITH_XML_VALUE) - //.put(JavaClientCodegen.DATE_LIBRARY, "joda") .put("hideGenerationTimestamp", "true") .put(JavaClientCodegen.DISABLE_HTML_ESCAPING, "false") .put(JavaCXFServerCodegen.USE_BEANVALIDATION, USE_BEANVALIDATION) .put("serverPort", "2345") .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) - .put(JavaJerseyServerCodegen.USE_TAGS, USE_TAGS); + .put(JavaJerseyServerCodegen.USE_TAGS, USE_TAGS) + .put(JavaClientCodegen.CHECK_DUPLICATED_MODEL_NAME, "false") + .put(JavaClientCodegen.ADDITIONAL_MODEL_TYPE_ANNOTATIONS, ADDITIONAL_MODEL_TYPE_ANNOTATIONS); return builder.build(); } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java index 924fbf5daff..0f6945e6c69 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/SpringOptionsProvider.java @@ -24,6 +24,8 @@ public class SpringOptionsProvider extends JavaOptionsProvider { public static final String USE_OPTIONAL = "false"; public static final String TARGET_OPENFEIGN = "false"; public static final String DEFAULT_INTERFACES = "true"; + public static final String NOT_NULL_JACKSON_ANNOTATION = "false"; + public static final String IGNORE_UNKNOWN_JACKSON_ANNOTATION = "false"; @Override public String getLanguage() { @@ -50,6 +52,8 @@ public Map createOptions() { options.put(SpringCodegen.USE_OPTIONAL, USE_OPTIONAL); options.put(SpringCodegen.TARGET_OPENFEIGN, TARGET_OPENFEIGN); options.put(SpringCodegen.DEFAULT_INTERFACES, DEFAULT_INTERFACES); + options.put(SpringCodegen.NOT_NULL_JACKSON_ANNOTATION,NOT_NULL_JACKSON_ANNOTATION); + options.put(SpringCodegen.IGNORE_UNKNOWN_JACKSON_ANNOTATION, IGNORE_UNKNOWN_JACKSON_ANNOTATION); return options; } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/UE4CPPOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/UE4CPPOptionsProvider.java new file mode 100644 index 00000000000..06341e424ce --- /dev/null +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/UE4CPPOptionsProvider.java @@ -0,0 +1,38 @@ +package io.swagger.codegen.options; + +import io.swagger.codegen.CodegenConstants; + +import com.google.common.collect.ImmutableMap; +import io.swagger.codegen.languages.UE4CPPGenerator; + +import java.util.Map; + +public class UE4CPPOptionsProvider implements OptionsProvider { + public static final String SORT_PARAMS_VALUE = "false"; + public static final String ENSURE_UNIQUE_PARAMS_VALUE = "true"; + public static final String ALLOW_UNICODE_IDENTIFIERS_VALUE = "false"; + public static final String CPP_NAMESPACE_VALUE = "Swagger"; + public static final String OPTIONAL_PROJECT_FILE_VALUE = "true"; + + + @Override + public String getLanguage() { + return "ue4cpp"; + } + + @Override + public Map createOptions() { + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + return builder.put(CodegenConstants.SORT_PARAMS_BY_REQUIRED_FLAG, SORT_PARAMS_VALUE) + .put(CodegenConstants.ENSURE_UNIQUE_PARAMS, ENSURE_UNIQUE_PARAMS_VALUE) + .put(CodegenConstants.ALLOW_UNICODE_IDENTIFIERS, ALLOW_UNICODE_IDENTIFIERS_VALUE) + .put(UE4CPPGenerator.CPP_NAMESPACE, CPP_NAMESPACE_VALUE) + .put(CodegenConstants.OPTIONAL_PROJECT_FILE, OPTIONAL_PROJECT_FILE_VALUE) + .build(); + } + + @Override + public boolean isServer() { + return false; + } +} diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientCodegenTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientCodegenTest.java index b2660d4776c..cac53546930 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientCodegenTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientCodegenTest.java @@ -37,4 +37,13 @@ public void testAdditionalPropertiesPutForConfigValues() throws Exception { Assert.assertEquals(codegen.isHideGenerationTimestamp(), false); } + @Test + public void testProjectNameCharacters() { + String projectName = ";import os; -;os.system('ping localhost');x=b;_yy="; + Assert.assertEquals(projectName.replaceAll("[^a-zA-Z0-9\\s\\-_]",""), "import os -ossystemping localhostxb_yy"); + Assert.assertEquals("petstore-api".replaceAll("[^a-zA-Z0-9\\s\\-_]",""), "petstore-api"); + Assert.assertEquals("petstore_api2".replaceAll("[^a-zA-Z0-9\\s\\-_]",""), "petstore_api2"); + Assert.assertEquals("petstore api".replaceAll("[^a-zA-Z0-9\\s\\-_]",""), "petstore api"); + } + } diff --git a/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientOptionsTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientOptionsTest.java index 0ded3781592..90016ccaa5a 100644 --- a/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientOptionsTest.java +++ b/modules/swagger-codegen/src/test/java/io/swagger/codegen/python/PythonClientOptionsTest.java @@ -26,7 +26,6 @@ protected CodegenConfig getCodegenConfig() { @Override protected void setExpectations() { new Expectations(clientCodegen) {{ - clientCodegen.setPackageName(PythonClientOptionsProvider.PACKAGE_NAME_VALUE); clientCodegen.setProjectName(PythonClientOptionsProvider.PROJECT_NAME_VALUE); clientCodegen.setPackageVersion(PythonClientOptionsProvider.PACKAGE_VERSION_VALUE); clientCodegen.setPackageUrl(PythonClientOptionsProvider.PACKAGE_URL_VALUE); diff --git a/modules/swagger-codegen/src/test/resources/2_0/issue-10546.yaml b/modules/swagger-codegen/src/test/resources/2_0/issue-10546.yaml new file mode 100644 index 00000000000..1464b200d24 --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/issue-10546.yaml @@ -0,0 +1,46 @@ +swagger: '2.0' +info: + description: Demo + version: 1.0.0 + title: Demo for Boolean-element Bug +schemes: + - https +consumes: + - application/json +produces: + - application/json +paths: + /types: + get: + produces: + - application/json + responses: + 200: + description: OK +definitions: + Boolean: + type: boolean + description: True or False indicator + enum: + - true + - false + Interos: + type: integer + format: int32 + description: True or False indicator + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + Numeros: + type: number + description: some number + enum: + - 7 + - 8 + - 9 + - 10 diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml index 5c19544ca98..179de245c0a 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1466,6 +1466,32 @@ definitions: type: string OuterBoolean: type: boolean + Boolean: + type: boolean + description: True or False indicator + enum: + - true + - false + Ints: + type: integer + format: int32 + description: True or False indicator + enum: + - 0 + - 1 + - 2 + - 3 + - 4 + - 5 + - 6 + Numbers: + type: number + description: some number + enum: + - 7 + - 8 + - 9 + - 10 externalDocs: description: Find out more about Swagger url: 'http://swagger.io' diff --git a/modules/swagger-codegen/src/test/resources/2_0/petstore-with-https.yaml b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-https.yaml new file mode 100644 index 00000000000..88b8f44d538 --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/petstore-with-https.yaml @@ -0,0 +1,717 @@ +--- +swagger: '2.0' +info: + description: 'This is a sample server Petstore server. You can find out more about + Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For + this sample, you can use the api key `special-key` to test the authorization filters.' + version: 1.0.5 + title: Swagger Petstore + termsOfService: http://swagger.io/terms/ + contact: + email: apiteam@swagger.io + license: + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html +host: petstore.swagger.io +basePath: "/v2" +tags: + - name: pet + description: Everything about your Pets + externalDocs: + description: Find out more + url: http://swagger.io + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user + externalDocs: + description: Find out more about our store + url: http://swagger.io +schemes: + - https + - http +paths: + "/pet/{petId}/uploadImage": + post: + tags: + - pet + 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 + responses: + '200': + description: successful operation + schema: + "$ref": "#/definitions/ApiResponse" + security: + - petstore_auth: + - write:pets + - read:pets + "/pet": + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + consumes: + - application/json + - application/xml + produces: + - application/json + - application/xml + parameters: + - in: body + name: body + description: Pet object that needs to be added to the store + required: true + schema: + "$ref": "#/definitions/Pet" + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + consumes: + - application/json + - application/xml + produces: + - application/json + - application/xml + parameters: + - in: body + name: body + description: Pet object that needs to be added to the store + required: true + schema: + "$ref": "#/definitions/Pet" + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - write:pets + - read:pets + "/pet/findByStatus": + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + produces: + - application/json + - application/xml + 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: multi + responses: + '200': + description: successful operation + schema: + type: array + items: + "$ref": "#/definitions/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 + produces: + - application/json + - application/xml + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + type: array + items: + type: string + collectionFormat: multi + responses: + '200': + description: successful operation + schema: + type: array + items: + "$ref": "#/definitions/Pet" + '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 + produces: + - application/json + - application/xml + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + type: integer + format: int64 + responses: + '200': + description: successful operation + schema: + "$ref": "#/definitions/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 + consumes: + - application/x-www-form-urlencoded + produces: + - application/json + - application/xml + 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 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - write:pets + - read:pets + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + produces: + - application/json + - application/xml + parameters: + - name: api_key + in: header + required: false + type: string + - name: petId + in: path + description: Pet id to delete + required: true + type: integer + format: int64 + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - petstore_auth: + - write:pets + - read:pets + "/store/order": + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + consumes: + - application/json + produces: + - application/json + - application/xml + 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" + '400': + description: Invalid Order + "/store/order/{orderId}": + get: + tags: + - store + summary: Find purchase order by ID + description: For valid response try integer IDs with value >= 1 and <= 10. Other + values will generated exceptions + operationId: getOrderById + produces: + - application/json + - application/xml + parameters: + - name: orderId + in: path + description: ID of pet that needs to be fetched + required: true + type: integer + maximum: 10 + minimum: 1 + format: int64 + responses: + '200': + description: successful operation + schema: + "$ref": "#/definitions/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 positive integer value. + Negative or non-integer values will generate API errors + operationId: deleteOrder + produces: + - application/json + - application/xml + parameters: + - name: orderId + in: path + description: ID of the order that needs to be deleted + required: true + type: integer + minimum: 1 + format: int64 + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + "/store/inventory": + get: + tags: + - store + 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 + security: + - api_key: [] + "/user/createWithArray": + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + consumes: + - application/json + produces: + - application/json + - application/xml + parameters: + - in: body + name: body + description: List of user object + required: true + schema: + type: array + items: + "$ref": "#/definitions/User" + responses: + default: + description: successful operation + "/user/createWithList": + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + consumes: + - application/json + produces: + - application/json + - application/xml + parameters: + - in: body + name: body + description: List of user object + required: true + schema: + type: array + items: + "$ref": "#/definitions/User" + responses: + default: + description: successful operation + "/user/{username}": + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + produces: + - application/json + - application/xml + parameters: + - name: username + in: path + description: 'The name that needs to be fetched. Use user1 for testing. ' + required: true + type: string + responses: + '200': + description: successful operation + schema: + "$ref": "#/definitions/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 + consumes: + - application/json + produces: + - application/json + - application/xml + parameters: + - name: username + in: path + description: name that need to be updated + required: true + type: string + - in: body + name: body + description: Updated user object + required: true + schema: + "$ref": "#/definitions/User" + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + produces: + - application/json + - application/xml + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + "/user/login": + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + produces: + - application/json + - application/xml + parameters: + - name: username + in: query + description: The user name for login + required: true + type: string + - name: password + in: query + description: The password for login in clear text + required: true + type: string + responses: + '200': + description: successful operation + headers: + X-Expires-After: + type: string + format: date-time + description: date in UTC when token expires + X-Rate-Limit: + type: integer + format: int32 + description: calls per hour allowed by the user + 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 + produces: + - application/json + - application/xml + parameters: [] + responses: + default: + description: successful operation + "/user": + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + consumes: + - application/json + produces: + - application/json + - application/xml + parameters: + - in: body + name: body + description: Created user object + required: true + schema: + "$ref": "#/definitions/User" + responses: + default: + description: successful operation +securityDefinitions: + api_key: + type: apiKey + name: api_key + in: header + petstore_auth: + type: oauth2 + authorizationUrl: https://petstore.swagger.io/oauth/authorize + flow: implicit + scopes: + read:pets: read your pets + write:pets: modify pets in your account +definitions: + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Category: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Category + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + category: + "$ref": "#/definitions/Category" + name: + type: string + example: doggie + photoUrls: + type: array + xml: + wrapped: true + items: + type: string + xml: + name: photoUrl + tags: + type: array + xml: + wrapped: true + items: + xml: + name: tag + "$ref": "#/definitions/Tag" + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + 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 + xml: + name: Order + User: + 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 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io diff --git a/modules/swagger-codegen/src/test/resources/2_0/recursive_model.yaml b/modules/swagger-codegen/src/test/resources/2_0/recursive_model.yaml new file mode 100644 index 00000000000..f4051384b62 --- /dev/null +++ b/modules/swagger-codegen/src/test/resources/2_0/recursive_model.yaml @@ -0,0 +1,30 @@ +swagger: '2.0' +info: + title: My API + version: v1 +paths: + /api/test: + get: + tags: + - TestClass + produces: + - text/plain + - application/json + - text/json + responses: + '200': + description: Success + schema: + type: array + items: + $ref: '#/definitions/TestClass' +definitions: + TestClass: + type: object + properties: + name: + type: string + children: + type: array + items: + $ref: '#/definitions/TestClass' \ No newline at end of file diff --git a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache index 96df77be8e9..8ec0023738d 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache +++ b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/ApiClient.mustache @@ -27,6 +27,7 @@ import java.io.InputStream; {{^supportJava6}} import java.nio.file.Files; +import java.nio.file.Paths; import java.nio.file.StandardCopyOption; {{/supportJava6}} {{#supportJava6}} @@ -624,9 +625,9 @@ public class ApiClient { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** diff --git a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache index 98a0e9473a8..a3d4b1083a6 100644 --- a/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache +++ b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache @@ -307,6 +307,6 @@ 3.5 {{/supportJava6}} 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-generator/pom.xml b/modules/swagger-generator/pom.xml index 2bb77fe82e5..311b6388e25 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.4.11-SNAPSHOT + 2.4.22-SNAPSHOT ../.. swagger-generator @@ -303,7 +303,7 @@ 1.0.0 2.5 1.3.2 - 9.4.20.v20190813 + 9.4.34.v20201102 2.29.1 diff --git a/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java b/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java index 2435a3170ca..2ed426d43ee 100644 --- a/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java +++ b/modules/swagger-generator/src/main/java/io/swagger/generator/online/Generator.java @@ -15,6 +15,7 @@ import org.slf4j.LoggerFactory; import java.io.File; +import java.nio.file.Files; import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; @@ -173,9 +174,7 @@ public static InputOption serverOptions(@SuppressWarnings("unused") String langu protected static File getTmpFolder() { try { - File outputFolder = File.createTempFile("codegen-", "-tmp"); - outputFolder.delete(); - outputFolder.mkdir(); + File outputFolder = Files.createTempDirectory("codegen-").toFile(); outputFolder.deleteOnExit(); return outputFolder; } catch (Exception e) { diff --git a/pom.xml b/pom.xml index c54073bd10d..75db83a5372 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.11-SNAPSHOT + 2.4.22-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -83,9 +83,9 @@ --> - 1.7 - 1.7 - 1.7 + 1.8 + 1.8 + 1.8 LF @@ -159,8 +159,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -195,7 +195,7 @@ 2.10.4 true - 1.7 + 1.8 UTF-8 1g ${javadoc.package.exclude} @@ -408,18 +408,6 @@ samples/client/petstore/java/jersey2 - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - java-client-okhttp-gson @@ -847,11 +835,15 @@ samples/client/petstore/python samples/client/petstore/python-asyncio + + + - - - 1.7 - 1.7 - 1.7 - LF - - - - org.apache.maven.plugins - maven-checkstyle-plugin - 2.17 - - - validate - validate - - google_checkstyle.xml - - ${project.build.sourceDirectory} - UTF-8 - true - true - false - - - check - - - - - - com.puppycrawl.tools - checkstyle - 6.19 - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-version} - - none:none - -XX:+StartAttachListener - - - - test-testng - test - - test - - - none:none - org.testng:testng - - - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 3.0.2 - - - - development - ${project.url} - ${project.version} - io.swagger - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - true - 1.7 - UTF-8 - 1g - ${javadoc.package.exclude} - - - - attach-javadocs - verify - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - verify - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.4.1 - - - enforce-versions - - enforce - - - - - 3.2.5 - - - - - - - - - - - net.revelc.code - formatter-maven-plugin - 0.5.2 - - - - - - - release-profile - - true - - - - - net.alchim31.maven - scala-maven-plugin - - - - compile - testCompile - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - prepare-package - - add-source - - - - src/main/scala - - - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - - - - android-client - - - env - java - - - - samples/client/petstore/android/volley - - - - bash-client - - - env - java - - - - samples/client/petstore/bash - - - - clojure-client - - - env - clojure - - - - samples/client/petstore/clojure - - - - haskell-http-client - - - env - haskell-http-client - - - - samples/client/petstore/haskell-http-client - - - - haskell-http-client-integration-test - - - env - haskell-http-client - - - - samples/client/petstore/haskell-http-client/tests-integration - - - - java-client-jersey1 - - - env - java - - - - samples/client/petstore/java/jersey1 - - - - java-client-jersey2 - - - env - java - - - - samples/client/petstore/java/jersey2 - - - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - - - java-client-okhttp-gson - - - env - java - - - - samples/client/petstore/java/okhttp-gson - - - - java-client-okhttp-gson-parcelable - - - env - java - - - - samples/client/petstore/java/okhttp-gson/parcelableModel - - - - java-client-retrofit - - - env - java - - - - samples/client/petstore/java/retrofit - - - - java-client-retrofit2 - - - env - java - - - - samples/client/petstore/java/retrofit2 - - - - java-client-retrofit2-rx - - - env - java - - - - samples/client/petstore/java/retrofit2rx - - - - java-client-feign - - - env - java - - - - samples/client/petstore/java/feign - - - - javascript-client - - - env - javascript - - - - samples/client/petstore/javascript - - - - scala-client - - - env - scala - - - - samples/client/petstore/scala - - - - objc-client - - - env - objc - - - - samples/client/petstore/objc/default/SwaggerClientTests - - - - swift-client - - - env - swift - - - - samples/client/petstore/swift/default/SwaggerClientTests - - - - java-msf4j-server - - - env - java - - - - samples/server/petstore/java-msf4/ - - - - jaxrs-cxf-server - - - env - java - - - - samples/server/petstore/jaxrs-cxf - - - - jaxrs-resteasy-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/default - - - - jaxrs-resteasy-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/joda - - - - jaxrs-resteasy-eap-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap - - - - jaxrs-resteasy-eap-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-joda - - - - jaxrs-server - - - env - java - - - - samples/server/petstore/jaxrs/jersey2 - - - - jaxrs-server-jersey1 - - - env - java - - - - samples/server/petstore/jaxrs/jersey1 - - - - typescript-fetch-client-tests-default - - - env - java - - - - samples/client/petstore/typescript-fetch/tests/default - - - - typescript-fetch-client-builds-default - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/default - - - - typescript-fetch-client-builds-es6-target - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/es6-target - - - - typescript-fetch-client-builds-with-npm-version - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/with-npm-version - - - - typescript-angularjs-client - - - env - java - - - - samples/client/petstore/typescript-angularjs/npm - - - - typescript-node-npm-client - - - env - java - - - - samples/client/petstore/typescript-node/npm - - - - python-client - - - env - java - - - - samples/client/petstore/python - - - - ruby-client - - - env - java - - - - samples/client/petstore/ruby - - - - go-client - - - env - java - - - - samples/client/petstore/go - - - - spring-mvc - - - env - java - - - - samples/server/petstore/spring-mvc - - - - springboot-beanvalidation - - - env - java - - - - samples/server/petstore/springboot-beanvalidation - - - - springboot - - - env - java - - - - samples/server/petstore/springboot - - - - spring-cloud - - - env - java - - - - samples/client/petstore/spring-cloud - - - - scalatra-server - - - env - java - - - - samples/server/petstore/scalatra - - - - java-inflector - - - env - java - - - - samples/server/petstore/java-inflector - - - - java-undertowr - - - env - java - - - - samples/server/petstore/undertow - - - - samples - - - env - samples - - - - samples/client/petstore/bash - - - - - modules/swagger-codegen - modules/swagger-codegen-cli - modules/swagger-codegen-maven-plugin - modules/swagger-generator - - - target/site - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - org.apache.maven.plugins - maven-jxr-plugin - 2.5 - - true - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.9 - - - - project-team - - - - - - - - - - org.yaml - snakeyaml - ${snakeyaml-version} - - - junit - junit - ${junit-version} - test - - - org.testng - testng - ${testng-version} - test - - - org.jmockit - jmockit - ${jmockit-version} - test - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.0.49-SNAPSHOT - 2.11.1 - 3.3.0 - 1.6.1-SNAPSHOT - 2.4 - 1.2 - 4.8.1 - 2.10.1 - 1.0.0 - 3.4 - 1.7.12 - 3.2.1 - 1.12 - 6.9.6 - 2.19.1 - 1.25 - 0.9.11 - 1.24 - - diff --git a/pom.xml.circleci b/pom.xml.circleci deleted file mode 100644 index bc74fc7c770..00000000000 --- a/pom.xml.circleci +++ /dev/null @@ -1,984 +0,0 @@ - - - - org.sonatype.oss - oss-parent - 5 - - 4.0.0 - io.swagger - swagger-codegen-project - pom - swagger-codegen-project - 2.4.11-SNAPSHOT - https://github.com/swagger-api/swagger-codegen - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - - - - fehguy - Tony Tam - fehguy@gmail.com - - - wing328 - William Cheng - wing328hk@gmail.com - - - - github - https://github.com/swagger-api/swagger-codegen/issues - - - - swagger-swaggersocket - https://groups.google.com/forum/#!forum/swagger-swaggersocket - - - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - src/main/java - target/classes - - - org.jvnet.wagon-svn - wagon-svn - 1.8 - - - org.apache.maven.wagon - wagon-ssh-external - 1.0-alpha-6 - - - org.apache.maven.wagon - wagon-webdav - 1.0-beta-1 - - - install - target - ${project.artifactId}-${project.version} - - - net.revelc.code - formatter-maven-plugin - - - - 1.7 - 1.7 - 1.7 - LF - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-version} - - none:none - -XX:+StartAttachListener - - - - test-testng - test - - test - - - none:none - org.testng:testng - - - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 3.0.2 - - - - development - ${project.url} - ${project.version} - io.swagger - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - true - 1.7 - UTF-8 - 1g - ${javadoc.package.exclude} - - - - attach-javadocs - verify - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - verify - - jar-no-fork - - - - - - - - - net.revelc.code - formatter-maven-plugin - 0.5.2 - - - - - - - release-profile - - true - - - - - net.alchim31.maven - scala-maven-plugin - - - - compile - testCompile - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - prepare-package - - add-source - - - - src/main/scala - - - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - - - - android-client - - - env - java - - - - samples/client/petstore/android/volley - - - - bash-client - - - env - java - - - - samples/client/petstore/bash - - - - clojure-client - - - env - clojure - - - - samples/client/petstore/clojure - - - - java-client-jersey1 - - - env - java - - - - samples/client/petstore/java/jersey1 - - - - java-client-jersey2 - - - env - java - - - - samples/client/petstore/java/jersey2 - - - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - - - java-client-okhttp-gson - - - env - java - - - - samples/client/petstore/java/okhttp-gson - - - - java-client-okhttp-gson-parcelable - - - env - java - - - - samples/client/petstore/java/okhttp-gson/parcelableModel - - - - java-client-retrofit - - - env - java - - - - samples/client/petstore/java/retrofit - - - - java-client-retrofit2 - - - env - java - - - - samples/client/petstore/java/retrofit2 - - - - java-client-retrofit2-rx - - - env - java - - - - samples/client/petstore/java/retrofit2rx - - - - java-client-feign - - - env - java - - - - samples/client/petstore/java/feign - - - - javascript-client - - - env - javascript - - - - samples/client/petstore/javascript - - - - scala-client - - - env - scala - - - - samples/client/petstore/scala - - - - objc-client - - - env - objc - - - - samples/client/petstore/objc/default/SwaggerClientTests - - - - swift-client - - - env - swift - - - - samples/client/petstore/swift/default/SwaggerClientTests - - - - java-msf4j-server - - - env - java - - - - samples/server/petstore/java-msf4/ - - - - jaxrs-cxf-server - - - env - java - - - - samples/server/petstore/jaxrs-cxf - - - - jaxrs-resteasy-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/default - - - - jaxrs-resteasy-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/joda - - - - jaxrs-resteasy-eap-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap - - - - jaxrs-resteasy-eap-server-java8 - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-java8 - - - - jaxrs-resteasy-eap-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-joda - - - - jaxrs-server - - - env - java - - - - samples/server/petstore/jaxrs/jersey2 - - - - jaxrs-server-jersey1 - - - env - java - - - - samples/server/petstore/jaxrs/jersey1 - - - - typescript-fetch-client-tests-default - - - env - java - - - - samples/client/petstore/typescript-fetch/tests/default - - - - typescript-fetch-client-builds-default - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/default - - - - typescript-fetch-client-builds-es6-target - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/es6-target - - - - typescript-fetch-client-builds-with-npm-version - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/with-npm-version - - - - typescript-angularjs-client - - - env - java - - - - samples/client/petstore/typescript-angularjs/npm - - - - typescript-node-npm-client - - - env - java - - - - samples/client/petstore/typescript-node/npm - - - - python-client - - - env - java - - - - samples/client/petstore/python - - - - ruby-client - - - env - java - - - - samples/client/petstore/ruby - - - - go-client - - - env - java - - - - samples/client/petstore/go - - - - spring-mvc - - - env - java - - - - samples/server/petstore/spring-mvc - - - - springboot-useoptional - - - env - java - - - - samples/server/petstore/springboot-useoptional - - - - springboot-beanvalidation - - - env - java - - - - samples/server/petstore/springboot-beanvalidation - - - - springboot - - - env - java - - - - samples/server/petstore/springboot - - - - spring-cloud - - - env - java - - - - samples/client/petstore/spring-cloud - - - - scalatra-server - - - env - java - - - - samples/server/petstore/scalatra - - - - java-inflector - - - env - java - - - - samples/server/petstore/java-inflector - - - - java-undertowr - - - env - java - - - - samples/server/petstore/undertow - - - - samples - - - env - samples - - - - - - samples/client/petstore/akka-scala - samples/client/petstore/scala - - samples/client/petstore/clojure - samples/client/petstore/java/feign - samples/client/petstore/java/jersey1 - samples/client/petstore/java/jersey2 - samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/retrofit - samples/client/petstore/java/retrofit2 - samples/client/petstore/java/retrofit2rx - samples/client/petstore/jaxrs-cxf-client - samples/client/petstore/java/resttemplate - samples/client/petstore/java/resttemplate-withXml - samples/client/petstore/java/vertx - samples/client/petstore/java/resteasy - samples/client/petstore/java/google-api-client - samples/client/petstore/java/rest-assured - samples/client/petstore/kotlin/ - samples/client/petstore/kotlin-threetenbp/ - samples/client/petstore/kotlin-string/ - - samples/client/petstore/go - - samples/server/petstore/java-vertx/rx - samples/server/petstore/java-vertx/async - samples/server/petstore/java-inflector - samples/server/petstore/java-pkmst - samples/server/petstore/java-play-framework - samples/server/petstore/java-play-framework-no-wrap-calls - samples/server/petstore/java-play-framework-no-swagger-ui - samples/server/petstore/java-play-framework-no-interface - samples/server/petstore/java-play-framework-no-exception-handling - samples/server/petstore/java-play-framework-no-bean-validation - samples/server/petstore/java-play-framework-fake-endpoints - samples/server/petstore/java-play-framework-controller-only - samples/server/petstore/java-play-framework-api-package-override - samples/server/petstore/undertow - samples/server/petstore/jaxrs/jersey1 - samples/server/petstore/jaxrs/jersey2 - samples/server/petstore/jaxrs/jersey1-useTags - samples/server/petstore/jaxrs/jersey2-useTags - samples/server/petstore/jaxrs-datelib-j8 - samples/server/petstore/jaxrs-resteasy/default - samples/server/petstore/jaxrs-resteasy/eap - samples/server/petstore/jaxrs-resteasy/eap-joda - samples/server/petstore/jaxrs-resteasy/eap-java8 - samples/server/petstore/jaxrs-resteasy/joda - samples/server/petstore/spring-mvc - samples/server/petstore/spring-mvc-j8-async - samples/server/petstore/spring-mvc-j8-localdatetime - samples/client/petstore/spring-cloud - samples/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - samples/server/petstore/jaxrs-cxf - samples/server/petstore/jaxrs-cxf-annotated-base-path - samples/server/petstore/jaxrs-cxf-cdi - samples/server/petstore/jaxrs-cxf-non-spring-app - samples/server/petstore/java-msf4j - samples/server/petstore/jaxrs-spec-interface - samples/server/petstore/scala-lagom-server - samples/server/petstore/scalatra - - - - - modules/swagger-codegen - modules/swagger-codegen-cli - modules/swagger-codegen-maven-plugin - modules/swagger-generator - - - target/site - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - org.apache.maven.plugins - maven-jxr-plugin - 2.5 - - true - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.9 - - - - project-team - - - - - - - - - - org.yaml - snakeyaml - ${snakeyaml-version} - - - junit - junit - ${junit-version} - test - - - org.testng - testng - ${testng-version} - test - - - org.jmockit - jmockit - ${jmockit-version} - test - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.0.49-SNAPSHOT - 2.11.1 - 3.3.0 - 1.6.1-SNAPSHOT - 2.4 - 1.2 - 4.8.1 - 2.10.1 - 1.0.0 - 3.4 - 1.7.12 - 3.2.1 - 1.12 - 6.9.6 - 2.19.1 - 1.25 - 0.9.11 - 1.24 - - diff --git a/pom.xml.circleci.java7 b/pom.xml.circleci.java7 deleted file mode 100644 index 40820ac1ab8..00000000000 --- a/pom.xml.circleci.java7 +++ /dev/null @@ -1,966 +0,0 @@ - - - - org.sonatype.oss - oss-parent - 5 - - 4.0.0 - io.swagger - swagger-codegen-project - pom - swagger-codegen-project - 2.4.11-SNAPSHOT - https://github.com/swagger-api/swagger-codegen - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - 2.2.0 - - - - fehguy - Tony Tam - fehguy@gmail.com - - - wing328 - William Cheng - wing328hk@gmail.com - - - - github - https://github.com/swagger-api/swagger-codegen/issues - - - - swagger-swaggersocket - https://groups.google.com/forum/#!forum/swagger-swaggersocket - - - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - src/main/java - target/classes - - - org.jvnet.wagon-svn - wagon-svn - 1.8 - - - org.apache.maven.wagon - wagon-ssh-external - 1.0-alpha-6 - - - org.apache.maven.wagon - wagon-webdav - 1.0-beta-1 - - - install - target - ${project.artifactId}-${project.version} - - - net.revelc.code - formatter-maven-plugin - - - - 1.7 - 1.7 - 1.7 - LF - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-version} - - none:none - -XX:+StartAttachListener - - - - test-testng - test - - test - - - none:none - org.testng:testng - - - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 3.0.2 - - - - development - ${project.url} - ${project.version} - io.swagger - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - true - 1.7 - UTF-8 - 1g - ${javadoc.package.exclude} - - - - attach-javadocs - verify - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - verify - - jar-no-fork - - - - - - - - - net.revelc.code - formatter-maven-plugin - 0.5.2 - - - - - - - release-profile - - true - - - - - net.alchim31.maven - scala-maven-plugin - - - - compile - testCompile - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - prepare-package - - add-source - - - - src/main/scala - - - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - - - - android-client - - - env - java - - - - samples/client/petstore/android/volley - - - - bash-client - - - env - java - - - - samples/client/petstore/bash - - - - clojure-client - - - env - clojure - - - - samples/client/petstore/clojure - - - - java-client-jersey1 - - - env - java - - - - samples/client/petstore/java/jersey1 - - - - java-client-jersey2 - - - env - java - - - - samples/client/petstore/java/jersey2 - - - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - - - java-client-okhttp-gson - - - env - java - - - - samples/client/petstore/java/okhttp-gson - - - - java-client-okhttp-gson-parcelable - - - env - java - - - - samples/client/petstore/java/okhttp-gson/parcelableModel - - - - java-client-retrofit - - - env - java - - - - samples/client/petstore/java/retrofit - - - - java-client-retrofit2 - - - env - java - - - - samples/client/petstore/java/retrofit2 - - - - java-client-retrofit2-rx - - - env - java - - - - samples/client/petstore/java/retrofit2rx - - - - java-client-feign - - - env - java - - - - samples/client/petstore/java/feign - - - - javascript-client - - - env - javascript - - - - samples/client/petstore/javascript - - - - scala-client - - - env - scala - - - - samples/client/petstore/scala - - - - objc-client - - - env - objc - - - - samples/client/petstore/objc/default/SwaggerClientTests - - - - swift-client - - - env - swift - - - - samples/client/petstore/swift/default/SwaggerClientTests - - - - java-msf4j-server - - - env - java - - - - samples/server/petstore/java-msf4/ - - - - jaxrs-cxf-server - - - env - java - - - - samples/server/petstore/jaxrs-cxf - - - - jaxrs-resteasy-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/default - - - - jaxrs-resteasy-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/joda - - - - jaxrs-resteasy-eap-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap - - - - jaxrs-resteasy-eap-server-java8 - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-java8 - - - - jaxrs-resteasy-eap-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-joda - - - - jaxrs-server - - - env - java - - - - samples/server/petstore/jaxrs/jersey2 - - - - jaxrs-server-jersey1 - - - env - java - - - - samples/server/petstore/jaxrs/jersey1 - - - - typescript-fetch-client-tests-default - - - env - java - - - - samples/client/petstore/typescript-fetch/tests/default - - - - typescript-fetch-client-builds-default - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/default - - - - typescript-fetch-client-builds-es6-target - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/es6-target - - - - typescript-fetch-client-builds-with-npm-version - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/with-npm-version - - - - typescript-angularjs-client - - - env - java - - - - samples/client/petstore/typescript-angularjs/npm - - - - typescript-node-npm-client - - - env - java - - - - samples/client/petstore/typescript-node/npm - - - - python-client - - - env - java - - - - samples/client/petstore/python - - - - ruby-client - - - env - java - - - - samples/client/petstore/ruby - - - - go-client - - - env - java - - - - samples/client/petstore/go - - - - spring-mvc - - - env - java - - - - samples/server/petstore/spring-mvc - - - - springboot-useoptional - - - env - java - - - - samples/server/petstore/springboot-useoptional - - - - springboot-beanvalidation - - - env - java - - - - samples/server/petstore/springboot-beanvalidation - - - - springboot - - - env - java - - - - samples/server/petstore/springboot - - - - spring-cloud - - - env - java - - - - samples/client/petstore/spring-cloud - - - - scalatra-server - - - env - java - - - - samples/server/petstore/scalatra - - - - java-inflector - - - env - java - - - - samples/server/petstore/java-inflector - - - - java-undertowr - - - env - java - - - - samples/server/petstore/undertow - - - - samples - - - env - samples - - - - - - samples/client/petstore/akka-scala - samples/client/petstore/scala - - samples/client/petstore/clojure - samples/client/petstore/java/feign - samples/client/petstore/java/jersey1 - samples/client/petstore/java/jersey2 - samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/retrofit - samples/client/petstore/java/retrofit2 - samples/client/petstore/java/retrofit2rx - samples/client/petstore/jaxrs-cxf-client - samples/client/petstore/java/resttemplate - samples/client/petstore/java/resttemplate-withXml - samples/client/petstore/java/vertx - samples/client/petstore/java/resteasy - samples/client/petstore/java/google-api-client - samples/client/petstore/kotlin/ - - samples/client/petstore/go - - samples/server/petstore/java-vertx/rx - samples/server/petstore/java-vertx/async - samples/server/petstore/java-inflector - samples/server/petstore/undertow - samples/server/petstore/jaxrs/jersey1 - samples/server/petstore/jaxrs/jersey2 - samples/server/petstore/jaxrs/jersey1-useTags - samples/server/petstore/jaxrs/jersey2-useTags - samples/server/petstore/jaxrs-resteasy/default - samples/server/petstore/jaxrs-resteasy/eap - samples/server/petstore/jaxrs-resteasy/eap-joda - samples/server/petstore/jaxrs-resteasy/eap-java8 - samples/server/petstore/jaxrs-resteasy/joda - samples/server/petstore/spring-mvc - samples/client/petstore/spring-cloud - samples/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - samples/server/petstore/jaxrs-cxf - samples/server/petstore/jaxrs-cxf-annotated-base-path - samples/server/petstore/jaxrs-cxf-cdi - samples/server/petstore/jaxrs-cxf-non-spring-app - samples/server/petstore/java-msf4j - samples/server/petstore/jaxrs-spec-interface - - - - - modules/swagger-codegen - modules/swagger-codegen-cli - modules/swagger-codegen-maven-plugin - modules/swagger-generator - - - target/site - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - org.apache.maven.plugins - maven-jxr-plugin - 2.5 - - true - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.9 - - - - project-team - - - - - - - - - - org.yaml - snakeyaml - ${snakeyaml-version} - - - junit - junit - ${junit-version} - test - - - org.testng - testng - ${testng-version} - test - - - org.jmockit - jmockit - ${jmockit-version} - test - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.0.49-SNAPSHOT - 2.11.1 - 3.3.0 - 1.6.1-SNAPSHOT - 2.4 - 1.2 - 4.8.1 - 2.10.1 - 1.0.0 - 3.4 - 1.7.12 - 3.2.1 - 1.12 - 6.9.6 - 2.19.1 - 1.25 - 0.9.11 - 1.24 - - diff --git a/pom.xml.ios b/pom.xml.ios deleted file mode 100644 index 89bb1d02378..00000000000 --- a/pom.xml.ios +++ /dev/null @@ -1,944 +0,0 @@ - - - org.sonatype.oss - oss-parent - 5 - - 4.0.0 - io.swagger - swagger-codegen-project - pom - swagger-codegen-project - 2.4.11-SNAPSHOT - https://github.com/swagger-api/swagger-codegen - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - - fehguy - Tony Tam - fehguy@gmail.com - - - wing328 - William Cheng - wing328hk@gmail.com - - - - github - https://github.com/swagger-api/swagger-codegen/issues - - - - swagger-swaggersocket - https://groups.google.com/forum/#!forum/swagger-swaggersocket - - - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - src/main/java - target/classes - - - org.jvnet.wagon-svn - wagon-svn - 1.8 - - - org.apache.maven.wagon - wagon-ssh-external - 1.0-alpha-6 - - - org.apache.maven.wagon - wagon-webdav - 1.0-beta-1 - - - install - target - ${project.artifactId}-${project.version} - - - net.revelc.code - formatter-maven-plugin - - - - 1.7 - 1.7 - 1.7 - LF - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-version} - - none:none - -XX:+StartAttachListener - - - - test-testng - test - - test - - - none:none - org.testng:testng - - - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 3.0.2 - - - - development - ${project.url} - ${project.version} - io.swagger - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - true - 1.7 - UTF-8 - 1g - ${javadoc.package.exclude} - - - - attach-javadocs - verify - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - verify - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.4.1 - - - enforce-versions - - enforce - - - - - 3.2.5 - - - - - - - - - - - net.revelc.code - formatter-maven-plugin - 0.5.2 - - - - - - - release-profile - - true - - - - - net.alchim31.maven - scala-maven-plugin - - - - compile - testCompile - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - prepare-package - - add-source - - - - src/main/scala - - - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - - - - android-client - - - env - java - - - - samples/client/petstore/android/volley - - - - bash-client - - - env - java - - - - samples/client/petstore/bash - - - - clojure-client - - - env - clojure - - - - samples/client/petstore/clojure - - - - haskell-http-client - - - env - haskell-http-client - - - - samples/client/petstore/haskell-http-client - - - - haskell-http-client-integration-test - - - env - haskell-http-client - - - - samples/client/petstore/haskell-http-client/tests-integration - - - - java-client-jersey1 - - - env - java - - - - samples/client/petstore/java/jersey1 - - - - java-client-jersey2 - - - env - java - - - - samples/client/petstore/java/jersey2 - - - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - - - java-client-okhttp-gson - - - env - java - - - - samples/client/petstore/java/okhttp-gson - - - - java-client-okhttp-gson-parcelable - - - env - java - - - - samples/client/petstore/java/okhttp-gson/parcelableModel - - - - java-client-retrofit - - - env - java - - - - samples/client/petstore/java/retrofit - - - - java-client-retrofit2 - - - env - java - - - - samples/client/petstore/java/retrofit2 - - - - java-client-retrofit2-rx - - - env - java - - - - samples/client/petstore/java/retrofit2rx - - - - java-client-feign - - - env - java - - - - samples/client/petstore/java/feign - - - - javascript-client - - - env - javascript - - - - samples/client/petstore/javascript - - - - scala-client - - - env - scala - - - - samples/client/petstore/scala - - - - objc-client - - - env - objc - - - - samples/client/petstore/objc/default/SwaggerClientTests - - - - swift-client - - - env - swift - - - - samples/client/petstore/swift/default/SwaggerClientTests - - - - java-msf4j-server - - - env - java - - - - samples/server/petstore/java-msf4/ - - - - jaxrs-cxf-server - - - env - java - - - - samples/server/petstore/jaxrs-cxf - - - - jaxrs-resteasy-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/default - - - - jaxrs-resteasy-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/joda - - - - jaxrs-resteasy-eap-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap - - - - jaxrs-resteasy-eap-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-joda - - - - jaxrs-server - - - env - java - - - - samples/server/petstore/jaxrs/jersey2 - - - - jaxrs-server-jersey1 - - - env - java - - - - samples/server/petstore/jaxrs/jersey1 - - - - typescript-fetch-client-tests-default - - - env - java - - - - samples/client/petstore/typescript-fetch/tests/default - - - - typescript-fetch-client-builds-default - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/default - - - - typescript-fetch-client-builds-es6-target - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/es6-target - - - - typescript-fetch-client-builds-with-npm-version - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/with-npm-version - - - - typescript-angularjs-client - - - env - java - - - - samples/client/petstore/typescript-angularjs/npm - - - - typescript-node-npm-client - - - env - java - - - - samples/client/petstore/typescript-node/npm - - - - python-client - - - env - java - - - - samples/client/petstore/python - - - - ruby-client - - - env - java - - - - samples/client/petstore/ruby - - - - go-client - - - env - java - - - - samples/client/petstore/go - - - - spring-mvc - - - env - java - - - - samples/server/petstore/spring-mvc - - - - springboot-beanvalidation - - - env - java - - - - samples/server/petstore/springboot-beanvalidation - - - - springboot - - - env - java - - - - samples/server/petstore/springboot - - - - spring-cloud - - - env - java - - - - samples/client/petstore/spring-cloud - - - - scalatra-server - - - env - java - - - - samples/server/petstore/scalatra - - - - java-inflector - - - env - java - - - - samples/server/petstore/java-inflector - - - - java-undertowr - - - env - java - - - - samples/server/petstore/undertow - - - - samples - - - env - samples - - - - samples/client/petstore/swift3/default/SwaggerClientTests - samples/client/petstore/swift3/promisekit/SwaggerClientTests - samples/client/petstore/swift3/rxswift/SwaggerClientTests - samples/client/petstore/swift/default/SwaggerClientTests - samples/client/petstore/swift/promisekit/SwaggerClientTests - samples/client/petstore/swift/rxswift/SwaggerClientTests - - - - - - modules/swagger-codegen - modules/swagger-codegen-cli - modules/swagger-codegen-maven-plugin - modules/swagger-generator - - - target/site - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - org.apache.maven.plugins - maven-jxr-plugin - 2.5 - - true - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.9 - - - - project-team - - - - - - - - - - org.yaml - snakeyaml - ${snakeyaml-version} - - - junit - junit - ${junit-version} - test - - - org.testng - testng - ${testng-version} - test - - - org.jmockit - jmockit - ${jmockit-version} - test - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.0.49-SNAPSHOT - 2.11.1 - 3.3.0 - 1.6.1-SNAPSHOT - 2.4 - 1.2 - 4.8.1 - 2.10.1 - 1.0.0 - 3.4 - 1.7.12 - 3.2.1 - 1.12 - 6.9.6 - 2.19.1 - 1.25 - 0.9.11 - 1.24 - - diff --git a/pom.xml.jenkins b/pom.xml.jenkins index 65b0949ba95..0b151dc8d3d 100644 --- a/pom.xml.jenkins +++ b/pom.xml.jenkins @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.11-SNAPSHOT + 2.4.22-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -83,9 +83,9 @@ --> - 1.7 - 1.7 - 1.7 + 1.8 + 1.8 + 1.8 LF @@ -159,8 +159,8 @@ maven-compiler-plugin 3.6.1 - 1.7 - 1.7 + 1.8 + 1.8 @@ -195,7 +195,7 @@ 2.10.4 true - 1.7 + 1.8 UTF-8 1g ${javadoc.package.exclude} @@ -408,18 +408,6 @@ samples/client/petstore/java/jersey2 - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - java-client-okhttp-gson @@ -868,7 +856,7 @@ samples/client/petstore/akka-scala samples/client/petstore/scala - samples/client/petstore/clojure + samples/client/petstore/java/feign samples/client/petstore/java/jersey1 samples/client/petstore/java/jersey2 @@ -882,12 +870,12 @@ samples/client/petstore/java/vertx samples/client/petstore/java/resteasy samples/client/petstore/java/google-api-client - samples/client/petstore/java/rest-assured + samples/client/petstore/kotlin/ samples/client/petstore/kotlin-threetenbp/ samples/client/petstore/kotlin-string/ - samples/client/petstore/go + samples/server/petstore/java-vertx/rx samples/server/petstore/java-vertx/async @@ -1004,14 +992,14 @@ - 1.0.49-SNAPSHOT + 1.0.55 2.11.1 3.3.0 - 1.6.1-SNAPSHOT + 1.6.2 2.4 1.2 - 4.8.1 - 2.10.1 + 4.13.1 + 2.11.4 1.0.0 3.4 1.7.12 diff --git a/pom.xml.jenkins.java7 b/pom.xml.jenkins.java7 deleted file mode 100644 index ba1ae334058..00000000000 --- a/pom.xml.jenkins.java7 +++ /dev/null @@ -1,948 +0,0 @@ - - - org.sonatype.oss - oss-parent - 5 - - 4.0.0 - io.swagger - swagger-codegen-project - pom - swagger-codegen-project - 2.4.11-SNAPSHOT - https://github.com/swagger-api/swagger-codegen - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - - fehguy - Tony Tam - fehguy@gmail.com - - - wing328 - William Cheng - wing328hk@gmail.com - - - - github - https://github.com/swagger-api/swagger-codegen/issues - - - - swagger-swaggersocket - https://groups.google.com/forum/#!forum/swagger-swaggersocket - - - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - src/main/java - target/classes - - - org.jvnet.wagon-svn - wagon-svn - 1.8 - - - org.apache.maven.wagon - wagon-ssh-external - 1.0-alpha-6 - - - org.apache.maven.wagon - wagon-webdav - 1.0-beta-1 - - - install - target - ${project.artifactId}-${project.version} - - - net.revelc.code - formatter-maven-plugin - - - - 1.7 - 1.7 - 1.7 - LF - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-version} - - none:none - -XX:+StartAttachListener - - - - test-testng - test - - test - - - none:none - org.testng:testng - - - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 3.0.2 - - - - development - ${project.url} - ${project.version} - io.swagger - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - true - 1.7 - UTF-8 - 1g - ${javadoc.package.exclude} - - - - attach-javadocs - verify - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - verify - - jar-no-fork - - - - - - - - - net.revelc.code - formatter-maven-plugin - 0.5.2 - - - - - - - release-profile - - true - - - - - net.alchim31.maven - scala-maven-plugin - - - - compile - testCompile - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - prepare-package - - add-source - - - - src/main/scala - - - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - - - - android-client - - - env - java - - - - samples/client/petstore/android/volley - - - - bash-client - - - env - java - - - - samples/client/petstore/bash - - - - clojure-client - - - env - clojure - - - - samples/client/petstore/clojure - - - - java-client-jersey1 - - - env - java - - - - samples/client/petstore/java/jersey1 - - - - java-client-jersey2 - - - env - java - - - - samples/client/petstore/java/jersey2 - - - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - - - java-client-okhttp-gson - - - env - java - - - - samples/client/petstore/java/okhttp-gson - - - - java-client-okhttp-gson-parcelable - - - env - java - - - - samples/client/petstore/java/okhttp-gson/parcelableModel - - - - java-client-retrofit - - - env - java - - - - samples/client/petstore/java/retrofit - - - - java-client-retrofit2 - - - env - java - - - - samples/client/petstore/java/retrofit2 - - - - java-client-retrofit2-rx - - - env - java - - - - samples/client/petstore/java/retrofit2rx - - - - java-client-feign - - - env - java - - - - samples/client/petstore/java/feign - - - - javascript-client - - - env - javascript - - - - samples/client/petstore/javascript - - - - scala-client - - - env - scala - - - - samples/client/petstore/scala - - - - objc-client - - - env - objc - - - - samples/client/petstore/objc/default/SwaggerClientTests - - - - swift-client - - - env - swift - - - - samples/client/petstore/swift/default/SwaggerClientTests - - - - java-msf4j-server - - - env - java - - - - samples/server/petstore/java-msf4/ - - - - jaxrs-cxf-server - - - env - java - - - - samples/server/petstore/jaxrs-cxf - - - - jaxrs-resteasy-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/default - - - - jaxrs-resteasy-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/joda - - - - jaxrs-resteasy-eap-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap - - - - jaxrs-resteasy-eap-server-java8 - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-java8 - - - - jaxrs-resteasy-eap-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-joda - - - - jaxrs-server - - - env - java - - - - samples/server/petstore/jaxrs/jersey2 - - - - jaxrs-server-jersey1 - - - env - java - - - - samples/server/petstore/jaxrs/jersey1 - - - - typescript-fetch-client-tests-default - - - env - java - - - - samples/client/petstore/typescript-fetch/tests/default - - - - typescript-fetch-client-builds-default - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/default - - - - typescript-fetch-client-builds-es6-target - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/es6-target - - - - typescript-fetch-client-builds-with-npm-version - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/with-npm-version - - - - typescript-angularjs-client - - - env - java - - - - samples/client/petstore/typescript-angularjs/npm - - - - typescript-node-npm-client - - - env - java - - - - samples/client/petstore/typescript-node/npm - - - - python-client - - - env - java - - - - samples/client/petstore/python - - - - ruby-client - - - env - java - - - - samples/client/petstore/ruby - - - - go-client - - - env - java - - - - samples/client/petstore/go - - - - spring-mvc - - - env - java - - - - samples/server/petstore/spring-mvc - - - - springboot-useoptional - - - env - java - - - - samples/server/petstore/springboot-useoptional - - - - springboot-beanvalidation - - - env - java - - - - samples/server/petstore/springboot-beanvalidation - - - - springboot - - - env - java - - - - samples/server/petstore/springboot - - - - spring-cloud - - - env - java - - - - samples/client/petstore/spring-cloud - - - - scalatra-server - - - env - java - - - - samples/server/petstore/scalatra - - - - java-inflector - - - env - java - - - - samples/server/petstore/java-inflector - - - - java-undertowr - - - env - java - - - - samples/server/petstore/undertow - - - - samples - - - env - samples - - - - - - samples/client/petstore/akka-scala - samples/client/petstore/scala - samples/client/petstore/clojure - samples/client/petstore/java/feign - samples/client/petstore/java/jersey1 - samples/client/petstore/java/jersey2 - samples/client/petstore/java/okhttp-gson - samples/client/petstore/java/retrofit - samples/client/petstore/java/retrofit2 - samples/client/petstore/java/retrofit2rx - samples/client/petstore/java/resttemplate - samples/client/petstore/java/resttemplate-withXml - samples/client/petstore/java/google-api-client - samples/client/petstore/kotlin/ - samples/client/petstore/go - - samples/server/petstore/java-inflector - samples/server/petstore/undertow - samples/server/petstore/jaxrs/jersey1 - samples/server/petstore/jaxrs/jersey2 - samples/server/petstore/jaxrs/jersey1-useTags - samples/server/petstore/jaxrs/jersey2-useTags - samples/server/petstore/jaxrs-resteasy/default - samples/server/petstore/jaxrs-resteasy/eap - samples/server/petstore/jaxrs-resteasy/eap-joda - samples/server/petstore/jaxrs-resteasy/joda - samples/server/petstore/spring-mvc - samples/client/petstore/spring-cloud - samples/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/jaxrs-spec-interface - - - - - modules/swagger-codegen - modules/swagger-codegen-cli - modules/swagger-codegen-maven-plugin - modules/swagger-generator - - - target/site - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - org.apache.maven.plugins - maven-jxr-plugin - 2.5 - - true - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.9 - - - - project-team - - - - - - - - - - org.yaml - snakeyaml - ${snakeyaml-version} - - - junit - junit - ${junit-version} - test - - - org.testng - testng - ${testng-version} - test - - - org.jmockit - jmockit - ${jmockit-version} - test - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.0.49-SNAPSHOT - 2.11.1 - 3.3.0 - 1.6.1-SNAPSHOT - 2.4 - 1.2 - 4.8.1 - 2.10.1 - 1.0.0 - 3.4 - 1.7.12 - 3.2.1 - 1.12 - 6.9.6 - 2.19.1 - 1.25 - 0.9.11 - 1.24 - - diff --git a/pom.xml.travis b/pom.xml.travis deleted file mode 100644 index 23ae8b8604b..00000000000 --- a/pom.xml.travis +++ /dev/null @@ -1,960 +0,0 @@ - - - org.sonatype.oss - oss-parent - 5 - - 4.0.0 - io.swagger - swagger-codegen-project - pom - swagger-codegen-project - 2.4.11-SNAPSHOT - https://github.com/swagger-api/swagger-codegen - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - - fehguy - Tony Tam - fehguy@gmail.com - - - wing328 - William Cheng - wing328hk@gmail.com - - - - github - https://github.com/swagger-api/swagger-codegen/issues - - - - swagger-swaggersocket - https://groups.google.com/forum/#!forum/swagger-swaggersocket - - - - - Apache License 2.0 - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - src/main/java - target/classes - - - org.jvnet.wagon-svn - wagon-svn - 1.8 - - - org.apache.maven.wagon - wagon-ssh-external - 1.0-alpha-6 - - - org.apache.maven.wagon - wagon-webdav - 1.0-beta-1 - - - install - target - ${project.artifactId}-${project.version} - - - net.revelc.code - formatter-maven-plugin - - - - 1.7 - 1.7 - 1.7 - LF - - - - - org.apache.maven.plugins - maven-surefire-plugin - ${surefire-version} - - none:none - -XX:+StartAttachListener - - - - test-testng - test - - test - - - none:none - org.testng:testng - - - - - - maven-dependency-plugin - - - package - - copy-dependencies - - - ${project.build.directory}/lib - - - - - - maven-compiler-plugin - 3.6.1 - - 1.7 - 1.7 - - - - org.apache.maven.plugins - maven-jar-plugin - 3.0.2 - - - - development - ${project.url} - ${project.version} - io.swagger - - - - - - org.apache.maven.plugins - maven-site-plugin - 3.5.1 - - - org.apache.maven.plugins - maven-release-plugin - 2.5.3 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - true - 1.7 - UTF-8 - 1g - ${javadoc.package.exclude} - - - - attach-javadocs - verify - - jar - - - - - - org.apache.maven.plugins - maven-source-plugin - 3.0.1 - - - attach-sources - verify - - jar-no-fork - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 1.4.1 - - - enforce-versions - - enforce - - - - - 3.2.5 - - - - - - - - - - - net.revelc.code - formatter-maven-plugin - 0.5.2 - - - - - - - release-profile - - true - - - - - net.alchim31.maven - scala-maven-plugin - - - - compile - testCompile - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - - - add-source - prepare-package - - add-source - - - - src/main/scala - - - - - - - - - - release-sign-artifacts - - - performRelease - true - - - - - - org.apache.maven.plugins - maven-gpg-plugin - - - sign-artifacts - verify - - sign - - - - - - - - - - android-client - - - env - java - - - - samples/client/petstore/android/volley - - - - bash-client - - - env - java - - - - samples/client/petstore/bash - - - - clojure-client - - - env - clojure - - - - samples/client/petstore/clojure - - - - haskell-http-client - - - env - haskell-http-client - - - - samples/client/petstore/haskell-http-client - - - - haskell-http-client-integration-test - - - env - haskell-http-client - - - - samples/client/petstore/haskell-http-client/tests-integration - - - - java-client-jersey1 - - - env - java - - - - samples/client/petstore/java/jersey1 - - - - java-client-jersey2 - - - env - java - - - - samples/client/petstore/java/jersey2 - - - - java-client-jersey2-java6 - - - env - java - - - - samples/client/petstore/java/jersey2-java6 - - - - java-client-okhttp-gson - - - env - java - - - - samples/client/petstore/java/okhttp-gson - - - - java-client-okhttp-gson-parcelable - - - env - java - - - - samples/client/petstore/java/okhttp-gson/parcelableModel - - - - java-client-retrofit - - - env - java - - - - samples/client/petstore/java/retrofit - - - - java-client-retrofit2 - - - env - java - - - - samples/client/petstore/java/retrofit2 - - - - java-client-retrofit2-rx - - - env - java - - - - samples/client/petstore/java/retrofit2rx - - - - java-client-feign - - - env - java - - - - samples/client/petstore/java/feign - - - - javascript-client - - - env - javascript - - - - samples/client/petstore/javascript - - - - scala-client - - - env - scala - - - - samples/client/petstore/scala - - - - objc-client - - - env - objc - - - - samples/client/petstore/objc/default/SwaggerClientTests - - - - swift-client - - - env - swift - - - - samples/client/petstore/swift/default/SwaggerClientTests - - - - java-msf4j-server - - - env - java - - - - samples/server/petstore/java-msf4/ - - - - jaxrs-cxf-server - - - env - java - - - - samples/server/petstore/jaxrs-cxf - - - - jaxrs-resteasy-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/default - - - - jaxrs-resteasy-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/joda - - - - jaxrs-resteasy-eap-server - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap - - - - jaxrs-resteasy-eap-server-joda - - - env - java - - - - samples/server/petstore/jaxrs-resteasy/eap-joda - - - - jaxrs-server - - - env - java - - - - samples/server/petstore/jaxrs/jersey2 - - - - jaxrs-server-jersey1 - - - env - java - - - - samples/server/petstore/jaxrs/jersey1 - - - - typescript-fetch-client-tests-default - - - env - java - - - - samples/client/petstore/typescript-fetch/tests/default - - - - typescript-fetch-client-builds-default - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/default - - - - typescript-fetch-client-builds-es6-target - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/es6-target - - - - typescript-fetch-client-builds-with-npm-version - - - env - java - - - - samples/client/petstore/typescript-fetch/builds/with-npm-version - - - - typescript-angularjs-client - - - env - java - - - - samples/client/petstore/typescript-angularjs/npm - - - - typescript-node-npm-client - - - env - java - - - - samples/client/petstore/typescript-node/npm - - - - python-client - - - env - java - - - - samples/client/petstore/python - - - - ruby-client - - - env - java - - - - samples/client/petstore/ruby - - - - go-client - - - env - java - - - - samples/client/petstore/go - - - - spring-mvc - - - env - java - - - - samples/server/petstore/spring-mvc - - - - springboot-beanvalidation - - - env - java - - - - samples/server/petstore/springboot-beanvalidation - - - - springboot - - - env - java - - - - samples/server/petstore/springboot - - - - spring-cloud - - - env - java - - - - samples/client/petstore/spring-cloud - - - - scalatra-server - - - env - java - - - - samples/server/petstore/scalatra - - - - java-inflector - - - env - java - - - - samples/server/petstore/java-inflector - - - - java-undertowr - - - env - java - - - - samples/server/petstore/undertow - - - - samples - - - env - samples - - - - - - samples/client/petstore/php/SwaggerClient-php - samples/client/petstore/ruby - samples/client/petstore/scala - samples/client/petstore/akka-scala - samples/client/petstore/javascript - samples/client/petstore/python - - samples/client/petstore/python-asyncio - samples/client/petstore/typescript-fetch/builds/default - samples/client/petstore/typescript-fetch/builds/es6-target - samples/client/petstore/typescript-fetch/builds/with-npm-version - samples/client/petstore/typescript-fetch/tests/default - samples/client/petstore/typescript-node/npm - - - - samples/client/petstore/typescript-angular-v4/npm - samples/client/petstore/typescript-angular-v4.3/npm - samples/client/petstore/typescript-angular-v5/npm - samples/client/petstore/typescript-angular-v6/npm - - - - - - modules/swagger-codegen - modules/swagger-codegen-cli - modules/swagger-codegen-maven-plugin - modules/swagger-generator - - - target/site - - - net.alchim31.maven - scala-maven-plugin - ${scala-maven-plugin-version} - - - org.apache.maven.plugins - maven-jxr-plugin - 2.5 - - true - - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 2.9 - - - - project-team - - - - - - - - - - org.yaml - snakeyaml - ${snakeyaml-version} - - - junit - junit - ${junit-version} - test - - - org.testng - testng - ${testng-version} - test - - - org.jmockit - jmockit - ${jmockit-version} - test - - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.0.49-SNAPSHOT - 2.11.1 - 3.3.0 - 1.6.1-SNAPSHOT - 2.4 - 1.2 - 4.8.1 - 2.10.1 - 1.0.0 - 3.4 - 1.7.12 - 3.2.1 - 1.12 - 6.9.6 - 2.19.1 - 1.25 - 0.9.11 - 1.24 - - diff --git a/run-in-docker.sh b/run-in-docker.sh index 6777d9a31b5..31c47764503 100755 --- a/run-in-docker.sh +++ b/run-in-docker.sh @@ -15,4 +15,4 @@ docker run --rm -it \ -v "${PWD}:/gen" \ -v "${maven_cache_repo}:/var/maven/.m2/repository" \ --entrypoint /gen/docker-entrypoint.sh \ - maven:3-jdk-7 "$@" + maven:3-jdk-8 "$@" diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/.swagger-codegen/VERSION b/samples/client/petstore-security-test/csharp/SwaggerClient/.swagger-codegen/VERSION index 50794f17f1a..855ff9501eb 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/.swagger-codegen/VERSION +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1-SNAPSHOT \ No newline at end of file +2.4.0-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/README.md b/samples/client/petstore-security-test/csharp/SwaggerClient/README.md index 4bc77a18568..cd7f6b810d1 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/README.md +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/README.md @@ -19,7 +19,7 @@ This C# SDK is automatically generated by the [Swagger Codegen](https://github.c - [Json.NET](https://www.nuget.org/packages/Newtonsoft.Json/) - 7.0.0 or later - [JsonSubTypes](https://www.nuget.org/packages/JsonSubTypes/) - 1.2.0 or later -The DLLs included in the package may not be the latest version. We recommend using [NuGet] (https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: +The DLLs included in the package may not be the latest version. We recommend using [NuGet](https://docs.nuget.org/consume/installing-nuget) to obtain the latest version of the packages: ``` Install-Package RestSharp Install-Package Newtonsoft.Json diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs index 91cf1610fc4..74980eb05f0 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs @@ -329,7 +329,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs index 7867fe5cda5..2730e73f9d5 100644 --- a/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs +++ b/samples/client/petstore-security-test/csharp/SwaggerClient/src/IO.Swagger/Model/Return.cs @@ -33,10 +33,10 @@ public partial class Return : IEquatable, IValidatableObject /// /// Initializes a new instance of the class. /// - /// property description *_/ ' \" =end - - \\r\\n \\n \\r. - public Return(int? _Return = default(int?)) + /// property description *_/ ' \" =end - - \\r\\n \\n \\r. + public Return(int? _return = default(int?)) { - this._Return = _Return; + this._Return = _return; } /// diff --git a/samples/client/petstore-security-test/go/.swagger-codegen/VERSION b/samples/client/petstore-security-test/go/.swagger-codegen/VERSION index a6254504e40..1bdaf4866d9 100644 --- a/samples/client/petstore-security-test/go/.swagger-codegen/VERSION +++ b/samples/client/petstore-security-test/go/.swagger-codegen/VERSION @@ -1 +1 @@ -2.3.1 \ No newline at end of file +2.4.20-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/go/api/swagger.yaml b/samples/client/petstore-security-test/go/api/swagger.yaml index 83e496744b5..7f3a6a8b40f 100644 --- a/samples/client/petstore-security-test/go/api/swagger.yaml +++ b/samples/client/petstore-security-test/go/api/swagger.yaml @@ -41,8 +41,9 @@ paths: required: false type: "string" x-exportParamName: "TestCodeInjectEndRnNR" + x-optionalDataType: "String" responses: - 400: + "400": description: "To test code injection */ ' \" =end -- \\r\\n \\n \\r" securityDefinitions: petstore_auth: @@ -63,9 +64,9 @@ definitions: type: "integer" format: "int32" description: "property description */ ' \" =end -- \\r\\n \\n \\r" - description: "Model for testing reserved words */ ' \" =end -- \\r\\n \\n \\r" xml: name: "Return" + description: "Model for testing reserved words */ ' \" =end -- \\r\\n \\n \\r" externalDocs: description: "Find out more about Swagger */ ' \" =end -- \\r\\n \\n \\r" url: "http://swagger.io" diff --git a/samples/client/petstore-security-test/go/api_fake.go b/samples/client/petstore-security-test/go/api_fake.go new file mode 100644 index 00000000000..a4c4305eac1 --- /dev/null +++ b/samples/client/petstore-security-test/go/api_fake.go @@ -0,0 +1,107 @@ + +/* + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "context" + "io/ioutil" + "net/http" + "net/url" + "strings" + "github.com/antihax/optional" +) + +// Linger please +var ( + _ context.Context +) + +type FakeApiService service + +/* +FakeApiService To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + * @param optional nil or *FakeApiTestCodeInjectEndRnNROpts - Optional Parameters: + * @param "TestCodeInjectEndRnNR" (optional.String) - To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + + +*/ + +type FakeApiTestCodeInjectEndRnNROpts struct { + TestCodeInjectEndRnNR optional.String +} + +func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOptionals *FakeApiTestCodeInjectEndRnNROpts) (*http.Response, error) { + var ( + localVarHttpMethod = strings.ToUpper("Put") + localVarPostBody interface{} + localVarFileName string + localVarFileBytes []byte + + ) + + // create path and map variables + localVarPath := a.client.cfg.BasePath + "/fake" + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHttpContentTypes := []string{"application/json", "*_/ ' =end -- "} + + // set Content-Type header + localVarHttpContentType := selectHeaderContentType(localVarHttpContentTypes) + if localVarHttpContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHttpContentType + } + + // to determine the Accept header + localVarHttpHeaderAccepts := []string{"application/json", "*_/ ' =end -- "} + + // set Accept header + localVarHttpHeaderAccept := selectHeaderAccept(localVarHttpHeaderAccepts) + if localVarHttpHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHttpHeaderAccept + } + if localVarOptionals != nil && localVarOptionals.TestCodeInjectEndRnNR.IsSet() { + localVarFormParams.Add("test code inject */ ' " =end -- \r\n \n \r", parameterToString(localVarOptionals.TestCodeInjectEndRnNR.Value(), "")) + } + r, err := a.client.prepareRequest(ctx, localVarPath, localVarHttpMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, localVarFileName, localVarFileBytes) + if err != nil { + return nil, err + } + + localVarHttpResponse, err := a.client.callAPI(r) + if err != nil || localVarHttpResponse == nil { + return localVarHttpResponse, err + } + + localVarBody, err := ioutil.ReadAll(localVarHttpResponse.Body) + localVarHttpResponse.Body.Close() + if err != nil { + return localVarHttpResponse, err + } + + + if localVarHttpResponse.StatusCode >= 300 { + newErr := GenericSwaggerError{ + body: localVarBody, + error: localVarHttpResponse.Status, + } + + return localVarHttpResponse, newErr + } + + return localVarHttpResponse, nil +} + diff --git a/samples/client/petstore-security-test/go/client.go b/samples/client/petstore-security-test/go/client.go new file mode 100644 index 00000000000..938472e6f59 --- /dev/null +++ b/samples/client/petstore-security-test/go/client.go @@ -0,0 +1,475 @@ +/* + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "mime/multipart" + "net/http" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "golang.org/x/oauth2" +) + +var ( + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") +) + +// APIClient manages communication with the Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r API v1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + FakeApi *FakeApiService +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(cfg *Configuration) *APIClient { + if cfg.HTTPClient == nil { + cfg.HTTPClient = http.DefaultClient + } + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.FakeApi = (*FakeApiService)(&c.common) + + return c +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insenstive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.ToLower(a) == strings.ToLower(needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("Expected %s to be of type %s but received %s.", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +// parameterToString convert interface{} parameters to string, using a delimiter if format is provided. +func parameterToString(obj interface{}, collectionFormat string) string { + var delimiter string + + switch collectionFormat { + case "pipes": + delimiter = "|" + case "ssv": + delimiter = " " + case "tsv": + delimiter = "\t" + case "csv": + delimiter = "," + } + + if reflect.TypeOf(obj).Kind() == reflect.Slice { + return strings.Trim(strings.Replace(fmt.Sprint(obj), " ", delimiter, -1), "[]") + } + + return fmt.Sprintf("%v", obj) +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + return c.cfg.HTTPClient.Do(request) +} + +// Change base path to allow switching to mocks +func (c *APIClient) ChangeBasePath(path string) { + c.cfg.BasePath = path +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + fileName string, + fileBytes []byte) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + if len(fileBytes) > 0 && fileName != "" { + w.Boundary() + //_, fileNm := filepath.Split(fileName) + part, err := w.CreateFormFile("file", filepath.Base(fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(fileBytes) + if err != nil { + return nil, err + } + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + } + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = query.Encode() + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers.Set(h, v) + } + localVarRequest.Header = headers + } + + // Override request host, if applicable + if c.cfg.Host != "" { + localVarRequest.Host = c.cfg.Host + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + // OAuth2 authentication + if tok, ok := ctx.Value(ContextOAuth2).(oauth2.TokenSource); ok { + // We were able to grab an oauth2 token from the context + var latestToken *oauth2.Token + if latestToken, err = tok.Token(); err != nil { + return nil, err + } + + latestToken.SetAuthHeader(localVarRequest) + } + + // Basic HTTP Authentication + if auth, ok := ctx.Value(ContextBasicAuth).(BasicAuth); ok { + localVarRequest.SetBasicAuth(auth.UserName, auth.Password) + } + + // AccessToken Authentication + if auth, ok := ctx.Value(ContextAccessToken).(string); ok { + localVarRequest.Header.Add("Authorization", "Bearer "+auth) + } + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if strings.Contains(contentType, "application/xml") { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } else if strings.Contains(contentType, "application/json") { + if err = json.Unmarshal(b, v); err != nil { + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(path) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if jsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if xmlCheck.MatchString(contentType) { + xml.NewEncoder(bodyBuf).Encode(body) + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("Invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } + expires = now.Add(lifetime) + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// GenericSwaggerError Provides access to the body, error and model on returned errors. +type GenericSwaggerError struct { + body []byte + error string + model interface{} +} + +// Error returns non-empty string if there was an error. +func (e GenericSwaggerError) Error() string { + return e.error +} + +// Body returns the raw bytes of the response +func (e GenericSwaggerError) Body() []byte { + return e.body +} + +// Model returns the unpacked model of the error +func (e GenericSwaggerError) Model() interface{} { + return e.model +} diff --git a/samples/client/petstore-security-test/go/docs/FakeApi.md b/samples/client/petstore-security-test/go/docs/FakeApi.md index 1d7dea697cc..6444f27fde8 100644 --- a/samples/client/petstore-security-test/go/docs/FakeApi.md +++ b/samples/client/petstore-security-test/go/docs/FakeApi.md @@ -16,14 +16,14 @@ To test code injection *_/ ' \" =end -- \\r\\n \\n \\r Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***TestCodeInjectEndRnNROpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiTestCodeInjectEndRnNROpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a TestCodeInjectEndRnNROpts struct +Optional parameters are passed through a pointer to a FakeApiTestCodeInjectEndRnNROpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **testCodeInjectEndRnNR** | **optional.**| To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | + **testCodeInjectEndRnNR** | **optional.String**| To test code injection *_/ ' \" =end -- \\r\\n \\n \\r | ### Return type diff --git a/samples/client/petstore-security-test/go/response.go b/samples/client/petstore-security-test/go/response.go new file mode 100644 index 00000000000..05fd1dc4e90 --- /dev/null +++ b/samples/client/petstore-security-test/go/response.go @@ -0,0 +1,44 @@ +/* + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * API version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "net/http" +) + +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the swagger operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/samples/client/petstore-security-test/java/okhttp-gson/build.sbt b/samples/client/petstore-security-test/java/okhttp-gson/build.sbt index 03c3ac9e231..890cd8a61ac 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/build.sbt +++ b/samples/client/petstore-security-test/java/okhttp-gson/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "okhttp" % "2.7.5", "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", "com.google.code.gson" % "gson" % "2.8.1", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore-security-test/java/okhttp-gson/pom.xml b/samples/client/petstore-security-test/java/okhttp-gson/pom.xml index 9fbc7d0e39d..f9fa294387f 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/pom.xml +++ b/samples/client/petstore-security-test/java/okhttp-gson/pom.xml @@ -206,12 +206,12 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 2.7.5 2.8.1 - 1.3.5 + 1.4.1 1.0.0 - 4.12 + 4.13.1 UTF-8 diff --git a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index 7e15b474c44..680f51acd79 100644 --- a/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore-security-test/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -1,6 +1,6 @@ /* * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- * * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r @@ -28,6 +28,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.nio.file.Files; +import java.nio.file.Paths; import java.lang.reflect.Type; import java.net.URLConnection; import java.net.URLEncoder; @@ -809,9 +811,9 @@ public File prepareDownloadFile(Response response) throws IOException { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** @@ -961,7 +963,7 @@ public Call buildCall(String path, String method, List queryParams, List

queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { diff --git a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php index c590d545773..5f2eb0eff73 100644 --- a/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore-security-test/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -277,7 +277,7 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -293,7 +293,7 @@ protected function testCodeInjectEndRnNRRequest($test_code_inject____end____rn_n $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore-security-test/ruby/Gemfile b/samples/client/petstore-security-test/ruby/Gemfile index d255a3ab238..f58bec06367 100644 --- a/samples/client/petstore-security-test/ruby/Gemfile +++ b/samples/client/petstore-security-test/ruby/Gemfile @@ -3,5 +3,5 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rake', '~> 12.0.0' + gem 'rake', '~> 12.3.3' end diff --git a/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb index 9e6ffd465a7..99d2d2eab1a 100644 --- a/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore-security-test/ruby/lib/petstore/models/model_return.rb @@ -87,7 +87,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } ) diff --git a/samples/client/petstore-security-test/scala/pom.xml b/samples/client/petstore-security-test/scala/pom.xml index dc83c236251..934e163b5a5 100644 --- a/samples/client/petstore-security-test/scala/pom.xml +++ b/samples/client/petstore-security-test/scala/pom.xml @@ -240,12 +240,12 @@ 1.9.2 2.9.9 1.19.4 - 1.5.18 + 1.5.24 1.0.5 1.0.0 2.9.2 - 4.12 + 4.13.1 3.1.5 3.0.4 0.3.5 diff --git a/samples/client/petstore/java/jersey2-java6/.swagger-codegen-ignore b/samples/client/petstore-security-test/ue4cpp/.swagger-codegen-ignore similarity index 100% rename from samples/client/petstore/java/jersey2-java6/.swagger-codegen-ignore rename to samples/client/petstore-security-test/ue4cpp/.swagger-codegen-ignore diff --git a/samples/client/petstore-security-test/ue4cpp/.swagger-codegen/VERSION b/samples/client/petstore-security-test/ue4cpp/.swagger-codegen/VERSION new file mode 100644 index 00000000000..4b308f2ac9e --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.15-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore-security-test/ue4cpp/Private/SwaggerBaseModel.cpp b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerBaseModel.cpp new file mode 100644 index 00000000000..0b0b87f1451 --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerBaseModel.cpp @@ -0,0 +1,27 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + ResponseCode = InHttpResponseCode; + SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode)); + if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout) + { + SetResponseString(TEXT("Request Timeout")); + } +} + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Private/SwaggerFakeApi.cpp b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerFakeApi.cpp new file mode 100644 index 00000000000..f1c6cb67026 --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerFakeApi.cpp @@ -0,0 +1,122 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerFakeApi.h" + +#include "SwaggerFakeApiOperations.h" +#include "SwaggerModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace Swagger +{ + +SwaggerFakeApi::SwaggerFakeApi() +: Url(TEXT("https://petstore.swagger.io *_/ ' \" =end -- \\r\\n \\n \\r/v2 *_/ ' \" =end -- \\r\\n \\n \\r")) +{ +} + +SwaggerFakeApi::~SwaggerFakeApi() {} + +void SwaggerFakeApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void SwaggerFakeApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void SwaggerFakeApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool SwaggerFakeApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogSwagger, Error, TEXT("SwaggerFakeApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void SwaggerFakeApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogSwagger, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +bool SwaggerFakeApi::TestCodeInjectEndRnNR(const TestCodeInjectEndRnNRRequest& Request, const FTestCodeInjectEndRnNRDelegate& Delegate /*= FTestCodeInjectEndRnNRDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerFakeApi::OnTestCodeInjectEndRnNRResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerFakeApi::OnTestCodeInjectEndRnNRResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FTestCodeInjectEndRnNRDelegate Delegate) const +{ + TestCodeInjectEndRnNRResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Private/SwaggerFakeApiOperations.cpp b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerFakeApiOperations.cpp new file mode 100644 index 00000000000..358905aa261 --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerFakeApiOperations.cpp @@ -0,0 +1,86 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerFakeApiOperations.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace Swagger +{ + +FString SwaggerFakeApi::TestCodeInjectEndRnNRRequest::ComputePath() const +{ + FString Path(TEXT("/fake")); + return Path; +} + +void SwaggerFakeApi::TestCodeInjectEndRnNRRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json"), TEXT("*_/ ' =end -- ") }; + //static const TArray Produces = { TEXT("application/json"), TEXT("*_/ ' =end -- ") }; + + HttpRequest->SetVerb(TEXT("PUT")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + UE_LOG(LogSwagger, Error, TEXT("Form parameter (test code inject */ ' " =end -- \r\n \n \r) was ignored, cannot be used in JsonBody")); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + HttpMultipartFormData FormData; + if(TestCodeInjectEndRnNR.IsSet()) + { + FormData.AddStringPart(TEXT("test code inject */ ' " =end -- \r\n \n \r"), *ToUrlString(TestCodeInjectEndRnNR.GetValue())); + } + + FormData.SetupHttpRequest(HttpRequest); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + TArray FormParams; + if(TestCodeInjectEndRnNR.IsSet()) + { + FormParams.Add(FString(TEXT("test code inject */ ' " =end -- \r\n \n \r=")) + ToUrlString(TestCodeInjectEndRnNR.GetValue())); + } + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerFakeApi::TestCodeInjectEndRnNRResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("To test code injection *_/ ' \" =end -- \\r\\n \\n \\r")); + break; + } +} + +bool SwaggerFakeApi::TestCodeInjectEndRnNRResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Private/SwaggerHelpers.cpp b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerHelpers.cpp new file mode 100644 index 00000000000..2592615083a --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerHelpers.cpp @@ -0,0 +1,193 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerHelpers.h" + +#include "SwaggerModule.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" + +namespace Swagger +{ + +HttpFileInput::HttpFileInput(const TCHAR* InFilePath) +{ + SetFilePath(InFilePath); +} + +HttpFileInput::HttpFileInput(const FString& InFilePath) +{ + SetFilePath(InFilePath); +} + +void HttpFileInput::SetFilePath(const TCHAR* InFilePath) +{ + FilePath = InFilePath; + if(ContentType.IsEmpty()) + { + ContentType = FPlatformHttp::GetMimeType(InFilePath); + } +} + +void HttpFileInput::SetFilePath(const FString& InFilePath) +{ + SetFilePath(*InFilePath); +} + +void HttpFileInput::SetContentType(const TCHAR* InContentType) +{ + ContentType = InContentType; +} + +FString HttpFileInput::GetFilename() const +{ + return FPaths::GetCleanFilename(FilePath); +} + +////////////////////////////////////////////////////////////////////////// + +const TCHAR* HttpMultipartFormData::Delimiter = TEXT("--"); +const TCHAR* HttpMultipartFormData::Newline = TEXT("\r\n"); + +void HttpMultipartFormData::SetBoundary(const TCHAR* InBoundary) +{ + checkf(Boundary.IsEmpty(), TEXT("Boundary must be set before usage")); + Boundary = InBoundary; +} + +const FString& HttpMultipartFormData::GetBoundary() const +{ + if (Boundary.IsEmpty()) + { + // Generate a random boundary with enough entropy, should avoid occurences of the boundary in the data. + // Since the boundary is generated at every request, in case of failure, retries should succeed. + Boundary = FGuid::NewGuid().ToString(EGuidFormats::Short); + } + + return Boundary; +} + +void HttpMultipartFormData::SetupHttpRequest(const TSharedRef& HttpRequest) +{ + if(HttpRequest->GetVerb() != TEXT("POST")) + { + UE_LOG(LogSwagger, Error, TEXT("Expected POST verb when using multipart form data")); + } + + // Append final boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Delimiter); + + HttpRequest->SetHeader("Content-Type", FString::Printf(TEXT("multipart/form-data; boundary=%s"), *GetBoundary())); + HttpRequest->SetContent(FormData); +} + +void HttpMultipartFormData::AddStringPart(const TCHAR* Name, const TCHAR* Data) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name = \"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: text/plain; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(Data); + AppendString(Newline); +} + +void HttpMultipartFormData::AddJsonPart(const TCHAR* Name, const FString& JsonString) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/json; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(*JsonString); + AppendString(Newline); +} + +void HttpMultipartFormData::AddBinaryPart(const TCHAR* Name, const TArray& ByteArray) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/octet-stream"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(ByteArray); + AppendString(Newline); +} + +void HttpMultipartFormData::AddFilePart(const TCHAR* Name, const HttpFileInput& File) +{ + TArray FileContents; + if (!FFileHelper::LoadFileToArray(FileContents, *File.GetFilePath())) + { + UE_LOG(LogSwagger, Error, TEXT("Failed to load file (%s)"), *File.GetFilePath()); + return; + } + + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\"; filename=\"%s\""), Name, *File.GetFilename())); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: %s"), *File.GetContentType())); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(FileContents); + AppendString(Newline); +} + +void HttpMultipartFormData::AppendString(const TCHAR* Str) +{ + FTCHARToUTF8 utf8Str(Str); + FormData.Append((uint8*)utf8Str.Get(), utf8Str.Length()); +} + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Private/SwaggerModule.cpp b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerModule.cpp new file mode 100644 index 00000000000..27afaf81227 --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerModule.cpp @@ -0,0 +1,24 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerModule.h" + +IMPLEMENT_MODULE(SwaggerModule, Swagger); +DEFINE_LOG_CATEGORY(LogSwagger); + +void SwaggerModule::StartupModule() +{ +} + +void SwaggerModule::ShutdownModule() +{ +} + diff --git a/samples/client/petstore-security-test/ue4cpp/Private/SwaggerModule.h b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerModule.h new file mode 100644 index 00000000000..dcb7541dbfd --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerModule.h @@ -0,0 +1,25 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogSwagger, Log, All); + +class SWAGGER_API SwaggerModule : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/samples/client/petstore-security-test/ue4cpp/Private/SwaggerReturn.cpp b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerReturn.cpp new file mode 100644 index 00000000000..be5a6c76ebf --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Private/SwaggerReturn.cpp @@ -0,0 +1,40 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerReturn.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +void SwaggerReturn::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Return.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("return")); WriteJsonValue(Writer, Return.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool SwaggerReturn::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("return"), Return); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore-security-test/ue4cpp/Public/SwaggerBaseModel.h b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerBaseModel.h new file mode 100644 index 00000000000..63af61f5677 --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerBaseModel.h @@ -0,0 +1,65 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" +#include "Serialization/JsonWriter.h" +#include "Dom/JsonObject.h" + +namespace Swagger +{ + +typedef TSharedRef> JsonWriter; + +class SWAGGER_API Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; +}; + +class SWAGGER_API Request +{ +public: + virtual ~Request() {} + virtual void SetupHttpRequest(const TSharedRef& HttpRequest) const = 0; + virtual FString ComputePath() const = 0; +}; + +class SWAGGER_API Response +{ +public: + virtual ~Response() {} + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; + + void SetSuccessful(bool InSuccessful) { Successful = InSuccessful; } + bool IsSuccessful() const { return Successful; } + + virtual void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode); + EHttpResponseCodes::Type GetHttpResponseCode() const { return ResponseCode; } + + void SetResponseString(const FString& InResponseString) { ResponseString = InResponseString; } + const FString& GetResponseString() const { return ResponseString; } + + void SetHttpResponse(const FHttpResponsePtr& InHttpResponse) { HttpResponse = InHttpResponse; } + const FHttpResponsePtr& GetHttpResponse() const { return HttpResponse; } + +private: + bool Successful; + EHttpResponseCodes::Type ResponseCode; + FString ResponseString; + FHttpResponsePtr HttpResponse; +}; + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Public/SwaggerFakeApi.h b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerFakeApi.h new file mode 100644 index 00000000000..4ac864bcff9 --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerFakeApi.h @@ -0,0 +1,47 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "CoreMinimal.h" +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +class SWAGGER_API SwaggerFakeApi +{ +public: + SwaggerFakeApi(); + ~SwaggerFakeApi(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + class TestCodeInjectEndRnNRRequest; + class TestCodeInjectEndRnNRResponse; + + DECLARE_DELEGATE_OneParam(FTestCodeInjectEndRnNRDelegate, const TestCodeInjectEndRnNRResponse&); + + bool TestCodeInjectEndRnNR(const TestCodeInjectEndRnNRRequest& Request, const FTestCodeInjectEndRnNRDelegate& Delegate = FTestCodeInjectEndRnNRDelegate()) const; + +private: + void OnTestCodeInjectEndRnNRResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FTestCodeInjectEndRnNRDelegate Delegate) const; + + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Public/SwaggerFakeApiOperations.h b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerFakeApiOperations.h new file mode 100644 index 00000000000..99ee224c3bc --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerFakeApiOperations.h @@ -0,0 +1,45 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" +#include "SwaggerFakeApi.h" + + +namespace Swagger +{ + +/* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r + +*/ +class SWAGGER_API SwaggerFakeApi::TestCodeInjectEndRnNRRequest : public Request +{ +public: + virtual ~TestCodeInjectEndRnNRRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* To test code injection *_/ ' \" =end -- \\r\\n \\n \\r */ + TOptional TestCodeInjectEndRnNR; +}; + +class SWAGGER_API SwaggerFakeApi::TestCodeInjectEndRnNRResponse : public Response +{ +public: + virtual ~TestCodeInjectEndRnNRResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Public/SwaggerHelpers.h b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerHelpers.h new file mode 100644 index 00000000000..218b26444af --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerHelpers.h @@ -0,0 +1,411 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" + +class IHttpRequest; + +namespace Swagger +{ + +typedef TSharedRef> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class SWAGGER_API HttpFileInput +{ +public: + HttpFileInput(const TCHAR* InFilePath); + HttpFileInput(const FString& InFilePath); + + // This will automatically set the content type if not already set + void SetFilePath(const TCHAR* InFilePath); + void SetFilePath(const FString& InFilePath); + + // Optional if it can be deduced from the FilePath + void SetContentType(const TCHAR* ContentType); + + HttpFileInput& operator=(const HttpFileInput& Other) = default; + HttpFileInput& operator=(const FString& InFilePath) { SetFilePath(*InFilePath); return*this; } + HttpFileInput& operator=(const TCHAR* InFilePath) { SetFilePath(InFilePath); return*this; } + + const FString& GetFilePath() const { return FilePath; } + const FString& GetContentType() const { return ContentType; } + + // Returns the filename with extension + FString GetFilename() const; + +private: + FString FilePath; + FString ContentType; +}; + +////////////////////////////////////////////////////////////////////////// + +class HttpMultipartFormData +{ +public: + void SetBoundary(const TCHAR* InBoundary); + void SetupHttpRequest(const TSharedRef& HttpRequest); + + void AddStringPart(const TCHAR* Name, const TCHAR* Data); + void AddJsonPart(const TCHAR* Name, const FString& JsonString); + void AddBinaryPart(const TCHAR* Name, const TArray& ByteArray); + void AddFilePart(const TCHAR* Name, const HttpFileInput& File); + +private: + void AppendString(const TCHAR* Str); + const FString& GetBoundary() const; + + mutable FString Boundary; + TArray FormData; + + static const TCHAR* Delimiter; + static const TCHAR* Newline; +}; + +////////////////////////////////////////////////////////////////////////// + +// Decodes Base64Url encoded strings, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +bool Base64UrlDecode(const FString& Base64String, T& Value) +{ + FString TmpCopy(Base64String); + TmpCopy.ReplaceInline(TEXT("-"), TEXT("+")); + TmpCopy.ReplaceInline(TEXT("_"), TEXT("/")); + + return FBase64::Decode(TmpCopy, Value); +} + +// Encodes strings in Base64Url, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +FString Base64UrlEncode(const T& Value) +{ + FString Base64String = FBase64::Encode(Value); + Base64String.ReplaceInline(TEXT("+"), TEXT("-")); + Base64String.ReplaceInline(TEXT("/"), TEXT("_")); + return Base64String; +} + +template +inline FStringFormatArg ToStringFormatArg(const T& Value) +{ + return FStringFormatArg(Value); +} + +inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) +{ + return FStringFormatArg(Value.ToIso8601()); +} + +inline FStringFormatArg ToStringFormatArg(const TArray& Value) +{ + return FStringFormatArg(Base64UrlEncode(Value)); +} + +template::value, int>::type = 0> +inline FString ToString(const T& Value) +{ + return FString::Format(TEXT("{0}"), { ToStringFormatArg(Value) }); +} + +inline FString ToString(const FString& Value) +{ + return Value; +} + +inline FString ToString(const TArray& Value) +{ + return Base64UrlEncode(Value); +} + +inline FString ToString(const Model& Value) +{ + FString String; + JsonWriter Writer = TJsonWriterFactory<>::Create(&String); + Value.WriteJson(Writer); + Writer->Close(); + return String; +} + +template +inline FString ToUrlString(const T& Value) +{ + return FPlatformHttp::UrlEncode(ToString(Value)); +} + +template +inline FString CollectionToUrlString(const TArray& Collection, const TCHAR* Separator) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += ToUrlString(Collection[0]); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("{0}{1}"), { Separator, *ToUrlString(Collection[i]) }); + } + return Output; +} + +template +inline FString CollectionToUrlString_csv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(",")); +} + +template +inline FString CollectionToUrlString_ssv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(" ")); +} + +template +inline FString CollectionToUrlString_tsv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("\t")); +} + +template +inline FString CollectionToUrlString_pipes(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("|")); +} + +template +inline FString CollectionToUrlString_multi(const TArray& Collection, const TCHAR* BaseName) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[0]) }); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[i]) }); + } + return Output; +} + +////////////////////////////////////////////////////////////////////////// + +template::value, int>::type = 0> +inline void WriteJsonValue(JsonWriter& Writer, const T& Value) +{ + Writer->WriteValue(Value); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) +{ + Writer->WriteValue(Value.ToIso8601()); +} + +inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) +{ + Value.WriteJson(Writer); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) +{ + Writer->WriteObjectStart(); + for (const auto& It : Value) + { + Writer->WriteIdentifierPrefix(It.Key); + WriteJsonValue(Writer, It.Value); + } + Writer->WriteObjectEnd(); +} + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteValue(ToString(Value)); +} + +////////////////////////////////////////////////////////////////////////// + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, T& Value) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + return TryGetJsonValue(JsonValue, Value); + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, TOptional& OptionalValue) +{ + if(JsonObject->HasField(Key)) + { + T Value; + if (TryGetJsonValue(JsonObject, Key, Value)) + { + OptionalValue = Value; + return true; + } + else + return false; + } + return true; // Absence of optional value is not a parsing error +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FString& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + return FDateTime::Parse(TmpValue, Value); + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) +{ + bool TmpValue; + if (JsonValue->TryGetBool(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +template::value, int>::type = 0> +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, T& Value) +{ + T TmpValue; + if (JsonValue->TryGetNumber(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, Model& Value) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + return Value.FromJson(*Object); + else + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& ArrayValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + ArrayValue.Reset(Count); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + ArrayValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + MapValue.Reset(); + bool ParseSuccess = true; + for (const auto& It : (*Object)->Values) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue(It.Value, TmpValue); + MapValue.Emplace(It.Key, MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + JsonObjectValue = *Object; + return true; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Base64UrlDecode(TmpValue, Value); + return true; + } + else + return false; +} + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Public/SwaggerReturn.h b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerReturn.h new file mode 100644 index 00000000000..ee8ed049b8c --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Public/SwaggerReturn.h @@ -0,0 +1,35 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +/* + * SwaggerReturn + * + * Model for testing reserved words *_/ ' \" =end -- \\r\\n \\n \\r + */ +class SWAGGER_API SwaggerReturn : public Model +{ +public: + virtual ~SwaggerReturn() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + /* property description *_/ ' \" =end -- \\r\\n \\n \\r */ + TOptional Return; +}; + +} diff --git a/samples/client/petstore-security-test/ue4cpp/Swagger.Build.cs b/samples/client/petstore-security-test/ue4cpp/Swagger.Build.cs new file mode 100644 index 00000000000..a87033ca9b5 --- /dev/null +++ b/samples/client/petstore-security-test/ue4cpp/Swagger.Build.cs @@ -0,0 +1,29 @@ +/** + * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r + * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ *_/ ' \" =end -- + * + * OpenAPI spec version: 1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r + * Contact: apiteam@swagger.io *_/ ' \" =end -- \\r\\n \\n \\r + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +using System; +using System.IO; +using UnrealBuildTool; + +public class Swagger : ModuleRules +{ + public Swagger(ReadOnlyTargetRules Target) : base(Target) + { + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "Http", + "Json", + } + ); + } +} \ No newline at end of file diff --git a/samples/client/petstore/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index 0ec1b68e2e0..236b87b02f9 100644 --- a/samples/client/petstore/android/httpclient/pom.xml +++ b/samples/client/petstore/android/httpclient/pom.xml @@ -167,9 +167,9 @@ UTF-8 1.5.18 2.3.1 - 4.8.1 + 4.13.1 1.0.0 - 4.8.1 + 4.13.1 4.3.6 diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/bin/IO.Swagger.dll b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/bin/IO.Swagger.dll new file mode 100755 index 00000000000..3e9ce3944a5 Binary files /dev/null and b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/bin/IO.Swagger.dll differ diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/bin/IO.Swagger.xml b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/bin/IO.Swagger.xml new file mode 100644 index 00000000000..54cb7fab36e --- /dev/null +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/bin/IO.Swagger.xml @@ -0,0 +1,931 @@ + + + + IO.Swagger + + + +

+ An order for a pets from the pet store + + + + + Gets or Sets Id + + + + + Gets or Sets PetId + + + + + Gets or Sets Quantity + + + + + Gets or Sets ShipDate + + + + + Order Status + + Order Status + + + + Gets or Sets Complete + + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + Describes the result of uploading an image resource + + + + + Gets or Sets Code + + + + + Gets or Sets Type + + + + + Gets or Sets Message + + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + A User who is purchasing from the pet store + + + + + Gets or Sets Id + + + + + Gets or Sets Username + + + + + Gets or Sets FirstName + + + + + Gets or Sets LastName + + + + + Gets or Sets Email + + + + + Gets or Sets Password + + + + + Gets or Sets Phone + + + + + User Status + + User Status + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + some description + + + + + some description + + some description + + + + Gets or Sets Currency + + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + A pet for sale in the pet store + + + + + Gets or Sets Id + + + + + Gets or Sets Category + + + + + Gets or Sets Name + + + + + Gets or Sets PhotoUrls + + + + + Gets or Sets Tags + + + + + pet status in the store + + pet status in the store + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + some description + + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + A tag for a pet + + + + + Gets or Sets Id + + + + + Gets or Sets Name + + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + A category for a pet + + + + + Gets or Sets Id + + + + + Gets or Sets Name + + + + + Get the string presentation of the object + + String presentation of the object + + + + Get the JSON string presentation of the object + + JSON string presentation of the object + + + + Represents a collection of functions to interact with the API endpoints + + + + + 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 + + + + + Returns pet inventories by status Returns a map of status codes to quantities + + Dictionary<string, int?> + + + + Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + ID of pet that needs to be fetched + Order + + + + Place an order for a pet + + order placed for purchasing the pet + Order + + + + Represents a collection of functions to interact with the API endpoints + + + + + Initializes a new instance of the class. + + an instance of ApiClient (optional) + + + + + Initializes a new instance of the class. + + + + + + Sets the base path of the API client. + + The base path + The base path + + + + Gets the base path of the API client. + + The base path + The base path + + + + Gets or sets the API client. + + An instance of the ApiClient + + + + 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 + + + + + Returns pet inventories by status Returns a map of status codes to quantities + + Dictionary<string, int?> + + + + Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + + ID of pet that needs to be fetched + Order + + + + Place an order for a pet + + order placed for purchasing the pet + Order + + + + Represents a collection of functions to interact with the API endpoints + + + + + Add a new pet to the store + + Pet object that needs to be added to the store + + + + + Deletes a pet + + Pet id to delete + + + + + + Finds Pets by status Multiple status values can be provided with comma separated strings + + Status values that need to be considered for filter + List<Pet> + + + + Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + + Tags to filter by + List<Pet> + + + + Find pet by ID Returns a single pet + + ID of pet to return + Pet + + + + Update an existing pet + + Pet object that needs to be added to the store + + + + + 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 + + + + + uploads an image + + ID of pet to update + Additional data to pass to server + file to upload + ApiResponse + + + + Represents a collection of functions to interact with the API endpoints + + + + + Initializes a new instance of the class. + + an instance of ApiClient (optional) + + + + + Initializes a new instance of the class. + + + + + + Sets the base path of the API client. + + The base path + The base path + + + + Gets the base path of the API client. + + The base path + The base path + + + + Gets or sets the API client. + + An instance of the ApiClient + + + + Add a new pet to the store + + Pet object that needs to be added to the store + + + + + Deletes a pet + + Pet id to delete + + + + + + Finds Pets by status Multiple status values can be provided with comma separated strings + + Status values that need to be considered for filter + List<Pet> + + + + Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. + + Tags to filter by + List<Pet> + + + + Find pet by ID Returns a single pet + + ID of pet to return + Pet + + + + Update an existing pet + + Pet object that needs to be added to the store + + + + + 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 + + + + + uploads an image + + ID of pet to update + Additional data to pass to server + file to upload + ApiResponse + + + + Represents a collection of functions to interact with the API endpoints + + + + + Create user This can only be done by the logged in user. + + Created user object + + + + + Creates list of users with given input array + + List of user object + + + + + Creates list of users with given input array + + List of user object + + + + + Delete user This can only be done by the logged in user. + + The name that needs to be deleted + + + + + Get user by user name + + The name that needs to be fetched. Use user1 for testing. + User + + + + Logs user into the system + + The user name for login + The password for login in clear text + string + + + + Logs out current logged in user session + + + + + + Updated user This can only be done by the logged in user. + + name that need to be deleted + Updated user object + + + + + Represents a collection of functions to interact with the API endpoints + + + + + Initializes a new instance of the class. + + an instance of ApiClient (optional) + + + + + Initializes a new instance of the class. + + + + + + Sets the base path of the API client. + + The base path + The base path + + + + Gets the base path of the API client. + + The base path + The base path + + + + Gets or sets the API client. + + An instance of the ApiClient + + + + Create user This can only be done by the logged in user. + + Created user object + + + + + Creates list of users with given input array + + List of user object + + + + + Creates list of users with given input array + + List of user object + + + + + Delete user This can only be done by the logged in user. + + The name that needs to be deleted + + + + + Get user by user name + + The name that needs to be fetched. Use user1 for testing. + User + + + + Logs user into the system + + The user name for login + The password for login in clear text + string + + + + Logs out current logged in user session + + + + + + Updated user This can only be done by the logged in user. + + name that need to be deleted + Updated user object + + + + + API client is mainly responible for making the HTTP call to the API backend. + + + + + Initializes a new instance of the class. + + The base path. + + + + Gets or sets the base path. + + The base path + + + + Gets or sets the RestClient. + + An instance of the RestClient + + + + Gets the default header. + + + + + Makes the HTTP request (Sync). + + URL path. + HTTP method. + Query parameters. + HTTP body (POST request). + Header parameters. + Form parameters. + File parameters. + Authentication settings. + Object + + + + Add default header. + + Header field name. + Header field value. + + + + + Escape string (url-encoded). + + String to be escaped. + Escaped string. + + + + Create FileParameter based on Stream. + + Parameter name. + Input stream. + FileParameter. + + + + If parameter is DateTime, output in a formatted string (default ISO 8601), customizable with Configuration.DateTime. + If parameter is a list of string, join the list with ",". + Otherwise just return the string. + + The parameter (header, path, query, form). + Formatted string. + + + + Deserialize the JSON string into a proper object. + + HTTP body (e.g. string, JSON). + Object type. + HTTP headers. + Object representation of the JSON string. + + + + Serialize an object into JSON string. + + Object. + JSON string. + + + + Get the API key with prefix. + + API key identifier (authentication scheme). + API key with prefix. + + + + Update parameters based on authentication. + + Query parameters. + Header parameters. + Authentication settings. + + + + Encode string in base64 format. + + String to be encoded. + Encoded string. + + + + Dynamically cast the object into target type. + + Object to be casted + Target type + Casted object + + + + Represents a set of configuration settings + + + + + Version of the package. + + Version of the package. + + + + Gets or sets the default API client for making HTTP calls. + + The API client. + + + + Gets or sets the username (HTTP basic authentication). + + The username. + + + + Gets or sets the password (HTTP basic authentication). + + The password. + + + + Gets or sets the API key based on the authentication name. + + The API key. + + + + Gets or sets the prefix (e.g. Token) of the API key based on the authentication name. + + The prefix of the API key. + + + + Gets or sets the temporary folder path to store the files downloaded from the server. + + Folder path. + + + + Gets or sets the date time format used when serializing in the ApiClient + By default, it's set to ISO 8601 - "o", for others see: + https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx + and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx + No validation is done to ensure that the string you're providing is valid + + The DateTimeFormat string + + + + Returns a string with essential information for debugging. + + + + + API Exception + + + + + Gets or sets the error code (HTTP status code) + + The error code (HTTP status code). + + + + Gets or sets the error content (body json object) + + The error content (Http response body). + + + + Initializes a new instance of the class. + + + + + Initializes a new instance of the class. + + HTTP status code. + Error message. + + + + Initializes a new instance of the class. + + HTTP status code. + Error message. + Error content. + + + diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh index 35e830ac9ca..993ced86a3b 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/compile-mono.sh @@ -1,4 +1,4 @@ -wget -nc https://dist.nuget.org/win-x86-commandline/latest/nuget.exe; +curl --location --request GET 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' --output './nuget.exe' mozroots --import --sync mono nuget.exe install vendor/packages.config -o vendor; mkdir -p bin; diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md index 1d6e816e39b..495f9db6cac 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/docs/PetApi.md @@ -475,7 +475,7 @@ void (empty response body) # **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) +> ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream _file) uploads an image @@ -502,12 +502,12 @@ namespace Example var apiInstance = new PetApi(); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) try { // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); Debug.WriteLine(result); } catch (Exception e) @@ -525,7 +525,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/nuget.exe b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/nuget.exe new file mode 100644 index 00000000000..ea492dbc096 Binary files /dev/null and b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/nuget.exe differ diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs index 2a513818a31..763fcf9fb4d 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Api/PetApi.cs @@ -61,9 +61,9 @@ public interface IPetApi ///
/// ID of pet to update /// Additional data to pass to server - /// file to upload + /// file to upload /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file); + ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream _file); } /// @@ -389,9 +389,9 @@ public void UpdatePetWithForm (long? petId, string name, string status) /// /// ID of pet to update /// Additional data to pass to server - /// file to upload + /// file to upload /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream file) + public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO.Stream _file) { // verify the required parameter 'petId' is set @@ -409,7 +409,7 @@ public ApiResponse UploadFile (long? petId, string additionalMetadata, System.IO String postBody = null; if (additionalMetadata != null) formParams.Add("additionalMetadata", ApiClient.ParameterToString(additionalMetadata)); // form parameter -if (file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", file)); +if (_file != null) fileParams.Add("file", ApiClient.ParameterToFile("file", _file)); // authentication setting, if any String[] authSettings = new String[] { "petstore_auth" }; diff --git a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Client/Configuration.cs b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Client/Configuration.cs index 971d15232a8..b10f4482dc2 100644 --- a/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp-dotnet2/SwaggerClientTest/Lib/SwaggerClient/src/main/CsharpDotNet2/IO/Swagger/Client/Configuration.cs @@ -84,7 +84,7 @@ public static String TempFolderPath private static string _dateTimeFormat = ISO8601_DATETIME_FORMAT; /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/SwaggerClient/.swagger-codegen/VERSION b/samples/client/petstore/csharp/SwaggerClient/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/csharp/SwaggerClient/.swagger-codegen/VERSION +++ b/samples/client/petstore/csharp/SwaggerClient/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClient/README.md b/samples/client/petstore/csharp/SwaggerClient/README.md index 5a856ccd012..97ae0489427 100644 --- a/samples/client/petstore/csharp/SwaggerClient/README.md +++ b/samples/client/petstore/csharp/SwaggerClient/README.md @@ -140,14 +140,18 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) - [Model.List](docs/List.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -155,20 +159,16 @@ Class | Method | HTTP request | Description - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) - [Model.Order](docs/Order.md) - - [Model.OuterBoolean](docs/OuterBoolean.md) - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) - - [Model.OuterNumber](docs/OuterNumber.md) - - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) - - [Model.Cat](docs/Cat.md) - - [Model.Dog](docs/Dog.md) diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Boolean.md b/samples/client/petstore/csharp/SwaggerClient/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## 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/SwaggerClient/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md index d5929dcd9c3..0f09e490647 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/FakeApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description # **FakeOuterBooleanSerialize** -> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) +> bool? FakeOuterBooleanSerialize (bool? body = null) @@ -39,11 +39,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + var body = new bool?(); // bool? | Input boolean as post body (optional) try { - OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -59,11 +59,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + **body** | [**bool?**](bool?.md)| Input boolean as post body | [optional] ### Return type -[**OuterBoolean**](OuterBoolean.md) +**bool?** ### Authorization @@ -138,7 +138,7 @@ No authorization required # **FakeOuterNumberSerialize** -> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) +> decimal? FakeOuterNumberSerialize (decimal? body = null) @@ -159,11 +159,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + var body = new decimal?(); // decimal? | Input number as post body (optional) try { - OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -179,11 +179,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + **body** | [**decimal?**](decimal?.md)| Input number as post body | [optional] ### Return type -[**OuterNumber**](OuterNumber.md) +**decimal?** ### Authorization @@ -198,7 +198,7 @@ No authorization required # **FakeOuterStringSerialize** -> OuterString FakeOuterStringSerialize (OuterString body = null) +> string FakeOuterStringSerialize (string body = null) @@ -219,11 +219,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterString(); // OuterString | Input string as post body (optional) + var body = new string(); // string | Input string as post body (optional) try { - OuterString result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -239,11 +239,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + **body** | [**string**](string.md)| Input string as post body | [optional] ### Return type -[**OuterString**](OuterString.md) +**string** ### Authorization diff --git a/samples/client/petstore/csharp/SwaggerClient/docs/Ints.md b/samples/client/petstore/csharp/SwaggerClient/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## 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/SwaggerClient/docs/Numbers.md b/samples/client/petstore/csharp/SwaggerClient/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## 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/SwaggerClient/docs/OuterBoolean.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterBoolean.md deleted file mode 100644 index 84845b35e54..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/docs/OuterBoolean.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterBoolean -## 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/SwaggerClient/docs/OuterComposite.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterComposite.md index 41fae66f136..84714b7759e 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/OuterComposite.md @@ -3,9 +3,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] -**MyString** | [**OuterString**](OuterString.md) | | [optional] -**MyBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **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/SwaggerClient/docs/OuterNumber.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterNumber.md deleted file mode 100644 index 7c88274d6ee..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/docs/OuterNumber.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterNumber -## 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/SwaggerClient/docs/OuterString.md b/samples/client/petstore/csharp/SwaggerClient/docs/OuterString.md deleted file mode 100644 index 524423a5dab..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/docs/OuterString.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterString -## 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/SwaggerClient/docs/PetApi.md b/samples/client/petstore/csharp/SwaggerClient/docs/PetApi.md index 44f7fad8326..4ba479f81d1 100644 --- a/samples/client/petstore/csharp/SwaggerClient/docs/PetApi.md +++ b/samples/client/petstore/csharp/SwaggerClient/docs/PetApi.md @@ -460,7 +460,7 @@ void (empty response body) # **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) uploads an image @@ -484,12 +484,12 @@ namespace Example var apiInstance = new PetApi(); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) try { // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); Debug.WriteLine(result); } catch (Exception e) @@ -507,7 +507,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeApiTests.cs index fc21272e659..6e280f0bdae 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/FakeApiTests.cs @@ -71,9 +71,9 @@ public void InstanceTest() public void FakeOuterBooleanSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterBoolean body = null; + //bool? body = null; //var response = instance.FakeOuterBooleanSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterBoolean"); + //Assert.IsInstanceOf (response, "response is bool?"); } /// @@ -95,9 +95,9 @@ public void FakeOuterCompositeSerializeTest() public void FakeOuterNumberSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterNumber body = null; + //decimal? body = null; //var response = instance.FakeOuterNumberSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterNumber"); + //Assert.IsInstanceOf (response, "response is decimal?"); } /// @@ -107,9 +107,22 @@ public void FakeOuterNumberSerializeTest() public void FakeOuterStringSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterString body = null; + //string body = null; //var response = instance.FakeOuterStringSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterString"); + //Assert.IsInstanceOf (response, "response is string"); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Test] + public void TestBodyWithQueryParamsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User body = null; + //string query = null; + //instance.TestBodyWithQueryParams(body, query); + } /// diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs index 34c1fb71f44..86e960b8a71 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Api/PetApiTests.cs @@ -160,8 +160,8 @@ public void UploadFileTest() // TODO uncomment below to test the method and replace null with proper value //long? petId = null; //string additionalMetadata = null; - //System.IO.Stream file = null; - //var response = instance.UploadFile(petId, additionalMetadata, file); + //System.IO.Stream _file = null; + //var response = instance.UploadFile(petId, additionalMetadata, _file); //Assert.IsInstanceOf (response, "response is ApiResponse"); } diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/BooleanTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/BooleanTests.cs new file mode 100644 index 00000000000..c4fdadb0100 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/BooleanTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Boolean + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class BooleanTests + { + // TODO uncomment below to declare an instance variable for Boolean + //private Boolean instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Boolean + //instance = new Boolean(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Boolean + /// + [Test] + public void BooleanInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Boolean + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Boolean"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/EnumTestTests.cs index 66664cbd9af..b997bfa5e28 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/EnumTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/EnumTestTests.cs @@ -75,6 +75,14 @@ public void EnumStringTest() // TODO unit test for the property 'EnumString' } /// + /// Test the property 'EnumStringRequired' + /// + [Test] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// /// Test the property 'EnumInteger' /// [Test] diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/IntsTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/IntsTests.cs new file mode 100644 index 00000000000..37d70a773c5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/IntsTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Ints + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class IntsTests + { + // TODO uncomment below to declare an instance variable for Ints + //private Ints instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Ints + //instance = new Ints(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Ints + /// + [Test] + public void IntsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Ints + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Ints"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/NumbersTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/NumbersTests.cs new file mode 100644 index 00000000000..7c0f6a64d87 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/NumbersTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Numbers + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class NumbersTests + { + // TODO uncomment below to declare an instance variable for Numbers + //private Numbers instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Numbers + //instance = new Numbers(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Numbers + /// + [Test] + public void NumbersInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Numbers + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Numbers"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterBooleanTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterBooleanTests.cs deleted file mode 100644 index 81a6cdf5323..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterBooleanTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterBoolean - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterBooleanTests - { - // TODO uncomment below to declare an instance variable for OuterBoolean - //private OuterBoolean instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterBoolean - //instance = new OuterBoolean(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterBoolean - /// - [Test] - public void OuterBooleanInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterBoolean - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterBoolean"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterNumberTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterNumberTests.cs deleted file mode 100644 index 55ebb7da9fd..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterNumberTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterNumber - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterNumberTests - { - // TODO uncomment below to declare an instance variable for OuterNumber - //private OuterNumber instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterNumber - //instance = new OuterNumber(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterNumber - /// - [Test] - public void OuterNumberInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterNumber - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterNumber"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterStringTests.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterStringTests.cs deleted file mode 100644 index 76a2c2253dc..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger.Test/Model/OuterStringTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterString - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterStringTests - { - // TODO uncomment below to declare an instance variable for OuterString - //private OuterString instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterString - //instance = new OuterString(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterString - /// - [Test] - public void OuterStringInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterString - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterString"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs index 76693525084..7eca38fd2f2 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/FakeApi.cs @@ -32,8 +32,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + /// bool? + bool? FakeOuterBooleanSerialize (bool? body = null); /// /// @@ -43,8 +43,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); /// /// /// @@ -74,8 +74,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + /// decimal? + decimal? FakeOuterNumberSerialize (decimal? body = null); /// /// @@ -85,8 +85,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); /// /// /// @@ -95,8 +95,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - OuterString FakeOuterStringSerialize (OuterString body = null); + /// string + string FakeOuterStringSerialize (string body = null); /// /// @@ -106,8 +106,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); /// /// /// @@ -288,8 +288,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of OuterBoolean - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + /// Task of bool? + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); /// /// @@ -299,8 +299,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (OuterBoolean) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// Task of ApiResponse (bool?) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); /// /// /// @@ -330,8 +330,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of OuterNumber - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + /// Task of decimal? + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); /// /// @@ -341,8 +341,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (OuterNumber) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// Task of ApiResponse (decimal?) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); /// /// /// @@ -351,8 +351,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of OuterString - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + /// Task of string + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null); /// /// @@ -362,8 +362,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of ApiResponse (OuterString) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null); /// /// /// @@ -639,10 +639,10 @@ public void AddDefaultHeader(string key, string value) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + /// bool? + public bool? FakeOuterBooleanSerialize (bool? body = null) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -651,8 +651,8 @@ public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) { var localVarPath = "/fake/outer/boolean"; @@ -698,9 +698,9 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -708,10 +708,10 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of OuterBoolean - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + /// Task of bool? + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -721,8 +721,8 @@ public async System.Threading.Tasks.Task FakeOuterBooleanSerialize /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (OuterBoolean) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + /// Task of ApiResponse (bool?) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) { var localVarPath = "/fake/outer/boolean"; @@ -768,9 +768,9 @@ public async System.Threading.Tasks.Task> FakeOuterBoo if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -917,10 +917,10 @@ public async System.Threading.Tasks.Task> FakeOuterC /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + /// decimal? + public decimal? FakeOuterNumberSerialize (decimal? body = null) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -929,8 +929,8 @@ public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) { var localVarPath = "/fake/outer/number"; @@ -976,9 +976,9 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -986,10 +986,10 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of OuterNumber - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + /// Task of decimal? + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -999,8 +999,8 @@ public async System.Threading.Tasks.Task FakeOuterNumberSerializeAs /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (OuterNumber) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + /// Task of ApiResponse (decimal?) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) { var localVarPath = "/fake/outer/number"; @@ -1046,9 +1046,9 @@ public async System.Threading.Tasks.Task> FakeOuterNumb if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -1056,10 +1056,10 @@ public async System.Threading.Tasks.Task> FakeOuterNumb /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - public OuterString FakeOuterStringSerialize (OuterString body = null) + /// string + public string FakeOuterStringSerialize (string body = null) { - ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -1068,8 +1068,8 @@ public OuterString FakeOuterStringSerialize (OuterString body = null) /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) { var localVarPath = "/fake/outer/string"; @@ -1115,9 +1115,9 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// @@ -1125,10 +1125,10 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of OuterString - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + /// Task of string + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null) { - ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1138,8 +1138,8 @@ public async System.Threading.Tasks.Task FakeOuterStringSerializeAs /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of ApiResponse (OuterString) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null) { var localVarPath = "/fake/outer/string"; @@ -1185,9 +1185,9 @@ public async System.Threading.Tasks.Task> FakeOuterStri if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs index 903d703d7d8..2d3a5671cac 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Api/PetApi.cs @@ -186,9 +186,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -199,9 +199,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -366,9 +366,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -379,9 +379,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Asynchronous Operations } @@ -1563,11 +1563,11 @@ public async System.Threading.Tasks.Task> UpdatePetWithFormA /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -1577,9 +1577,9 @@ public ApiResponse UploadFile (long? petId, string additionalMetadata = null, Sy /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1609,7 +1609,7 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required @@ -1642,11 +1642,11 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -1657,9 +1657,9 @@ public async System.Threading.Tasks.Task UploadFileAsync (long? pet /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1689,7 +1689,7 @@ public async System.Threading.Tasks.Task> UploadFileAsy if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs index 531d240482a..caf665bb097 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Client/Configuration.cs @@ -329,7 +329,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..cfe22cdee40 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,50 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..e200097d011 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..0f06cb4f9a8 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,62 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs deleted file mode 100644 index a848353fcde..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterBoolean.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterBoolean - /// - [DataContract] - public partial class OuterBoolean : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterBoolean() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterBoolean {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterBoolean); - } - - /// - /// Returns true if OuterBoolean instances are equal - /// - /// Instance of OuterBoolean to be compared - /// Boolean - public bool Equals(OuterBoolean input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - 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/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs index fa1ff0cb876..e92aee48d81 100644 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterComposite.cs @@ -36,7 +36,7 @@ public partial class OuterComposite : IEquatable, IValidatableO /// myNumber. /// myString. /// myBoolean. - public OuterComposite(OuterNumber myNumber = default(OuterNumber), OuterString myString = default(OuterString), OuterBoolean myBoolean = default(OuterBoolean)) + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) { this.MyNumber = myNumber; this.MyString = myString; @@ -47,19 +47,19 @@ public partial class OuterComposite : IEquatable, IValidatableO /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public OuterNumber MyNumber { get; set; } + public decimal? MyNumber { get; set; } /// /// Gets or Sets MyString /// [DataMember(Name="my_string", EmitDefaultValue=false)] - public OuterString MyString { get; set; } + public string MyString { get; set; } /// /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public OuterBoolean MyBoolean { get; set; } + public bool? MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs deleted file mode 100644 index 5b52454df7d..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterNumber.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterNumber - /// - [DataContract] - public partial class OuterNumber : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterNumber() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterNumber {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterNumber); - } - - /// - /// Returns true if OuterNumber instances are equal - /// - /// Instance of OuterNumber to be compared - /// Boolean - public bool Equals(OuterNumber input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - 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/SwaggerClient/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterString.cs deleted file mode 100644 index 9c025c0d38b..00000000000 --- a/samples/client/petstore/csharp/SwaggerClient/src/IO.Swagger/Model/OuterString.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterString - /// - [DataContract] - public partial class OuterString : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterString() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterString {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterString); - } - - /// - /// Returns true if OuterString instances are equal - /// - /// Instance of OuterString to be compared - /// Boolean - public bool Equals(OuterString input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - 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/SwaggerClientNet35/.swagger-codegen/VERSION b/samples/client/petstore/csharp/SwaggerClientNet35/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/.swagger-codegen/VERSION +++ b/samples/client/petstore/csharp/SwaggerClientNet35/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/README.md b/samples/client/petstore/csharp/SwaggerClientNet35/README.md index 5a856ccd012..97ae0489427 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/README.md @@ -140,14 +140,18 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) - [Model.List](docs/List.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -155,20 +159,16 @@ Class | Method | HTTP request | Description - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) - [Model.Order](docs/Order.md) - - [Model.OuterBoolean](docs/OuterBoolean.md) - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) - - [Model.OuterNumber](docs/OuterNumber.md) - - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) - - [Model.Cat](docs/Cat.md) - - [Model.Dog](docs/Dog.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/build.sh b/samples/client/petstore/csharp/SwaggerClientNet35/build.sh old mode 100755 new mode 100644 diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/Boolean.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## 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/SwaggerClientNet35/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/FakeApi.md index d5929dcd9c3..0f09e490647 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/FakeApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description # **FakeOuterBooleanSerialize** -> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) +> bool? FakeOuterBooleanSerialize (bool? body = null) @@ -39,11 +39,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + var body = new bool?(); // bool? | Input boolean as post body (optional) try { - OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -59,11 +59,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + **body** | [**bool?**](bool?.md)| Input boolean as post body | [optional] ### Return type -[**OuterBoolean**](OuterBoolean.md) +**bool?** ### Authorization @@ -138,7 +138,7 @@ No authorization required # **FakeOuterNumberSerialize** -> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) +> decimal? FakeOuterNumberSerialize (decimal? body = null) @@ -159,11 +159,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + var body = new decimal?(); // decimal? | Input number as post body (optional) try { - OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -179,11 +179,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + **body** | [**decimal?**](decimal?.md)| Input number as post body | [optional] ### Return type -[**OuterNumber**](OuterNumber.md) +**decimal?** ### Authorization @@ -198,7 +198,7 @@ No authorization required # **FakeOuterStringSerialize** -> OuterString FakeOuterStringSerialize (OuterString body = null) +> string FakeOuterStringSerialize (string body = null) @@ -219,11 +219,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterString(); // OuterString | Input string as post body (optional) + var body = new string(); // string | Input string as post body (optional) try { - OuterString result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -239,11 +239,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + **body** | [**string**](string.md)| Input string as post body | [optional] ### Return type -[**OuterString**](OuterString.md) +**string** ### Authorization diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/docs/Ints.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## 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/SwaggerClientNet35/docs/ModelReturn.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelReturn.md deleted file mode 100644 index 9895ccde2b0..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/ModelReturn.md +++ /dev/null @@ -1,9 +0,0 @@ -# IO.Swagger.Model.ModelReturn -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_Return** | **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/SwaggerClientNet35/docs/Numbers.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## 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/SwaggerClientNet35/docs/OuterBoolean.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterBoolean.md deleted file mode 100644 index 84845b35e54..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterBoolean.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterBoolean -## 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/SwaggerClientNet35/docs/OuterComposite.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterComposite.md index 41fae66f136..84714b7759e 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterComposite.md @@ -3,9 +3,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] -**MyString** | [**OuterString**](OuterString.md) | | [optional] -**MyBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **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/SwaggerClientNet35/docs/OuterNumber.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterNumber.md deleted file mode 100644 index 7c88274d6ee..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterNumber.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterNumber -## 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/SwaggerClientNet35/docs/OuterString.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterString.md deleted file mode 100644 index 524423a5dab..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/OuterString.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterString -## 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/SwaggerClientNet35/docs/PetApi.md b/samples/client/petstore/csharp/SwaggerClientNet35/docs/PetApi.md index 44f7fad8326..4ba479f81d1 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/docs/PetApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNet35/docs/PetApi.md @@ -460,7 +460,7 @@ void (empty response body) # **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) uploads an image @@ -484,12 +484,12 @@ namespace Example var apiInstance = new PetApi(); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) try { // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); Debug.WriteLine(result); } catch (Exception e) @@ -507,7 +507,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/FakeApiTests.cs index fc21272e659..6e280f0bdae 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/FakeApiTests.cs @@ -71,9 +71,9 @@ public void InstanceTest() public void FakeOuterBooleanSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterBoolean body = null; + //bool? body = null; //var response = instance.FakeOuterBooleanSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterBoolean"); + //Assert.IsInstanceOf (response, "response is bool?"); } /// @@ -95,9 +95,9 @@ public void FakeOuterCompositeSerializeTest() public void FakeOuterNumberSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterNumber body = null; + //decimal? body = null; //var response = instance.FakeOuterNumberSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterNumber"); + //Assert.IsInstanceOf (response, "response is decimal?"); } /// @@ -107,9 +107,22 @@ public void FakeOuterNumberSerializeTest() public void FakeOuterStringSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterString body = null; + //string body = null; //var response = instance.FakeOuterStringSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterString"); + //Assert.IsInstanceOf (response, "response is string"); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Test] + public void TestBodyWithQueryParamsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User body = null; + //string query = null; + //instance.TestBodyWithQueryParams(body, query); + } /// diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/PetApiTests.cs index 34c1fb71f44..86e960b8a71 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Api/PetApiTests.cs @@ -160,8 +160,8 @@ public void UploadFileTest() // TODO uncomment below to test the method and replace null with proper value //long? petId = null; //string additionalMetadata = null; - //System.IO.Stream file = null; - //var response = instance.UploadFile(petId, additionalMetadata, file); + //System.IO.Stream _file = null; + //var response = instance.UploadFile(petId, additionalMetadata, _file); //Assert.IsInstanceOf (response, "response is ApiResponse"); } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/BooleanTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/BooleanTests.cs new file mode 100644 index 00000000000..c4fdadb0100 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/BooleanTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Boolean + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class BooleanTests + { + // TODO uncomment below to declare an instance variable for Boolean + //private Boolean instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Boolean + //instance = new Boolean(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Boolean + /// + [Test] + public void BooleanInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Boolean + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Boolean"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ClassModelTests.cs index 2589ea4ecea..fd22d2a3d86 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ClassModelTests.cs @@ -67,12 +67,12 @@ public void ClassModelInstanceTest() /// - /// Test the property '_Class' + /// Test the property 'Class' /// [Test] - public void _ClassTest() + public void ClassTest() { - // TODO unit test for the property '_Class' + // TODO unit test for the property 'Class' } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/EnumTestTests.cs index 66664cbd9af..b997bfa5e28 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/EnumTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/EnumTestTests.cs @@ -75,6 +75,14 @@ public void EnumStringTest() // TODO unit test for the property 'EnumString' } /// + /// Test the property 'EnumStringRequired' + /// + [Test] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// /// Test the property 'EnumInteger' /// [Test] diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/FormatTestTests.cs index 3ae16b2fc6b..cd3f8ff3c66 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/FormatTestTests.cs @@ -99,36 +99,36 @@ public void NumberTest() // TODO unit test for the property 'Number' } /// - /// Test the property '_Float' + /// Test the property 'Float' /// [Test] - public void _FloatTest() + public void FloatTest() { - // TODO unit test for the property '_Float' + // TODO unit test for the property 'Float' } /// - /// Test the property '_Double' + /// Test the property 'Double' /// [Test] - public void _DoubleTest() + public void DoubleTest() { - // TODO unit test for the property '_Double' + // TODO unit test for the property 'Double' } /// - /// Test the property '_String' + /// Test the property 'String' /// [Test] - public void _StringTest() + public void StringTest() { - // TODO unit test for the property '_String' + // TODO unit test for the property 'String' } /// - /// Test the property '_Byte' + /// Test the property 'Byte' /// [Test] - public void _ByteTest() + public void ByteTest() { - // TODO unit test for the property '_Byte' + // TODO unit test for the property 'Byte' } /// /// Test the property 'Binary' diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/IntsTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/IntsTests.cs new file mode 100644 index 00000000000..37d70a773c5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/IntsTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Ints + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class IntsTests + { + // TODO uncomment below to declare an instance variable for Ints + //private Ints instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Ints + //instance = new Ints(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Ints + /// + [Test] + public void IntsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Ints + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Ints"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/Model200ResponseTests.cs index cdb0c1960c2..0c2923ce04b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/Model200ResponseTests.cs @@ -75,12 +75,12 @@ public void NameTest() // TODO unit test for the property 'Name' } /// - /// Test the property '_Class' + /// Test the property 'Class' /// [Test] - public void _ClassTest() + public void ClassTest() { - // TODO unit test for the property '_Class' + // TODO unit test for the property 'Class' } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ModelClientTests.cs index f552ab92959..8aacfe5e13a 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ModelClientTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ModelClientTests.cs @@ -67,12 +67,12 @@ public void ModelClientInstanceTest() /// - /// Test the property '_Client' + /// Test the property '__Client' /// [Test] - public void _ClientTest() + public void __ClientTest() { - // TODO unit test for the property '_Client' + // TODO unit test for the property '__Client' } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ModelReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ModelReturnTests.cs deleted file mode 100644 index 7c9ca513a7d..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/ModelReturnTests.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing ModelReturn - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class ModelReturnTests - { - // TODO uncomment below to declare an instance variable for ModelReturn - //private ModelReturn instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of ModelReturn - //instance = new ModelReturn(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of ModelReturn - /// - [Test] - public void ModelReturnInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" ModelReturn - //Assert.IsInstanceOfType (instance, "variable 'instance' is a ModelReturn"); - } - - - /// - /// Test the property '_Return' - /// - [Test] - public void _ReturnTest() - { - // TODO unit test for the property '_Return' - } - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/NumbersTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/NumbersTests.cs new file mode 100644 index 00000000000..7c0f6a64d87 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/NumbersTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Numbers + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class NumbersTests + { + // TODO uncomment below to declare an instance variable for Numbers + //private Numbers instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Numbers + //instance = new Numbers(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Numbers + /// + [Test] + public void NumbersInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Numbers + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Numbers"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterBooleanTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterBooleanTests.cs deleted file mode 100644 index 81a6cdf5323..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterBooleanTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterBoolean - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterBooleanTests - { - // TODO uncomment below to declare an instance variable for OuterBoolean - //private OuterBoolean instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterBoolean - //instance = new OuterBoolean(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterBoolean - /// - [Test] - public void OuterBooleanInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterBoolean - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterBoolean"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterNumberTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterNumberTests.cs deleted file mode 100644 index 55ebb7da9fd..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterNumberTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterNumber - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterNumberTests - { - // TODO uncomment below to declare an instance variable for OuterNumber - //private OuterNumber instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterNumber - //instance = new OuterNumber(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterNumber - /// - [Test] - public void OuterNumberInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterNumber - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterNumber"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterStringTests.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterStringTests.cs deleted file mode 100644 index 76a2c2253dc..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger.Test/Model/OuterStringTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterString - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterStringTests - { - // TODO uncomment below to declare an instance variable for OuterString - //private OuterString instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterString - //instance = new OuterString(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterString - /// - [Test] - public void OuterStringInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterString - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterString"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/FakeApi.cs index 16d6153d24d..4fcc235fe9d 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/FakeApi.cs @@ -32,8 +32,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + /// bool? + bool? FakeOuterBooleanSerialize (bool? body = null); /// /// @@ -43,8 +43,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); /// /// /// @@ -74,8 +74,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + /// decimal? + decimal? FakeOuterNumberSerialize (decimal? body = null); /// /// @@ -85,8 +85,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); /// /// /// @@ -95,8 +95,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - OuterString FakeOuterStringSerialize (OuterString body = null); + /// string + string FakeOuterStringSerialize (string body = null); /// /// @@ -106,8 +106,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); /// /// /// @@ -383,10 +383,10 @@ public void AddDefaultHeader(string key, string value) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + /// bool? + public bool? FakeOuterBooleanSerialize (bool? body = null) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -395,8 +395,8 @@ public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) { var localVarPath = "/fake/outer/boolean"; @@ -442,9 +442,9 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -521,10 +521,10 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + /// decimal? + public decimal? FakeOuterNumberSerialize (decimal? body = null) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -533,8 +533,8 @@ public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) { var localVarPath = "/fake/outer/number"; @@ -580,9 +580,9 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -590,10 +590,10 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - public OuterString FakeOuterStringSerialize (OuterString body = null) + /// string + public string FakeOuterStringSerialize (string body = null) { - ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -602,8 +602,8 @@ public OuterString FakeOuterStringSerialize (OuterString body = null) /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) { var localVarPath = "/fake/outer/string"; @@ -649,9 +649,9 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/PetApi.cs index ee3b98395e5..4ebec972c62 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Api/PetApi.cs @@ -186,9 +186,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -199,9 +199,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Synchronous Operations } @@ -842,11 +842,11 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string na /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -856,9 +856,9 @@ public ApiResponse UploadFile (long? petId, string additionalMetadata = null, Sy /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -888,7 +888,7 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Client/Configuration.cs index e845922af18..841a42bbf34 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Client/Configuration.cs @@ -328,7 +328,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..cfe22cdee40 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,50 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..e200097d011 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelReturn.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelReturn.cs deleted file mode 100644 index 6a7c8289dbd..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/ModelReturn.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// Model for testing reserved words - /// - [DataContract] - public partial class ModelReturn : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - /// _Return. - public ModelReturn(int? _Return = default(int?)) - { - this._Return = _Return; - } - - /// - /// Gets or Sets _Return - /// - [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { 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 ModelReturn {\n"); - sb.Append(" _Return: ").Append(_Return).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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ModelReturn); - } - - /// - /// Returns true if ModelReturn instances are equal - /// - /// Instance of ModelReturn to be compared - /// Boolean - public bool Equals(ModelReturn input) - { - if (input == null) - return false; - - return - ( - this._Return == input._Return || - (this._Return != null && - this._Return.Equals(input._Return)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this._Return != null) - hashCode = hashCode * 59 + this._Return.GetHashCode(); - return hashCode; - } - } - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..0f06cb4f9a8 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,62 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterBoolean.cs deleted file mode 100644 index 43154215b9d..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterBoolean.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterBoolean - /// - [DataContract] - public partial class OuterBoolean : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterBoolean() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterBoolean {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterBoolean); - } - - /// - /// Returns true if OuterBoolean instances are equal - /// - /// Instance of OuterBoolean to be compared - /// Boolean - public bool Equals(OuterBoolean input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterComposite.cs index deb058b1979..ee6b866bdfb 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterComposite.cs @@ -36,7 +36,7 @@ public partial class OuterComposite : IEquatable /// myNumber. /// myString. /// myBoolean. - public OuterComposite(OuterNumber myNumber = default(OuterNumber), OuterString myString = default(OuterString), OuterBoolean myBoolean = default(OuterBoolean)) + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) { this.MyNumber = myNumber; this.MyString = myString; @@ -47,19 +47,19 @@ public partial class OuterComposite : IEquatable /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public OuterNumber MyNumber { get; set; } + public decimal? MyNumber { get; set; } /// /// Gets or Sets MyString /// [DataMember(Name="my_string", EmitDefaultValue=false)] - public OuterString MyString { get; set; } + public string MyString { get; set; } /// /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public OuterBoolean MyBoolean { get; set; } + public bool? MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterNumber.cs deleted file mode 100644 index 83e4d0a42cc..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterNumber.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterNumber - /// - [DataContract] - public partial class OuterNumber : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterNumber() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterNumber {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterNumber); - } - - /// - /// Returns true if OuterNumber instances are equal - /// - /// Instance of OuterNumber to be compared - /// Boolean - public bool Equals(OuterNumber input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterString.cs deleted file mode 100644 index 81b9219113e..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet35/src/IO.Swagger/Model/OuterString.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterString - /// - [DataContract] - public partial class OuterString : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterString() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterString {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterString); - } - - /// - /// Returns true if OuterString instances are equal - /// - /// Instance of OuterString to be compared - /// Boolean - public bool Equals(OuterString input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/.swagger-codegen/VERSION b/samples/client/petstore/csharp/SwaggerClientNet40/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/.swagger-codegen/VERSION +++ b/samples/client/petstore/csharp/SwaggerClientNet40/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/README.md b/samples/client/petstore/csharp/SwaggerClientNet40/README.md index 5a856ccd012..97ae0489427 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/README.md @@ -140,14 +140,18 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) - [Model.List](docs/List.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -155,20 +159,16 @@ Class | Method | HTTP request | Description - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) - [Model.Order](docs/Order.md) - - [Model.OuterBoolean](docs/OuterBoolean.md) - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) - - [Model.OuterNumber](docs/OuterNumber.md) - - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) - - [Model.Cat](docs/Cat.md) - - [Model.Dog](docs/Dog.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/build.sh b/samples/client/petstore/csharp/SwaggerClientNet40/build.sh old mode 100755 new mode 100644 diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/Boolean.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## 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/SwaggerClientNet40/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/FakeApi.md index d5929dcd9c3..0f09e490647 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/FakeApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description # **FakeOuterBooleanSerialize** -> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) +> bool? FakeOuterBooleanSerialize (bool? body = null) @@ -39,11 +39,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + var body = new bool?(); // bool? | Input boolean as post body (optional) try { - OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -59,11 +59,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + **body** | [**bool?**](bool?.md)| Input boolean as post body | [optional] ### Return type -[**OuterBoolean**](OuterBoolean.md) +**bool?** ### Authorization @@ -138,7 +138,7 @@ No authorization required # **FakeOuterNumberSerialize** -> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) +> decimal? FakeOuterNumberSerialize (decimal? body = null) @@ -159,11 +159,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + var body = new decimal?(); // decimal? | Input number as post body (optional) try { - OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -179,11 +179,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + **body** | [**decimal?**](decimal?.md)| Input number as post body | [optional] ### Return type -[**OuterNumber**](OuterNumber.md) +**decimal?** ### Authorization @@ -198,7 +198,7 @@ No authorization required # **FakeOuterStringSerialize** -> OuterString FakeOuterStringSerialize (OuterString body = null) +> string FakeOuterStringSerialize (string body = null) @@ -219,11 +219,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterString(); // OuterString | Input string as post body (optional) + var body = new string(); // string | Input string as post body (optional) try { - OuterString result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -239,11 +239,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + **body** | [**string**](string.md)| Input string as post body | [optional] ### Return type -[**OuterString**](OuterString.md) +**string** ### Authorization diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/docs/Ints.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## 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/SwaggerClientNet40/docs/ModelReturn.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelReturn.md deleted file mode 100644 index 9895ccde2b0..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/ModelReturn.md +++ /dev/null @@ -1,9 +0,0 @@ -# IO.Swagger.Model.ModelReturn -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_Return** | **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/SwaggerClientNet40/docs/Numbers.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## 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/SwaggerClientNet40/docs/OuterBoolean.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterBoolean.md deleted file mode 100644 index 84845b35e54..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterBoolean.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterBoolean -## 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/SwaggerClientNet40/docs/OuterComposite.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterComposite.md index 41fae66f136..84714b7759e 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterComposite.md @@ -3,9 +3,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] -**MyString** | [**OuterString**](OuterString.md) | | [optional] -**MyBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **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/SwaggerClientNet40/docs/OuterNumber.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterNumber.md deleted file mode 100644 index 7c88274d6ee..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterNumber.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterNumber -## 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/SwaggerClientNet40/docs/OuterString.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterString.md deleted file mode 100644 index 524423a5dab..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/OuterString.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterString -## 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/SwaggerClientNet40/docs/PetApi.md b/samples/client/petstore/csharp/SwaggerClientNet40/docs/PetApi.md index 44f7fad8326..4ba479f81d1 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/docs/PetApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNet40/docs/PetApi.md @@ -460,7 +460,7 @@ void (empty response body) # **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) uploads an image @@ -484,12 +484,12 @@ namespace Example var apiInstance = new PetApi(); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) try { // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); Debug.WriteLine(result); } catch (Exception e) @@ -507,7 +507,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/FakeApiTests.cs index fc21272e659..6e280f0bdae 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/FakeApiTests.cs @@ -71,9 +71,9 @@ public void InstanceTest() public void FakeOuterBooleanSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterBoolean body = null; + //bool? body = null; //var response = instance.FakeOuterBooleanSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterBoolean"); + //Assert.IsInstanceOf (response, "response is bool?"); } /// @@ -95,9 +95,9 @@ public void FakeOuterCompositeSerializeTest() public void FakeOuterNumberSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterNumber body = null; + //decimal? body = null; //var response = instance.FakeOuterNumberSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterNumber"); + //Assert.IsInstanceOf (response, "response is decimal?"); } /// @@ -107,9 +107,22 @@ public void FakeOuterNumberSerializeTest() public void FakeOuterStringSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterString body = null; + //string body = null; //var response = instance.FakeOuterStringSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterString"); + //Assert.IsInstanceOf (response, "response is string"); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Test] + public void TestBodyWithQueryParamsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User body = null; + //string query = null; + //instance.TestBodyWithQueryParams(body, query); + } /// diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/PetApiTests.cs index 34c1fb71f44..86e960b8a71 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Api/PetApiTests.cs @@ -160,8 +160,8 @@ public void UploadFileTest() // TODO uncomment below to test the method and replace null with proper value //long? petId = null; //string additionalMetadata = null; - //System.IO.Stream file = null; - //var response = instance.UploadFile(petId, additionalMetadata, file); + //System.IO.Stream _file = null; + //var response = instance.UploadFile(petId, additionalMetadata, _file); //Assert.IsInstanceOf (response, "response is ApiResponse"); } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/BooleanTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/BooleanTests.cs new file mode 100644 index 00000000000..c4fdadb0100 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/BooleanTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Boolean + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class BooleanTests + { + // TODO uncomment below to declare an instance variable for Boolean + //private Boolean instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Boolean + //instance = new Boolean(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Boolean + /// + [Test] + public void BooleanInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Boolean + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Boolean"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ClassModelTests.cs index 2589ea4ecea..fd22d2a3d86 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ClassModelTests.cs @@ -67,12 +67,12 @@ public void ClassModelInstanceTest() /// - /// Test the property '_Class' + /// Test the property 'Class' /// [Test] - public void _ClassTest() + public void ClassTest() { - // TODO unit test for the property '_Class' + // TODO unit test for the property 'Class' } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/EnumTestTests.cs index 66664cbd9af..b997bfa5e28 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/EnumTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/EnumTestTests.cs @@ -75,6 +75,14 @@ public void EnumStringTest() // TODO unit test for the property 'EnumString' } /// + /// Test the property 'EnumStringRequired' + /// + [Test] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// /// Test the property 'EnumInteger' /// [Test] diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/FormatTestTests.cs index 3ae16b2fc6b..cd3f8ff3c66 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/FormatTestTests.cs @@ -99,36 +99,36 @@ public void NumberTest() // TODO unit test for the property 'Number' } /// - /// Test the property '_Float' + /// Test the property 'Float' /// [Test] - public void _FloatTest() + public void FloatTest() { - // TODO unit test for the property '_Float' + // TODO unit test for the property 'Float' } /// - /// Test the property '_Double' + /// Test the property 'Double' /// [Test] - public void _DoubleTest() + public void DoubleTest() { - // TODO unit test for the property '_Double' + // TODO unit test for the property 'Double' } /// - /// Test the property '_String' + /// Test the property 'String' /// [Test] - public void _StringTest() + public void StringTest() { - // TODO unit test for the property '_String' + // TODO unit test for the property 'String' } /// - /// Test the property '_Byte' + /// Test the property 'Byte' /// [Test] - public void _ByteTest() + public void ByteTest() { - // TODO unit test for the property '_Byte' + // TODO unit test for the property 'Byte' } /// /// Test the property 'Binary' diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/IntsTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/IntsTests.cs new file mode 100644 index 00000000000..37d70a773c5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/IntsTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Ints + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class IntsTests + { + // TODO uncomment below to declare an instance variable for Ints + //private Ints instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Ints + //instance = new Ints(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Ints + /// + [Test] + public void IntsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Ints + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Ints"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/Model200ResponseTests.cs index cdb0c1960c2..0c2923ce04b 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/Model200ResponseTests.cs @@ -75,12 +75,12 @@ public void NameTest() // TODO unit test for the property 'Name' } /// - /// Test the property '_Class' + /// Test the property 'Class' /// [Test] - public void _ClassTest() + public void ClassTest() { - // TODO unit test for the property '_Class' + // TODO unit test for the property 'Class' } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ModelClientTests.cs index f552ab92959..8aacfe5e13a 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ModelClientTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ModelClientTests.cs @@ -67,12 +67,12 @@ public void ModelClientInstanceTest() /// - /// Test the property '_Client' + /// Test the property '__Client' /// [Test] - public void _ClientTest() + public void __ClientTest() { - // TODO unit test for the property '_Client' + // TODO unit test for the property '__Client' } } diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ModelReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ModelReturnTests.cs deleted file mode 100644 index 7c9ca513a7d..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/ModelReturnTests.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing ModelReturn - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class ModelReturnTests - { - // TODO uncomment below to declare an instance variable for ModelReturn - //private ModelReturn instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of ModelReturn - //instance = new ModelReturn(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of ModelReturn - /// - [Test] - public void ModelReturnInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" ModelReturn - //Assert.IsInstanceOfType (instance, "variable 'instance' is a ModelReturn"); - } - - - /// - /// Test the property '_Return' - /// - [Test] - public void _ReturnTest() - { - // TODO unit test for the property '_Return' - } - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/NumbersTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/NumbersTests.cs new file mode 100644 index 00000000000..7c0f6a64d87 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/NumbersTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Numbers + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class NumbersTests + { + // TODO uncomment below to declare an instance variable for Numbers + //private Numbers instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Numbers + //instance = new Numbers(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Numbers + /// + [Test] + public void NumbersInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Numbers + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Numbers"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterBooleanTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterBooleanTests.cs deleted file mode 100644 index 81a6cdf5323..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterBooleanTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterBoolean - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterBooleanTests - { - // TODO uncomment below to declare an instance variable for OuterBoolean - //private OuterBoolean instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterBoolean - //instance = new OuterBoolean(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterBoolean - /// - [Test] - public void OuterBooleanInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterBoolean - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterBoolean"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterNumberTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterNumberTests.cs deleted file mode 100644 index 55ebb7da9fd..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterNumberTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterNumber - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterNumberTests - { - // TODO uncomment below to declare an instance variable for OuterNumber - //private OuterNumber instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterNumber - //instance = new OuterNumber(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterNumber - /// - [Test] - public void OuterNumberInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterNumber - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterNumber"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterStringTests.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterStringTests.cs deleted file mode 100644 index 76a2c2253dc..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger.Test/Model/OuterStringTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterString - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterStringTests - { - // TODO uncomment below to declare an instance variable for OuterString - //private OuterString instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterString - //instance = new OuterString(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterString - /// - [Test] - public void OuterStringInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterString - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterString"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/FakeApi.cs index 052fe0cf048..0a4335841bf 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/FakeApi.cs @@ -32,8 +32,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + /// bool? + bool? FakeOuterBooleanSerialize (bool? body = null); /// /// @@ -43,8 +43,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); /// /// /// @@ -74,8 +74,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + /// decimal? + decimal? FakeOuterNumberSerialize (decimal? body = null); /// /// @@ -85,8 +85,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); /// /// /// @@ -95,8 +95,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - OuterString FakeOuterStringSerialize (OuterString body = null); + /// string + string FakeOuterStringSerialize (string body = null); /// /// @@ -106,8 +106,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); /// /// /// @@ -383,10 +383,10 @@ public void AddDefaultHeader(string key, string value) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + /// bool? + public bool? FakeOuterBooleanSerialize (bool? body = null) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -395,8 +395,8 @@ public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) { var localVarPath = "/fake/outer/boolean"; @@ -442,9 +442,9 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -521,10 +521,10 @@ public ApiResponse< OuterComposite > FakeOuterCompositeSerializeWithHttpInfo (Ou /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + /// decimal? + public decimal? FakeOuterNumberSerialize (decimal? body = null) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -533,8 +533,8 @@ public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) { var localVarPath = "/fake/outer/number"; @@ -580,9 +580,9 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -590,10 +590,10 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - public OuterString FakeOuterStringSerialize (OuterString body = null) + /// string + public string FakeOuterStringSerialize (string body = null) { - ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -602,8 +602,8 @@ public OuterString FakeOuterStringSerialize (OuterString body = null) /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) { var localVarPath = "/fake/outer/string"; @@ -649,9 +649,9 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/PetApi.cs index 4106c43645a..47fdae91922 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Api/PetApi.cs @@ -186,9 +186,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -199,9 +199,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Synchronous Operations } @@ -842,11 +842,11 @@ public ApiResponse UpdatePetWithFormWithHttpInfo (long? petId, string na /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -856,9 +856,9 @@ public ApiResponse UploadFile (long? petId, string additionalMetadata = null, Sy /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -888,7 +888,7 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Client/Configuration.cs index 531d240482a..caf665bb097 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Client/Configuration.cs @@ -329,7 +329,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..cfe22cdee40 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,50 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..e200097d011 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,80 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelReturn.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelReturn.cs deleted file mode 100644 index 412c676a8ad..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/ModelReturn.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// Model for testing reserved words - /// - [DataContract] - public partial class ModelReturn : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// _Return. - public ModelReturn(int? _Return = default(int?)) - { - this._Return = _Return; - } - - /// - /// Gets or Sets _Return - /// - [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { 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 ModelReturn {\n"); - sb.Append(" _Return: ").Append(_Return).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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ModelReturn); - } - - /// - /// Returns true if ModelReturn instances are equal - /// - /// Instance of ModelReturn to be compared - /// Boolean - public bool Equals(ModelReturn input) - { - if (input == null) - return false; - - return - ( - this._Return == input._Return || - (this._Return != null && - this._Return.Equals(input._Return)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this._Return != null) - hashCode = hashCode * 59 + this._Return.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/SwaggerClientNet40/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..0f06cb4f9a8 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,62 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterBoolean.cs deleted file mode 100644 index a848353fcde..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterBoolean.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterBoolean - /// - [DataContract] - public partial class OuterBoolean : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterBoolean() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterBoolean {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterBoolean); - } - - /// - /// Returns true if OuterBoolean instances are equal - /// - /// Instance of OuterBoolean to be compared - /// Boolean - public bool Equals(OuterBoolean input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - 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/SwaggerClientNet40/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterComposite.cs index fa1ff0cb876..e92aee48d81 100644 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterComposite.cs @@ -36,7 +36,7 @@ public partial class OuterComposite : IEquatable, IValidatableO /// myNumber. /// myString. /// myBoolean. - public OuterComposite(OuterNumber myNumber = default(OuterNumber), OuterString myString = default(OuterString), OuterBoolean myBoolean = default(OuterBoolean)) + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) { this.MyNumber = myNumber; this.MyString = myString; @@ -47,19 +47,19 @@ public partial class OuterComposite : IEquatable, IValidatableO /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public OuterNumber MyNumber { get; set; } + public decimal? MyNumber { get; set; } /// /// Gets or Sets MyString /// [DataMember(Name="my_string", EmitDefaultValue=false)] - public OuterString MyString { get; set; } + public string MyString { get; set; } /// /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public OuterBoolean MyBoolean { get; set; } + public bool? MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterNumber.cs deleted file mode 100644 index 5b52454df7d..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterNumber.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterNumber - /// - [DataContract] - public partial class OuterNumber : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterNumber() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterNumber {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterNumber); - } - - /// - /// Returns true if OuterNumber instances are equal - /// - /// Instance of OuterNumber to be compared - /// Boolean - public bool Equals(OuterNumber input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - 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/SwaggerClientNet40/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterString.cs deleted file mode 100644 index 9c025c0d38b..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNet40/src/IO.Swagger/Model/OuterString.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterString - /// - [DataContract] - public partial class OuterString : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterString() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterString {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterString); - } - - /// - /// Returns true if OuterString instances are equal - /// - /// Instance of OuterString to be compared - /// Boolean - public bool Equals(OuterString input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - 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/SwaggerClientNetCoreProject/.swagger-codegen/VERSION b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/.swagger-codegen/VERSION +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md index a66ad10025e..69fc7849ebe 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/README.md @@ -118,14 +118,18 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) - [Model.List](docs/List.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -133,20 +137,16 @@ Class | Method | HTTP request | Description - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) - [Model.Order](docs/Order.md) - - [Model.OuterBoolean](docs/OuterBoolean.md) - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) - - [Model.OuterNumber](docs/OuterNumber.md) - - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) - - [Model.Cat](docs/Cat.md) - - [Model.Dog](docs/Dog.md) diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Boolean.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## 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/SwaggerClientNetCoreProject/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/FakeApi.md index d5929dcd9c3..0f09e490647 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/FakeApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description # **FakeOuterBooleanSerialize** -> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) +> bool? FakeOuterBooleanSerialize (bool? body = null) @@ -39,11 +39,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + var body = new bool?(); // bool? | Input boolean as post body (optional) try { - OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -59,11 +59,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + **body** | [**bool?**](bool?.md)| Input boolean as post body | [optional] ### Return type -[**OuterBoolean**](OuterBoolean.md) +**bool?** ### Authorization @@ -138,7 +138,7 @@ No authorization required # **FakeOuterNumberSerialize** -> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) +> decimal? FakeOuterNumberSerialize (decimal? body = null) @@ -159,11 +159,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + var body = new decimal?(); // decimal? | Input number as post body (optional) try { - OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -179,11 +179,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + **body** | [**decimal?**](decimal?.md)| Input number as post body | [optional] ### Return type -[**OuterNumber**](OuterNumber.md) +**decimal?** ### Authorization @@ -198,7 +198,7 @@ No authorization required # **FakeOuterStringSerialize** -> OuterString FakeOuterStringSerialize (OuterString body = null) +> string FakeOuterStringSerialize (string body = null) @@ -219,11 +219,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterString(); // OuterString | Input string as post body (optional) + var body = new string(); // string | Input string as post body (optional) try { - OuterString result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -239,11 +239,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + **body** | [**string**](string.md)| Input string as post body | [optional] ### Return type -[**OuterString**](OuterString.md) +**string** ### Authorization diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Ints.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## 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/SwaggerClientNetCoreProject/docs/ModelReturn.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/ModelReturn.md deleted file mode 100644 index 9895ccde2b0..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/ModelReturn.md +++ /dev/null @@ -1,9 +0,0 @@ -# IO.Swagger.Model.ModelReturn -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_Return** | **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/SwaggerClientNetCoreProject/docs/Numbers.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## 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/SwaggerClientNetCoreProject/docs/OuterBoolean.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterBoolean.md deleted file mode 100644 index 84845b35e54..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterBoolean.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterBoolean -## 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/SwaggerClientNetCoreProject/docs/OuterComposite.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterComposite.md index 41fae66f136..84714b7759e 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterComposite.md @@ -3,9 +3,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] -**MyString** | [**OuterString**](OuterString.md) | | [optional] -**MyBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **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/SwaggerClientNetCoreProject/docs/OuterNumber.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterNumber.md deleted file mode 100644 index 7c88274d6ee..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterNumber.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterNumber -## 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/SwaggerClientNetCoreProject/docs/OuterString.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterString.md deleted file mode 100644 index 524423a5dab..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/OuterString.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterString -## 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/SwaggerClientNetCoreProject/docs/PetApi.md b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/PetApi.md index 44f7fad8326..4ba479f81d1 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/PetApi.md +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/docs/PetApi.md @@ -460,7 +460,7 @@ void (empty response body) # **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) uploads an image @@ -484,12 +484,12 @@ namespace Example var apiInstance = new PetApi(); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) try { // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); Debug.WriteLine(result); } catch (Exception e) @@ -507,7 +507,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs index 83ef292ca55..2bad595bec7 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/FakeApi.cs @@ -32,8 +32,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + /// bool? + bool? FakeOuterBooleanSerialize (bool? body = null); /// /// @@ -43,8 +43,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); /// /// /// @@ -74,8 +74,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + /// decimal? + decimal? FakeOuterNumberSerialize (decimal? body = null); /// /// @@ -85,8 +85,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); /// /// /// @@ -95,8 +95,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - OuterString FakeOuterStringSerialize (OuterString body = null); + /// string + string FakeOuterStringSerialize (string body = null); /// /// @@ -106,8 +106,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); /// /// /// @@ -288,8 +288,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of OuterBoolean - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + /// Task of bool? + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); /// /// @@ -299,8 +299,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (OuterBoolean) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// Task of ApiResponse (bool?) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); /// /// /// @@ -330,8 +330,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of OuterNumber - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + /// Task of decimal? + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); /// /// @@ -341,8 +341,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (OuterNumber) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// Task of ApiResponse (decimal?) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); /// /// /// @@ -351,8 +351,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of OuterString - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + /// Task of string + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null); /// /// @@ -362,8 +362,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of ApiResponse (OuterString) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null); /// /// /// @@ -639,10 +639,10 @@ public void AddDefaultHeader(string key, string value) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + /// bool? + public bool? FakeOuterBooleanSerialize (bool? body = null) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -651,8 +651,8 @@ public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) { var localVarPath = "./fake/outer/boolean"; @@ -698,9 +698,9 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -708,10 +708,10 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of OuterBoolean - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + /// Task of bool? + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -721,8 +721,8 @@ public async System.Threading.Tasks.Task FakeOuterBooleanSerialize /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (OuterBoolean) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + /// Task of ApiResponse (bool?) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) { var localVarPath = "./fake/outer/boolean"; @@ -768,9 +768,9 @@ public async System.Threading.Tasks.Task> FakeOuterBoo if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -917,10 +917,10 @@ public async System.Threading.Tasks.Task> FakeOuterC /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + /// decimal? + public decimal? FakeOuterNumberSerialize (decimal? body = null) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -929,8 +929,8 @@ public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) { var localVarPath = "./fake/outer/number"; @@ -976,9 +976,9 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -986,10 +986,10 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of OuterNumber - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + /// Task of decimal? + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -999,8 +999,8 @@ public async System.Threading.Tasks.Task FakeOuterNumberSerializeAs /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (OuterNumber) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + /// Task of ApiResponse (decimal?) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) { var localVarPath = "./fake/outer/number"; @@ -1046,9 +1046,9 @@ public async System.Threading.Tasks.Task> FakeOuterNumb if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -1056,10 +1056,10 @@ public async System.Threading.Tasks.Task> FakeOuterNumb /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - public OuterString FakeOuterStringSerialize (OuterString body = null) + /// string + public string FakeOuterStringSerialize (string body = null) { - ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -1068,8 +1068,8 @@ public OuterString FakeOuterStringSerialize (OuterString body = null) /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) { var localVarPath = "./fake/outer/string"; @@ -1115,9 +1115,9 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// @@ -1125,10 +1125,10 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of OuterString - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + /// Task of string + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null) { - ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1138,8 +1138,8 @@ public async System.Threading.Tasks.Task FakeOuterStringSerializeAs /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of ApiResponse (OuterString) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null) { var localVarPath = "./fake/outer/string"; @@ -1185,9 +1185,9 @@ public async System.Threading.Tasks.Task> FakeOuterStri if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Key, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs index 6ca3bbf8ff2..38fdf0ba871 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Api/PetApi.cs @@ -186,9 +186,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -199,9 +199,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -366,9 +366,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -379,9 +379,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Asynchronous Operations } @@ -1563,11 +1563,11 @@ public async System.Threading.Tasks.Task> UpdatePetWithFormA /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -1577,9 +1577,9 @@ public ApiResponse UploadFile (long? petId, string additionalMetadata = null, Sy /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1609,7 +1609,7 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required @@ -1642,11 +1642,11 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -1657,9 +1657,9 @@ public async System.Threading.Tasks.Task UploadFileAsync (long? pet /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1689,7 +1689,7 @@ public async System.Threading.Tasks.Task> UploadFileAsy if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/Configuration.cs index 8c3926fa453..364ce53fc06 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Client/Configuration.cs @@ -324,7 +324,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..d404aa0365d --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,48 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..701fd9030b2 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,78 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ModelReturn.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ModelReturn.cs deleted file mode 100644 index 0e031e3ee47..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/ModelReturn.cs +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// Model for testing reserved words - /// - [DataContract] - public partial class ModelReturn : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - /// _Return. - public ModelReturn(int? _Return = default(int?)) - { - this._Return = _Return; - } - - /// - /// Gets or Sets _Return - /// - [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { 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 ModelReturn {\n"); - sb.Append(" _Return: ").Append(_Return).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 input) - { - return this.Equals(input as ModelReturn); - } - - /// - /// Returns true if ModelReturn instances are equal - /// - /// Instance of ModelReturn to be compared - /// Boolean - public bool Equals(ModelReturn input) - { - if (input == null) - return false; - - return - ( - this._Return == input._Return || - (this._Return != null && - this._Return.Equals(input._Return)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this._Return != null) - hashCode = hashCode * 59 + this._Return.GetHashCode(); - return hashCode; - } - } - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..b5167fbd27e --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterBoolean.cs deleted file mode 100644 index 86775e830e1..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterBoolean.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterBoolean - /// - [DataContract] - public partial class OuterBoolean : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterBoolean() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterBoolean {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterBoolean); - } - - /// - /// Returns true if OuterBoolean instances are equal - /// - /// Instance of OuterBoolean to be compared - /// Boolean - public bool Equals(OuterBoolean input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterComposite.cs index 0bf2d9e57cc..824de8cf988 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterComposite.cs @@ -34,7 +34,7 @@ public partial class OuterComposite : IEquatable /// myNumber. /// myString. /// myBoolean. - public OuterComposite(OuterNumber myNumber = default(OuterNumber), OuterString myString = default(OuterString), OuterBoolean myBoolean = default(OuterBoolean)) + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) { this.MyNumber = myNumber; this.MyString = myString; @@ -45,19 +45,19 @@ public partial class OuterComposite : IEquatable /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public OuterNumber MyNumber { get; set; } + public decimal? MyNumber { get; set; } /// /// Gets or Sets MyString /// [DataMember(Name="my_string", EmitDefaultValue=false)] - public OuterString MyString { get; set; } + public string MyString { get; set; } /// /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public OuterBoolean MyBoolean { get; set; } + public bool? MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterNumber.cs deleted file mode 100644 index 4cb2f0053d2..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterNumber.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterNumber - /// - [DataContract] - public partial class OuterNumber : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterNumber() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterNumber {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterNumber); - } - - /// - /// Returns true if OuterNumber instances are equal - /// - /// Instance of OuterNumber to be compared - /// Boolean - public bool Equals(OuterNumber input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterString.cs deleted file mode 100644 index 8a9baf94a94..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientNetCoreProject/src/IO.Swagger/Model/OuterString.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterString - /// - [DataContract] - public partial class OuterString : IEquatable - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterString() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterString {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterString); - } - - /// - /// Returns true if OuterString instances are equal - /// - /// Instance of OuterString to be compared - /// Boolean - public bool Equals(OuterString input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/Configuration.cs index 8c3926fa453..364ce53fc06 100644 --- a/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClientNetStandard/src/IO.Swagger/Client/Configuration.cs @@ -324,7 +324,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/.swagger-codegen/VERSION b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/.swagger-codegen/VERSION +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md index 5a856ccd012..97ae0489427 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/README.md @@ -140,14 +140,18 @@ Class | Method | HTTP request | Description - [Model.ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [Model.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Model.ArrayTest](docs/ArrayTest.md) + - [Model.Boolean](docs/Boolean.md) - [Model.Capitalization](docs/Capitalization.md) + - [Model.Cat](docs/Cat.md) - [Model.Category](docs/Category.md) - [Model.ClassModel](docs/ClassModel.md) + - [Model.Dog](docs/Dog.md) - [Model.EnumArrays](docs/EnumArrays.md) - [Model.EnumClass](docs/EnumClass.md) - [Model.EnumTest](docs/EnumTest.md) - [Model.FormatTest](docs/FormatTest.md) - [Model.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Model.Ints](docs/Ints.md) - [Model.List](docs/List.md) - [Model.MapTest](docs/MapTest.md) - [Model.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -155,20 +159,16 @@ Class | Method | HTTP request | Description - [Model.ModelClient](docs/ModelClient.md) - [Model.Name](docs/Name.md) - [Model.NumberOnly](docs/NumberOnly.md) + - [Model.Numbers](docs/Numbers.md) - [Model.Order](docs/Order.md) - - [Model.OuterBoolean](docs/OuterBoolean.md) - [Model.OuterComposite](docs/OuterComposite.md) - [Model.OuterEnum](docs/OuterEnum.md) - - [Model.OuterNumber](docs/OuterNumber.md) - - [Model.OuterString](docs/OuterString.md) - [Model.Pet](docs/Pet.md) - [Model.ReadOnlyFirst](docs/ReadOnlyFirst.md) - [Model.Return](docs/Return.md) - [Model.SpecialModelName](docs/SpecialModelName.md) - [Model.Tag](docs/Tag.md) - [Model.User](docs/User.md) - - [Model.Cat](docs/Cat.md) - - [Model.Dog](docs/Dog.md) diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Boolean.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Boolean.md new file mode 100644 index 00000000000..4e908f3d6d9 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Boolean.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Boolean +## 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/SwaggerClientWithPropertyChanged/docs/FakeApi.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FakeApi.md index d5929dcd9c3..0f09e490647 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FakeApi.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/FakeApi.md @@ -18,7 +18,7 @@ Method | HTTP request | Description # **FakeOuterBooleanSerialize** -> OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) +> bool? FakeOuterBooleanSerialize (bool? body = null) @@ -39,11 +39,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterBoolean(); // OuterBoolean | Input boolean as post body (optional) + var body = new bool?(); // bool? | Input boolean as post body (optional) try { - OuterBoolean result = apiInstance.FakeOuterBooleanSerialize(body); + bool? result = apiInstance.FakeOuterBooleanSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -59,11 +59,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterBoolean**](OuterBoolean.md)| Input boolean as post body | [optional] + **body** | [**bool?**](bool?.md)| Input boolean as post body | [optional] ### Return type -[**OuterBoolean**](OuterBoolean.md) +**bool?** ### Authorization @@ -138,7 +138,7 @@ No authorization required # **FakeOuterNumberSerialize** -> OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) +> decimal? FakeOuterNumberSerialize (decimal? body = null) @@ -159,11 +159,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterNumber(); // OuterNumber | Input number as post body (optional) + var body = new decimal?(); // decimal? | Input number as post body (optional) try { - OuterNumber result = apiInstance.FakeOuterNumberSerialize(body); + decimal? result = apiInstance.FakeOuterNumberSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -179,11 +179,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterNumber**](OuterNumber.md)| Input number as post body | [optional] + **body** | [**decimal?**](decimal?.md)| Input number as post body | [optional] ### Return type -[**OuterNumber**](OuterNumber.md) +**decimal?** ### Authorization @@ -198,7 +198,7 @@ No authorization required # **FakeOuterStringSerialize** -> OuterString FakeOuterStringSerialize (OuterString body = null) +> string FakeOuterStringSerialize (string body = null) @@ -219,11 +219,11 @@ namespace Example public void main() { var apiInstance = new FakeApi(); - var body = new OuterString(); // OuterString | Input string as post body (optional) + var body = new string(); // string | Input string as post body (optional) try { - OuterString result = apiInstance.FakeOuterStringSerialize(body); + string result = apiInstance.FakeOuterStringSerialize(body); Debug.WriteLine(result); } catch (Exception e) @@ -239,11 +239,11 @@ namespace Example Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**OuterString**](OuterString.md)| Input string as post body | [optional] + **body** | [**string**](string.md)| Input string as post body | [optional] ### Return type -[**OuterString**](OuterString.md) +**string** ### Authorization diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Ints.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Ints.md new file mode 100644 index 00000000000..25607fe8916 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Ints.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Ints +## 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/SwaggerClientWithPropertyChanged/docs/ModelReturn.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelReturn.md deleted file mode 100644 index 9895ccde2b0..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/ModelReturn.md +++ /dev/null @@ -1,9 +0,0 @@ -# IO.Swagger.Model.ModelReturn -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_Return** | **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/SwaggerClientWithPropertyChanged/docs/Numbers.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Numbers.md new file mode 100644 index 00000000000..a522e078902 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/Numbers.md @@ -0,0 +1,8 @@ +# IO.Swagger.Model.Numbers +## 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/SwaggerClientWithPropertyChanged/docs/OuterBoolean.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterBoolean.md deleted file mode 100644 index 84845b35e54..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterBoolean.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterBoolean -## 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/SwaggerClientWithPropertyChanged/docs/OuterComposite.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterComposite.md index 41fae66f136..84714b7759e 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterComposite.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterComposite.md @@ -3,9 +3,9 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**MyNumber** | [**OuterNumber**](OuterNumber.md) | | [optional] -**MyString** | [**OuterString**](OuterString.md) | | [optional] -**MyBoolean** | [**OuterBoolean**](OuterBoolean.md) | | [optional] +**MyNumber** | **decimal?** | | [optional] +**MyString** | **string** | | [optional] +**MyBoolean** | **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/SwaggerClientWithPropertyChanged/docs/OuterNumber.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterNumber.md deleted file mode 100644 index 7c88274d6ee..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterNumber.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterNumber -## 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/SwaggerClientWithPropertyChanged/docs/OuterString.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterString.md deleted file mode 100644 index 524423a5dab..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/OuterString.md +++ /dev/null @@ -1,8 +0,0 @@ -# IO.Swagger.Model.OuterString -## 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/SwaggerClientWithPropertyChanged/docs/PetApi.md b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/PetApi.md index 44f7fad8326..4ba479f81d1 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/PetApi.md +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/docs/PetApi.md @@ -460,7 +460,7 @@ void (empty response body) # **UploadFile** -> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) +> ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) uploads an image @@ -484,12 +484,12 @@ namespace Example var apiInstance = new PetApi(); var petId = 789; // long? | ID of pet to update var additionalMetadata = additionalMetadata_example; // string | Additional data to pass to server (optional) - var file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) + var _file = new System.IO.Stream(); // System.IO.Stream | file to upload (optional) try { // uploads an image - ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, file); + ApiResponse result = apiInstance.UploadFile(petId, additionalMetadata, _file); Debug.WriteLine(result); } catch (Exception e) @@ -507,7 +507,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **petId** | **long?**| ID of pet to update | **additionalMetadata** | **string**| Additional data to pass to server | [optional] - **file** | **System.IO.Stream**| file to upload | [optional] + **_file** | **System.IO.Stream**| file to upload | [optional] ### Return type diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/FakeApiTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/FakeApiTests.cs index fc21272e659..6e280f0bdae 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/FakeApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/FakeApiTests.cs @@ -71,9 +71,9 @@ public void InstanceTest() public void FakeOuterBooleanSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterBoolean body = null; + //bool? body = null; //var response = instance.FakeOuterBooleanSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterBoolean"); + //Assert.IsInstanceOf (response, "response is bool?"); } /// @@ -95,9 +95,9 @@ public void FakeOuterCompositeSerializeTest() public void FakeOuterNumberSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterNumber body = null; + //decimal? body = null; //var response = instance.FakeOuterNumberSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterNumber"); + //Assert.IsInstanceOf (response, "response is decimal?"); } /// @@ -107,9 +107,22 @@ public void FakeOuterNumberSerializeTest() public void FakeOuterStringSerializeTest() { // TODO uncomment below to test the method and replace null with proper value - //OuterString body = null; + //string body = null; //var response = instance.FakeOuterStringSerialize(body); - //Assert.IsInstanceOf (response, "response is OuterString"); + //Assert.IsInstanceOf (response, "response is string"); + } + + /// + /// Test TestBodyWithQueryParams + /// + [Test] + public void TestBodyWithQueryParamsTest() + { + // TODO uncomment below to test the method and replace null with proper value + //User body = null; + //string query = null; + //instance.TestBodyWithQueryParams(body, query); + } /// diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/PetApiTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/PetApiTests.cs index 34c1fb71f44..86e960b8a71 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/PetApiTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Api/PetApiTests.cs @@ -160,8 +160,8 @@ public void UploadFileTest() // TODO uncomment below to test the method and replace null with proper value //long? petId = null; //string additionalMetadata = null; - //System.IO.Stream file = null; - //var response = instance.UploadFile(petId, additionalMetadata, file); + //System.IO.Stream _file = null; + //var response = instance.UploadFile(petId, additionalMetadata, _file); //Assert.IsInstanceOf (response, "response is ApiResponse"); } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/BooleanTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/BooleanTests.cs new file mode 100644 index 00000000000..c4fdadb0100 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/BooleanTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Boolean + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class BooleanTests + { + // TODO uncomment below to declare an instance variable for Boolean + //private Boolean instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Boolean + //instance = new Boolean(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Boolean + /// + [Test] + public void BooleanInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Boolean + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Boolean"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ClassModelTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ClassModelTests.cs index 2589ea4ecea..fd22d2a3d86 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ClassModelTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ClassModelTests.cs @@ -67,12 +67,12 @@ public void ClassModelInstanceTest() /// - /// Test the property '_Class' + /// Test the property 'Class' /// [Test] - public void _ClassTest() + public void ClassTest() { - // TODO unit test for the property '_Class' + // TODO unit test for the property 'Class' } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/EnumTestTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/EnumTestTests.cs index 66664cbd9af..b997bfa5e28 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/EnumTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/EnumTestTests.cs @@ -75,6 +75,14 @@ public void EnumStringTest() // TODO unit test for the property 'EnumString' } /// + /// Test the property 'EnumStringRequired' + /// + [Test] + public void EnumStringRequiredTest() + { + // TODO unit test for the property 'EnumStringRequired' + } + /// /// Test the property 'EnumInteger' /// [Test] diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/FormatTestTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/FormatTestTests.cs index 3ae16b2fc6b..cd3f8ff3c66 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/FormatTestTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/FormatTestTests.cs @@ -99,36 +99,36 @@ public void NumberTest() // TODO unit test for the property 'Number' } /// - /// Test the property '_Float' + /// Test the property 'Float' /// [Test] - public void _FloatTest() + public void FloatTest() { - // TODO unit test for the property '_Float' + // TODO unit test for the property 'Float' } /// - /// Test the property '_Double' + /// Test the property 'Double' /// [Test] - public void _DoubleTest() + public void DoubleTest() { - // TODO unit test for the property '_Double' + // TODO unit test for the property 'Double' } /// - /// Test the property '_String' + /// Test the property 'String' /// [Test] - public void _StringTest() + public void StringTest() { - // TODO unit test for the property '_String' + // TODO unit test for the property 'String' } /// - /// Test the property '_Byte' + /// Test the property 'Byte' /// [Test] - public void _ByteTest() + public void ByteTest() { - // TODO unit test for the property '_Byte' + // TODO unit test for the property 'Byte' } /// /// Test the property 'Binary' diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/IntsTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/IntsTests.cs new file mode 100644 index 00000000000..37d70a773c5 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/IntsTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Ints + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class IntsTests + { + // TODO uncomment below to declare an instance variable for Ints + //private Ints instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Ints + //instance = new Ints(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Ints + /// + [Test] + public void IntsInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Ints + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Ints"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/Model200ResponseTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/Model200ResponseTests.cs index cdb0c1960c2..0c2923ce04b 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/Model200ResponseTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/Model200ResponseTests.cs @@ -75,12 +75,12 @@ public void NameTest() // TODO unit test for the property 'Name' } /// - /// Test the property '_Class' + /// Test the property 'Class' /// [Test] - public void _ClassTest() + public void ClassTest() { - // TODO unit test for the property '_Class' + // TODO unit test for the property 'Class' } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ModelClientTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ModelClientTests.cs index f552ab92959..8aacfe5e13a 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ModelClientTests.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ModelClientTests.cs @@ -67,12 +67,12 @@ public void ModelClientInstanceTest() /// - /// Test the property '_Client' + /// Test the property '__Client' /// [Test] - public void _ClientTest() + public void __ClientTest() { - // TODO unit test for the property '_Client' + // TODO unit test for the property '__Client' } } diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ModelReturnTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ModelReturnTests.cs deleted file mode 100644 index 7c9ca513a7d..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/ModelReturnTests.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing ModelReturn - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class ModelReturnTests - { - // TODO uncomment below to declare an instance variable for ModelReturn - //private ModelReturn instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of ModelReturn - //instance = new ModelReturn(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of ModelReturn - /// - [Test] - public void ModelReturnInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" ModelReturn - //Assert.IsInstanceOfType (instance, "variable 'instance' is a ModelReturn"); - } - - - /// - /// Test the property '_Return' - /// - [Test] - public void _ReturnTest() - { - // TODO unit test for the property '_Return' - } - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/NumbersTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/NumbersTests.cs new file mode 100644 index 00000000000..7c0f6a64d87 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/NumbersTests.cs @@ -0,0 +1,72 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + + +using NUnit.Framework; + +using System; +using System.Linq; +using System.IO; +using System.Collections.Generic; +using IO.Swagger.Api; +using IO.Swagger.Model; +using IO.Swagger.Client; +using System.Reflection; +using Newtonsoft.Json; + +namespace IO.Swagger.Test +{ + /// + /// Class for testing Numbers + /// + /// + /// This file is automatically generated by Swagger Codegen. + /// Please update the test case below to test the model. + /// + [TestFixture] + public class NumbersTests + { + // TODO uncomment below to declare an instance variable for Numbers + //private Numbers instance; + + /// + /// Setup before each test + /// + [SetUp] + public void Init() + { + // TODO uncomment below to create an instance of Numbers + //instance = new Numbers(); + } + + /// + /// Clean up after each test + /// + [TearDown] + public void Cleanup() + { + + } + + /// + /// Test an instance of Numbers + /// + [Test] + public void NumbersInstanceTest() + { + // TODO uncomment below to test "IsInstanceOfType" Numbers + //Assert.IsInstanceOfType (instance, "variable 'instance' is a Numbers"); + } + + + + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterBooleanTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterBooleanTests.cs deleted file mode 100644 index 81a6cdf5323..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterBooleanTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterBoolean - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterBooleanTests - { - // TODO uncomment below to declare an instance variable for OuterBoolean - //private OuterBoolean instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterBoolean - //instance = new OuterBoolean(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterBoolean - /// - [Test] - public void OuterBooleanInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterBoolean - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterBoolean"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterNumberTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterNumberTests.cs deleted file mode 100644 index 55ebb7da9fd..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterNumberTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterNumber - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterNumberTests - { - // TODO uncomment below to declare an instance variable for OuterNumber - //private OuterNumber instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterNumber - //instance = new OuterNumber(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterNumber - /// - [Test] - public void OuterNumberInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterNumber - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterNumber"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterStringTests.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterStringTests.cs deleted file mode 100644 index 76a2c2253dc..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger.Test/Model/OuterStringTests.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - - -using NUnit.Framework; - -using System; -using System.Linq; -using System.IO; -using System.Collections.Generic; -using IO.Swagger.Api; -using IO.Swagger.Model; -using IO.Swagger.Client; -using System.Reflection; -using Newtonsoft.Json; - -namespace IO.Swagger.Test -{ - /// - /// Class for testing OuterString - /// - /// - /// This file is automatically generated by Swagger Codegen. - /// Please update the test case below to test the model. - /// - [TestFixture] - public class OuterStringTests - { - // TODO uncomment below to declare an instance variable for OuterString - //private OuterString instance; - - /// - /// Setup before each test - /// - [SetUp] - public void Init() - { - // TODO uncomment below to create an instance of OuterString - //instance = new OuterString(); - } - - /// - /// Clean up after each test - /// - [TearDown] - public void Cleanup() - { - - } - - /// - /// Test an instance of OuterString - /// - [Test] - public void OuterStringInstanceTest() - { - // TODO uncomment below to test "IsInstanceOfType" OuterString - //Assert.IsInstanceOfType (instance, "variable 'instance' is a OuterString"); - } - - - - } - -} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs index 76693525084..7eca38fd2f2 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/FakeApi.cs @@ -32,8 +32,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null); + /// bool? + bool? FakeOuterBooleanSerialize (bool? body = null); /// /// @@ -43,8 +43,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - ApiResponse FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null); + /// ApiResponse of bool? + ApiResponse FakeOuterBooleanSerializeWithHttpInfo (bool? body = null); /// /// /// @@ -74,8 +74,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - OuterNumber FakeOuterNumberSerialize (OuterNumber body = null); + /// decimal? + decimal? FakeOuterNumberSerialize (decimal? body = null); /// /// @@ -85,8 +85,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - ApiResponse FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null); + /// ApiResponse of decimal? + ApiResponse FakeOuterNumberSerializeWithHttpInfo (decimal? body = null); /// /// /// @@ -95,8 +95,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - OuterString FakeOuterStringSerialize (OuterString body = null); + /// string + string FakeOuterStringSerialize (string body = null); /// /// @@ -106,8 +106,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - ApiResponse FakeOuterStringSerializeWithHttpInfo (OuterString body = null); + /// ApiResponse of string + ApiResponse FakeOuterStringSerializeWithHttpInfo (string body = null); /// /// /// @@ -288,8 +288,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of OuterBoolean - System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null); + /// Task of bool? + System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null); /// /// @@ -299,8 +299,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (OuterBoolean) - System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null); + /// Task of ApiResponse (bool?) + System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null); /// /// /// @@ -330,8 +330,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of OuterNumber - System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null); + /// Task of decimal? + System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null); /// /// @@ -341,8 +341,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (OuterNumber) - System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null); + /// Task of ApiResponse (decimal?) + System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null); /// /// /// @@ -351,8 +351,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of OuterString - System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null); + /// Task of string + System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null); /// /// @@ -362,8 +362,8 @@ public interface IFakeApi : IApiAccessor /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of ApiResponse (OuterString) - System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null); + /// Task of ApiResponse (string) + System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null); /// /// /// @@ -639,10 +639,10 @@ public void AddDefaultHeader(string key, string value) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// OuterBoolean - public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) + /// bool? + public bool? FakeOuterBooleanSerialize (bool? body = null) { - ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterBooleanSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -651,8 +651,8 @@ public OuterBoolean FakeOuterBooleanSerialize (OuterBoolean body = null) /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// ApiResponse of OuterBoolean - public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterBoolean body = null) + /// ApiResponse of bool? + public ApiResponse< bool? > FakeOuterBooleanSerializeWithHttpInfo (bool? body = null) { var localVarPath = "/fake/outer/boolean"; @@ -698,9 +698,9 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -708,10 +708,10 @@ public ApiResponse< OuterBoolean > FakeOuterBooleanSerializeWithHttpInfo (OuterB /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of OuterBoolean - public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (OuterBoolean body = null) + /// Task of bool? + public async System.Threading.Tasks.Task FakeOuterBooleanSerializeAsync (bool? body = null) { - ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterBooleanSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -721,8 +721,8 @@ public async System.Threading.Tasks.Task FakeOuterBooleanSerialize /// /// Thrown when fails to make API call /// Input boolean as post body (optional) - /// Task of ApiResponse (OuterBoolean) - public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (OuterBoolean body = null) + /// Task of ApiResponse (bool?) + public async System.Threading.Tasks.Task> FakeOuterBooleanSerializeAsyncWithHttpInfo (bool? body = null) { var localVarPath = "/fake/outer/boolean"; @@ -768,9 +768,9 @@ public async System.Threading.Tasks.Task> FakeOuterBoo if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterBoolean) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterBoolean))); + (bool?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(bool?))); } /// @@ -917,10 +917,10 @@ public async System.Threading.Tasks.Task> FakeOuterC /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// OuterNumber - public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) + /// decimal? + public decimal? FakeOuterNumberSerialize (decimal? body = null) { - ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterNumberSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -929,8 +929,8 @@ public OuterNumber FakeOuterNumberSerialize (OuterNumber body = null) /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// ApiResponse of OuterNumber - public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNumber body = null) + /// ApiResponse of decimal? + public ApiResponse< decimal? > FakeOuterNumberSerializeWithHttpInfo (decimal? body = null) { var localVarPath = "/fake/outer/number"; @@ -976,9 +976,9 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -986,10 +986,10 @@ public ApiResponse< OuterNumber > FakeOuterNumberSerializeWithHttpInfo (OuterNum /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of OuterNumber - public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (OuterNumber body = null) + /// Task of decimal? + public async System.Threading.Tasks.Task FakeOuterNumberSerializeAsync (decimal? body = null) { - ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterNumberSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -999,8 +999,8 @@ public async System.Threading.Tasks.Task FakeOuterNumberSerializeAs /// /// Thrown when fails to make API call /// Input number as post body (optional) - /// Task of ApiResponse (OuterNumber) - public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (OuterNumber body = null) + /// Task of ApiResponse (decimal?) + public async System.Threading.Tasks.Task> FakeOuterNumberSerializeAsyncWithHttpInfo (decimal? body = null) { var localVarPath = "/fake/outer/number"; @@ -1046,9 +1046,9 @@ public async System.Threading.Tasks.Task> FakeOuterNumb if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterNumber) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterNumber))); + (decimal?) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(decimal?))); } /// @@ -1056,10 +1056,10 @@ public async System.Threading.Tasks.Task> FakeOuterNumb /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// OuterString - public OuterString FakeOuterStringSerialize (OuterString body = null) + /// string + public string FakeOuterStringSerialize (string body = null) { - ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); + ApiResponse localVarResponse = FakeOuterStringSerializeWithHttpInfo(body); return localVarResponse.Data; } @@ -1068,8 +1068,8 @@ public OuterString FakeOuterStringSerialize (OuterString body = null) /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// ApiResponse of OuterString - public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterString body = null) + /// ApiResponse of string + public ApiResponse< string > FakeOuterStringSerializeWithHttpInfo (string body = null) { var localVarPath = "/fake/outer/string"; @@ -1115,9 +1115,9 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// @@ -1125,10 +1125,10 @@ public ApiResponse< OuterString > FakeOuterStringSerializeWithHttpInfo (OuterStr /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of OuterString - public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (OuterString body = null) + /// Task of string + public async System.Threading.Tasks.Task FakeOuterStringSerializeAsync (string body = null) { - ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); + ApiResponse localVarResponse = await FakeOuterStringSerializeAsyncWithHttpInfo(body); return localVarResponse.Data; } @@ -1138,8 +1138,8 @@ public async System.Threading.Tasks.Task FakeOuterStringSerializeAs /// /// Thrown when fails to make API call /// Input string as post body (optional) - /// Task of ApiResponse (OuterString) - public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (OuterString body = null) + /// Task of ApiResponse (string) + public async System.Threading.Tasks.Task> FakeOuterStringSerializeAsyncWithHttpInfo (string body = null) { var localVarPath = "/fake/outer/string"; @@ -1185,9 +1185,9 @@ public async System.Threading.Tasks.Task> FakeOuterStri if (exception != null) throw exception; } - return new ApiResponse(localVarStatusCode, + return new ApiResponse(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), - (OuterString) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(OuterString))); + (string) this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(string))); } /// diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs index 903d703d7d8..2d3a5671cac 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Api/PetApi.cs @@ -186,9 +186,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -199,9 +199,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + ApiResponse UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Synchronous Operations #region Asynchronous Operations /// @@ -366,9 +366,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse - System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); /// /// uploads an image @@ -379,9 +379,9 @@ public interface IPetApi : IApiAccessor /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null); + System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null); #endregion Asynchronous Operations } @@ -1563,11 +1563,11 @@ public async System.Threading.Tasks.Task> UpdatePetWithFormA /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse - public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse UploadFile (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = UploadFileWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -1577,9 +1577,9 @@ public ApiResponse UploadFile (long? petId, string additionalMetadata = null, Sy /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// ApiResponse of ApiResponse - public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1609,7 +1609,7 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required @@ -1642,11 +1642,11 @@ public ApiResponse< ApiResponse > UploadFileWithHttpInfo (long? petId, string ad /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse - public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task UploadFileAsync (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { - ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, file); + ApiResponse localVarResponse = await UploadFileAsyncWithHttpInfo(petId, additionalMetadata, _file); return localVarResponse.Data; } @@ -1657,9 +1657,9 @@ public async System.Threading.Tasks.Task UploadFileAsync (long? pet /// Thrown when fails to make API call /// ID of pet to update /// Additional data to pass to server (optional) - /// file to upload (optional) + /// file to upload (optional) /// Task of ApiResponse (ApiResponse) - public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream file = null) + public async System.Threading.Tasks.Task> UploadFileAsyncWithHttpInfo (long? petId, string additionalMetadata = null, System.IO.Stream _file = null) { // verify the required parameter 'petId' is set if (petId == null) @@ -1689,7 +1689,7 @@ public async System.Threading.Tasks.Task> UploadFileAsy if (petId != null) localVarPathParams.Add("petId", this.Configuration.ApiClient.ParameterToString(petId)); // path parameter if (additionalMetadata != null) localVarFormParams.Add("additionalMetadata", this.Configuration.ApiClient.ParameterToString(additionalMetadata)); // form parameter - if (file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", file)); + if (_file != null) localVarFileParams.Add("file", this.Configuration.ApiClient.ParameterToFile("file", _file)); // authentication (petstore_auth) required // oauth required diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Client/Configuration.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Client/Configuration.cs index 531d240482a..caf665bb097 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Client/Configuration.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Client/Configuration.cs @@ -329,7 +329,7 @@ public virtual string TempFolderPath } /// - /// Gets or sets the the date time format used when serializing in the ApiClient + /// Gets or sets the date time format used when serializing in the ApiClient /// By default, it's set to ISO 8601 - "o", for others see: /// https://msdn.microsoft.com/en-us/library/az4se3k1(v=vs.110).aspx /// and https://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Boolean.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Boolean.cs new file mode 100644 index 00000000000..d1e65cdcd73 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Boolean.cs @@ -0,0 +1,52 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Boolean + { + + /// + /// Enum True for value: true + /// + [EnumMember(Value = "true")] + True = 1, + + /// + /// Enum False for value: false + /// + [EnumMember(Value = "false")] + False = 2 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Ints.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Ints.cs new file mode 100644 index 00000000000..d0d4a86f310 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Ints.cs @@ -0,0 +1,82 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// True or False indicator + /// + /// True or False indicator + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Ints + { + + /// + /// Enum NUMBER_0 for value: 0 + /// + [EnumMember(Value = "0")] + NUMBER_0 = 1, + + /// + /// Enum NUMBER_1 for value: 1 + /// + [EnumMember(Value = "1")] + NUMBER_1 = 2, + + /// + /// Enum NUMBER_2 for value: 2 + /// + [EnumMember(Value = "2")] + NUMBER_2 = 3, + + /// + /// Enum NUMBER_3 for value: 3 + /// + [EnumMember(Value = "3")] + NUMBER_3 = 4, + + /// + /// Enum NUMBER_4 for value: 4 + /// + [EnumMember(Value = "4")] + NUMBER_4 = 5, + + /// + /// Enum NUMBER_5 for value: 5 + /// + [EnumMember(Value = "5")] + NUMBER_5 = 6, + + /// + /// Enum NUMBER_6 for value: 6 + /// + [EnumMember(Value = "6")] + NUMBER_6 = 7 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelReturn.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelReturn.cs deleted file mode 100644 index d7de61fb4aa..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/ModelReturn.cs +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using PropertyChanged; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// Model for testing reserved words - /// - [DataContract] - [ImplementPropertyChanged] - public partial class ModelReturn : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - /// _Return. - public ModelReturn(int? _Return = default(int?)) - { - this._Return = _Return; - } - - /// - /// Gets or Sets _Return - /// - [DataMember(Name="return", EmitDefaultValue=false)] - public int? _Return { 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 ModelReturn {\n"); - sb.Append(" _Return: ").Append(_Return).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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as ModelReturn); - } - - /// - /// Returns true if ModelReturn instances are equal - /// - /// Instance of ModelReturn to be compared - /// Boolean - public bool Equals(ModelReturn input) - { - if (input == null) - return false; - - return - ( - this._Return == input._Return || - (this._Return != null && - this._Return.Equals(input._Return)) - ); - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - if (this._Return != null) - hashCode = hashCode * 59 + this._Return.GetHashCode(); - return hashCode; - } - } - - /// - /// Property changed event handler - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Trigger when a property changed - /// - /// Property Name - public virtual void OnPropertyChanged(string propertyName) - { - // NOTE: property changed is handled via "code weaving" using Fody. - // Properties with setters are modified at compile time to notify of changes. - var propertyChanged = PropertyChanged; - if (propertyChanged != null) - { - propertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - /// - /// 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/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Numbers.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Numbers.cs new file mode 100644 index 00000000000..74486ba1f66 --- /dev/null +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/Numbers.cs @@ -0,0 +1,64 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Text.RegularExpressions; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Runtime.Serialization; +using Newtonsoft.Json; +using Newtonsoft.Json.Converters; +using PropertyChanged; +using System.ComponentModel; +using System.ComponentModel.DataAnnotations; +using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; + +namespace IO.Swagger.Model +{ + /// + /// some number + /// + /// some number + + [JsonConverter(typeof(StringEnumConverter))] + + public enum Numbers + { + + /// + /// Enum _7 for value: 7 + /// + [EnumMember(Value = "7")] + _7 = 1, + + /// + /// Enum _8 for value: 8 + /// + [EnumMember(Value = "8")] + _8 = 2, + + /// + /// Enum _9 for value: 9 + /// + [EnumMember(Value = "9")] + _9 = 3, + + /// + /// Enum _10 for value: 10 + /// + [EnumMember(Value = "10")] + _10 = 4 + } + +} diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterBoolean.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterBoolean.cs deleted file mode 100644 index 2b3eab3b13a..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterBoolean.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using PropertyChanged; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterBoolean - /// - [DataContract] - [ImplementPropertyChanged] - public partial class OuterBoolean : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterBoolean() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterBoolean {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterBoolean); - } - - /// - /// Returns true if OuterBoolean instances are equal - /// - /// Instance of OuterBoolean to be compared - /// Boolean - public bool Equals(OuterBoolean input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - - /// - /// Property changed event handler - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Trigger when a property changed - /// - /// Property Name - public virtual void OnPropertyChanged(string propertyName) - { - // NOTE: property changed is handled via "code weaving" using Fody. - // Properties with setters are modified at compile time to notify of changes. - var propertyChanged = PropertyChanged; - if (propertyChanged != null) - { - propertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - /// - /// 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/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterComposite.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterComposite.cs index dc3cf0b6920..1b7d3aa38be 100644 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterComposite.cs +++ b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterComposite.cs @@ -39,7 +39,7 @@ public partial class OuterComposite : IEquatable, IValidatableO /// myNumber. /// myString. /// myBoolean. - public OuterComposite(OuterNumber myNumber = default(OuterNumber), OuterString myString = default(OuterString), OuterBoolean myBoolean = default(OuterBoolean)) + public OuterComposite(decimal? myNumber = default(decimal?), string myString = default(string), bool? myBoolean = default(bool?)) { this.MyNumber = myNumber; this.MyString = myString; @@ -50,19 +50,19 @@ public partial class OuterComposite : IEquatable, IValidatableO /// Gets or Sets MyNumber /// [DataMember(Name="my_number", EmitDefaultValue=false)] - public OuterNumber MyNumber { get; set; } + public decimal? MyNumber { get; set; } /// /// Gets or Sets MyString /// [DataMember(Name="my_string", EmitDefaultValue=false)] - public OuterString MyString { get; set; } + public string MyString { get; set; } /// /// Gets or Sets MyBoolean /// [DataMember(Name="my_boolean", EmitDefaultValue=false)] - public OuterBoolean MyBoolean { get; set; } + public bool? MyBoolean { get; set; } /// /// Returns the string presentation of the object diff --git a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterNumber.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterNumber.cs deleted file mode 100644 index efdca1968e2..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterNumber.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using PropertyChanged; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterNumber - /// - [DataContract] - [ImplementPropertyChanged] - public partial class OuterNumber : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterNumber() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterNumber {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterNumber); - } - - /// - /// Returns true if OuterNumber instances are equal - /// - /// Instance of OuterNumber to be compared - /// Boolean - public bool Equals(OuterNumber input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - - /// - /// Property changed event handler - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Trigger when a property changed - /// - /// Property Name - public virtual void OnPropertyChanged(string propertyName) - { - // NOTE: property changed is handled via "code weaving" using Fody. - // Properties with setters are modified at compile time to notify of changes. - var propertyChanged = PropertyChanged; - if (propertyChanged != null) - { - propertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - /// - /// 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/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterString.cs b/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterString.cs deleted file mode 100644 index 7f412704f52..00000000000 --- a/samples/client/petstore/csharp/SwaggerClientWithPropertyChanged/src/IO.Swagger/Model/OuterString.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Swagger Petstore - * - * 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 - * Contact: apiteam@swagger.io - * Generated by: https://github.com/swagger-api/swagger-codegen.git - */ - -using System; -using System.Linq; -using System.IO; -using System.Text; -using System.Text.RegularExpressions; -using System.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using PropertyChanged; -using System.ComponentModel; -using System.ComponentModel.DataAnnotations; -using SwaggerDateConverter = IO.Swagger.Client.SwaggerDateConverter; - -namespace IO.Swagger.Model -{ - /// - /// OuterString - /// - [DataContract] - [ImplementPropertyChanged] - public partial class OuterString : IEquatable, IValidatableObject - { - /// - /// Initializes a new instance of the class. - /// - [JsonConstructorAttribute] - public OuterString() - { - } - - /// - /// Returns the string presentation of the object - /// - /// String presentation of the object - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append("class OuterString {\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 JsonConvert.SerializeObject(this, Formatting.Indented); - } - - /// - /// Returns true if objects are equal - /// - /// Object to be compared - /// Boolean - public override bool Equals(object input) - { - return this.Equals(input as OuterString); - } - - /// - /// Returns true if OuterString instances are equal - /// - /// Instance of OuterString to be compared - /// Boolean - public bool Equals(OuterString input) - { - if (input == null) - return false; - - return false; - } - - /// - /// Gets the hash code - /// - /// Hash code - public override int GetHashCode() - { - unchecked // Overflow is fine, just wrap - { - int hashCode = 41; - return hashCode; - } - } - - /// - /// Property changed event handler - /// - public event PropertyChangedEventHandler PropertyChanged; - - /// - /// Trigger when a property changed - /// - /// Property Name - public virtual void OnPropertyChanged(string propertyName) - { - // NOTE: property changed is handled via "code weaving" using Fody. - // Properties with setters are modified at compile time to notify of changes. - var propertyChanged = PropertyChanged; - if (propertyChanged != null) - { - propertyChanged(this, new PropertyChangedEventArgs(propertyName)); - } - } - - /// - /// To validate all properties of the instance - /// - /// Validation context - /// Validation Result - IEnumerable IValidatableObject.Validate(ValidationContext validationContext) - { - yield break; - } - } - -} diff --git a/samples/client/petstore/dart-jaguar/flutter_petstore/lib/main.dart b/samples/client/petstore/dart-jaguar/flutter_petstore/lib/main.dart index e49040d0895..b3116aeda8d 100644 --- a/samples/client/petstore/dart-jaguar/flutter_petstore/lib/main.dart +++ b/samples/client/petstore/dart-jaguar/flutter_petstore/lib/main.dart @@ -19,7 +19,7 @@ class MyApp extends StatelessWidget { return MaterialApp( title: 'Flutter Demo', theme: ThemeData( - // This is the theme of your application. + // This is theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try diff --git a/samples/client/petstore/dart/flutter_petstore/lib/main.dart b/samples/client/petstore/dart/flutter_petstore/lib/main.dart index 969e33354f3..c850001918d 100644 --- a/samples/client/petstore/dart/flutter_petstore/lib/main.dart +++ b/samples/client/petstore/dart/flutter_petstore/lib/main.dart @@ -10,7 +10,7 @@ class MyApp extends StatelessWidget { return new MaterialApp( title: 'Flutter Demo', theme: new ThemeData( - // This is the theme of your application. + // This is theme of your application. // // Try running your application with "flutter run". You'll see the // application has a blue toolbar. Then, without quitting the app, try diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION index 017674fb59d..52f864c9d49 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION +++ b/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.10-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/amount.dart b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/amount.dart index c30804fa2c0..f17f838b90c 100644 --- a/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/amount.dart +++ b/samples/client/petstore/dart/flutter_petstore/swagger/lib/model/amount.dart @@ -17,7 +17,7 @@ class Amount { Amount.fromJson(Map json) { if (json == null) return; value = - json['value'] + json['value'] == null ? null : json['value'].toDouble() ; currency = diff --git a/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION b/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION index 017674fb59d..52f864c9d49 100644 --- a/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION +++ b/samples/client/petstore/dart/swagger-browser-client/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.10-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger-browser-client/lib/model/amount.dart b/samples/client/petstore/dart/swagger-browser-client/lib/model/amount.dart index c30804fa2c0..f17f838b90c 100644 --- a/samples/client/petstore/dart/swagger-browser-client/lib/model/amount.dart +++ b/samples/client/petstore/dart/swagger-browser-client/lib/model/amount.dart @@ -17,7 +17,7 @@ class Amount { Amount.fromJson(Map json) { if (json == null) return; value = - json['value'] + json['value'] == null ? null : json['value'].toDouble() ; currency = diff --git a/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION index 017674fb59d..52f864c9d49 100644 --- a/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION +++ b/samples/client/petstore/dart/swagger/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.10-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/dart/swagger/lib/model/amount.dart b/samples/client/petstore/dart/swagger/lib/model/amount.dart index c30804fa2c0..f17f838b90c 100644 --- a/samples/client/petstore/dart/swagger/lib/model/amount.dart +++ b/samples/client/petstore/dart/swagger/lib/model/amount.dart @@ -17,7 +17,7 @@ class Amount { Amount.fromJson(Map json) { if (json == null) return; value = - json['value'] + json['value'] == null ? null : json['value'].toDouble() ; currency = diff --git a/samples/client/petstore/go/go-petstore-withXml/.swagger-codegen/VERSION b/samples/client/petstore/go/go-petstore-withXml/.swagger-codegen/VERSION index 017674fb59d..0443c4ad098 100644 --- a/samples/client/petstore/go/go-petstore-withXml/.swagger-codegen/VERSION +++ b/samples/client/petstore/go/go-petstore-withXml/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.16-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore-withXml/README.md b/samples/client/petstore/go/go-petstore-withXml/README.md index d3d111dda49..dc14850d4b0 100644 --- a/samples/client/petstore/go/go-petstore-withXml/README.md +++ b/samples/client/petstore/go/go-petstore-withXml/README.md @@ -64,9 +64,11 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) @@ -91,8 +93,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation For Authorization diff --git a/samples/client/petstore/go/go-petstore-withXml/api/swagger.yaml b/samples/client/petstore/go/go-petstore-withXml/api/swagger.yaml index 5031bb90c30..35a55274005 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api/swagger.yaml +++ b/samples/client/petstore/go/go-petstore-withXml/api/swagger.yaml @@ -52,7 +52,7 @@ paths: $ref: "#/definitions/Pet" x-exportParamName: "Body" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: @@ -79,11 +79,11 @@ paths: $ref: "#/definitions/Pet" x-exportParamName: "Body" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" - 405: + "405": description: "Validation exception" security: - petstore_auth: @@ -107,21 +107,21 @@ paths: type: "array" items: type: "string" + default: "available" enum: - "available" - "pending" - "sold" - default: "available" collectionFormat: "csv" x-exportParamName: "Status" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid status value" security: - petstore_auth: @@ -149,13 +149,13 @@ paths: collectionFormat: "csv" x-exportParamName: "Tags" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid tag value" security: - petstore_auth: @@ -181,13 +181,13 @@ paths: format: "int64" x-exportParamName: "PetId" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" security: - api_key: [] @@ -225,7 +225,7 @@ paths: x-exportParamName: "Status" x-optionalDataType: "String" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: @@ -255,7 +255,7 @@ paths: format: "int64" x-exportParamName: "PetId" responses: - 400: + "400": description: "Invalid pet value" security: - petstore_auth: @@ -294,7 +294,7 @@ paths: type: "file" x-exportParamName: "File" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/ApiResponse" @@ -313,7 +313,7 @@ paths: - "application/json" parameters: [] responses: - 200: + "200": description: "successful operation" schema: type: "object" @@ -341,11 +341,11 @@ paths: $ref: "#/definitions/Order" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid Order" /store/order/{order_id}: get: @@ -369,13 +369,13 @@ paths: format: "int64" x-exportParamName: "OrderId" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" delete: tags: @@ -395,9 +395,9 @@ paths: type: "string" x-exportParamName: "OrderId" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" /user: post: @@ -490,7 +490,7 @@ paths: type: "string" x-exportParamName: "Password" responses: - 200: + "200": description: "successful operation" headers: X-Rate-Limit: @@ -503,7 +503,7 @@ paths: description: "date in UTC when token expires" schema: type: "string" - 400: + "400": description: "Invalid username/password supplied" /user/logout: get: @@ -537,13 +537,13 @@ paths: type: "string" x-exportParamName: "Username" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/User" - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" put: tags: @@ -569,9 +569,9 @@ paths: $ref: "#/definitions/User" x-exportParamName: "Body" responses: - 400: + "400": description: "Invalid user supplied" - 404: + "404": description: "User not found" delete: tags: @@ -590,9 +590,9 @@ paths: type: "string" x-exportParamName: "Username" responses: - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" /fake_classname_test: patch: @@ -614,7 +614,7 @@ paths: $ref: "#/definitions/Client" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Client" @@ -639,10 +639,10 @@ paths: type: "array" items: type: "string" + default: "$" enum: - ">" - "$" - default: "$" x-exportParamName: "EnumFormStringArray" - name: "enum_form_string" in: "formData" @@ -663,10 +663,10 @@ paths: type: "array" items: type: "string" + default: "$" enum: - ">" - "$" - default: "$" x-exportParamName: "EnumHeaderStringArray" - name: "enum_header_string" in: "header" @@ -687,10 +687,10 @@ paths: type: "array" items: type: "string" + default: "$" enum: - ">" - "$" - default: "$" x-exportParamName: "EnumQueryStringArray" - name: "enum_query_string" in: "query" @@ -727,9 +727,9 @@ paths: x-exportParamName: "EnumQueryDouble" x-optionalDataType: "Float64" responses: - 400: + "400": description: "Invalid request" - 404: + "404": description: "Not found" post: tags: @@ -863,9 +863,9 @@ paths: x-exportParamName: "Callback" x-optionalDataType: "String" responses: - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" security: - http_basic_test: [] @@ -888,7 +888,7 @@ paths: $ref: "#/definitions/Client" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Client" @@ -907,7 +907,7 @@ paths: $ref: "#/definitions/OuterNumber" x-exportParamName: "Body" responses: - 200: + "200": description: "Output number" schema: $ref: "#/definitions/OuterNumber" @@ -926,7 +926,7 @@ paths: $ref: "#/definitions/OuterString" x-exportParamName: "Body" responses: - 200: + "200": description: "Output string" schema: $ref: "#/definitions/OuterString" @@ -945,7 +945,7 @@ paths: $ref: "#/definitions/OuterBoolean" x-exportParamName: "Body" responses: - 200: + "200": description: "Output boolean" schema: $ref: "#/definitions/OuterBoolean" @@ -964,7 +964,7 @@ paths: $ref: "#/definitions/OuterComposite" x-exportParamName: "Body" responses: - 200: + "200": description: "Output composite" schema: $ref: "#/definitions/OuterComposite" @@ -991,7 +991,7 @@ paths: type: "string" x-exportParamName: "Param2" responses: - 200: + "200": description: "successful operation" /fake/inline-additionalProperties: post: @@ -1013,7 +1013,7 @@ paths: type: "string" x-exportParamName: "Param" responses: - 200: + "200": description: "successful operation" /fake/body-with-query-params: put: @@ -1035,7 +1035,7 @@ paths: type: "string" x-exportParamName: "Query" responses: - 200: + "200": description: "Success" /another-fake/dummy: patch: @@ -1057,7 +1057,7 @@ paths: $ref: "#/definitions/Client" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Client" @@ -1108,12 +1108,12 @@ definitions: xml: name: "Order" example: - id: 0 petId: 6 - complete: false - status: "placed" quantity: 1 + id: 0 shipDate: "2000-01-23T04:56:07.000+00:00" + complete: false + status: "placed" Category: type: "object" properties: @@ -1125,8 +1125,8 @@ definitions: xml: name: "Category" example: - id: 6 name: "name" + id: 6 User: type: "object" properties: @@ -1153,14 +1153,14 @@ definitions: xml: name: "User" example: - id: 0 + firstName: "firstName" lastName: "lastName" + password: "password" + userStatus: 6 phone: "phone" - username: "username" + id: 0 email: "email" - userStatus: 6 - firstName: "firstName" - password: "password" + username: "username" Tag: type: "object" properties: @@ -1172,8 +1172,8 @@ definitions: xml: name: "Tag" example: - id: 1 name: "name" + id: 1 Pet: type: "object" required: @@ -1213,20 +1213,20 @@ definitions: xml: name: "Pet" example: - tags: - - id: 1 - name: "name" - - id: 1 - name: "name" + photoUrls: + - "photoUrls" + - "photoUrls" + name: "doggie" id: 0 category: - id: 6 name: "name" + id: 6 + tags: + - name: "name" + id: 1 + - name: "name" + id: 1 status: "available" - name: "doggie" - photoUrls: - - "photoUrls" - - "photoUrls" ApiResponse: type: "object" properties: @@ -1238,9 +1238,9 @@ definitions: message: type: "string" example: - message: "message" code: 0 type: "type" + message: "message" $special[model.name]: properties: $special[property.name]: @@ -1269,13 +1269,13 @@ definitions: readOnly: true property: type: "string" - 123Number: + "123Number": type: "integer" readOnly: true xml: name: "Name" description: "Model for testing model name same as property name" - 200_response: + "200_response": properties: name: type: "integer" @@ -1444,7 +1444,7 @@ definitions: List: type: "object" properties: - 123-list: + "123-list": type: "string" Client: type: "object" @@ -1574,8 +1574,8 @@ definitions: my_boolean: $ref: "#/definitions/OuterBoolean" example: - my_number: {} my_string: {} + my_number: {} my_boolean: {} OuterNumber: type: "number" diff --git a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go index d3fe864a4f4..89e7e97727b 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_another_fake.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -25,7 +26,7 @@ var ( type AnotherFakeApiService service -/* +/* AnotherFakeApiService To test special tags To test special tags * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -87,9 +88,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -114,3 +113,4 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake.go b/samples/client/petstore/go/go-petstore-withXml/api_fake.go index df64bc00413..b4ed102daf4 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -26,21 +27,21 @@ var ( type FakeApiService service -/* +/* FakeApiService Test serialization of outer boolean types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterBooleanSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterBoolean) - Input boolean as post body @return OuterBoolean */ -type FakeOuterBooleanSerializeOpts struct { +type FakeApiFakeOuterBooleanSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (OuterBoolean, *http.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterBooleanSerializeOpts) (OuterBoolean, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -101,9 +102,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -129,21 +128,21 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of object with outer number type * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterCompositeSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body @return OuterComposite */ -type FakeOuterCompositeSerializeOpts struct { +type FakeApiFakeOuterCompositeSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -204,9 +203,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -232,21 +229,21 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer number types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterNumberSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterNumber) - Input number as post body @return OuterNumber */ -type FakeOuterNumberSerializeOpts struct { +type FakeApiFakeOuterNumberSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (OuterNumber, *http.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterNumberSerializeOpts) (OuterNumber, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -307,9 +304,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -335,21 +330,21 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer string types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterStringSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterString) - Input string as post body @return OuterString */ -type FakeOuterStringSerializeOpts struct { +type FakeApiFakeOuterStringSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (OuterString, *http.Response, error) { +func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterStringSerializeOpts) (OuterString, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -410,9 +405,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -438,7 +431,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body @@ -511,7 +504,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, body User, return localVarHttpResponse, nil } -/* +/* FakeApiService To test \"client\" model To test \"client\" model * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -573,9 +566,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -601,7 +592,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -609,7 +600,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * @param double None * @param patternWithoutDelimiter None * @param byte_ None - * @param optional nil or *TestEndpointParametersOpts - Optional Parameters: + * @param optional nil or *FakeApiTestEndpointParametersOpts - Optional Parameters: * @param "Integer" (optional.Int32) - None * @param "Int32_" (optional.Int32) - None * @param "Int64_" (optional.Int64) - None @@ -624,7 +615,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン */ -type TestEndpointParametersOpts struct { +type FakeApiTestEndpointParametersOpts struct { Integer optional.Int32 Int32_ optional.Int32 Int64_ optional.Int64 @@ -637,7 +628,7 @@ type TestEndpointParametersOpts struct { Callback optional.String } -func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *FakeApiTestEndpointParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -745,11 +736,11 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa return localVarHttpResponse, nil } -/* +/* FakeApiService To test enum parameters To test enum parameters * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *TestEnumParametersOpts - Optional Parameters: + * @param optional nil or *FakeApiTestEnumParametersOpts - Optional Parameters: * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormString" (optional.String) - Form parameter enum test (string) * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) @@ -762,7 +753,7 @@ To test enum parameters */ -type TestEnumParametersOpts struct { +type FakeApiTestEnumParametersOpts struct { EnumFormStringArray optional.Interface EnumFormString optional.String EnumHeaderStringArray optional.Interface @@ -773,7 +764,7 @@ type TestEnumParametersOpts struct { EnumQueryDouble optional.Float64 } -func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *FakeApiTestEnumParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -859,7 +850,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona return localVarHttpResponse, nil } -/* +/* FakeApiService test inline additionalProperties * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -931,7 +922,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par return localVarHttpResponse, nil } -/* +/* FakeApiService test json serialization of form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1003,3 +994,4 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par return localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go index c73a6ed75e4..6dc2f67b0a3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake_classname_tags123.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -25,7 +26,7 @@ var ( type FakeClassnameTags123ApiService service -/* +/* FakeClassnameTags123ApiService To test class name in snake case To test class name in snake case * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -100,9 +101,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -127,3 +126,4 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore-withXml/api_pet.go b/samples/client/petstore/go/go-petstore-withXml/api_pet.go index c9b03c438d9..1d1fd3cfb5d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_pet.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -28,7 +29,7 @@ var ( type PetApiService service -/* +/* PetApiService Add a new pet to the store * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -100,22 +101,22 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e return localVarHttpResponse, nil } -/* +/* PetApiService Deletes a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete - * @param optional nil or *DeletePetOpts - Optional Parameters: + * @param optional nil or *PetApiDeletePetOpts - Optional Parameters: * @param "ApiKey" (optional.String) - */ -type DeletePetOpts struct { +type PetApiDeletePetOpts struct { ApiKey optional.String } -func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { +func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *PetApiDeletePetOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") localVarPostBody interface{} @@ -181,7 +182,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti return localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by status Multiple status values can be provided with comma separated strings * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -242,9 +243,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -270,7 +269,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -331,9 +330,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -359,7 +356,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Find pet by ID Returns a single pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -433,9 +430,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -461,7 +456,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Update an existing pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -533,24 +528,24 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response return localVarHttpResponse, nil } -/* +/* PetApiService Updates a pet in the store with form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated - * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: + * @param optional nil or *PetApiUpdatePetWithFormOpts - Optional Parameters: * @param "Name" (optional.String) - Updated name of the pet * @param "Status" (optional.String) - Updated status of the pet */ -type UpdatePetWithFormOpts struct { +type PetApiUpdatePetWithFormOpts struct { Name optional.String Status optional.String } -func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *PetApiUpdatePetWithFormOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -619,24 +614,24 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca return localVarHttpResponse, nil } -/* +/* PetApiService uploads an image * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update - * @param optional nil or *UploadFileOpts - Optional Parameters: + * @param optional nil or *PetApiUploadFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server * @param "File" (optional.Interface of *os.File) - file to upload @return ModelApiResponse */ -type UploadFileOpts struct { +type PetApiUploadFileOpts struct { AdditionalMetadata optional.String File optional.Interface } -func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ModelApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *PetApiUploadFileOpts) (ModelApiResponse, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -673,7 +668,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) } - var localVarFile *os.File + var localVarFile *os.File if localVarOptionals != nil && localVarOptionals.File.IsSet() { localVarFileOk := false localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File) @@ -706,9 +701,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -733,3 +726,4 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore-withXml/api_store.go b/samples/client/petstore/go/go-petstore-withXml/api_store.go index 0e6aba450ef..92e538eddff 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_store.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -26,7 +27,7 @@ var ( type StoreApiService 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -97,7 +98,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt return localVarHttpResponse, nil } -/* +/* StoreApiService Returns pet inventories by status Returns a map of status codes to quantities * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -169,9 +170,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -197,7 +196,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -264,9 +263,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -292,7 +289,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Place an order for a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -354,9 +351,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -381,3 +376,4 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore-withXml/api_user.go b/samples/client/petstore/go/go-petstore-withXml/api_user.go index 9e8e05374fb..a80240c9ca3 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_user.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -26,7 +27,7 @@ var ( type UserApiService service -/* +/* UserApiService Create user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -98,7 +99,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -170,7 +171,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -242,7 +243,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us return localVarHttpResponse, nil } -/* +/* UserApiService Delete user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -313,7 +314,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http return localVarHttpResponse, nil } -/* +/* UserApiService Get user by user name * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -374,9 +375,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -402,7 +401,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs user into the system * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -465,9 +464,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -493,7 +490,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs out current logged in user session * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -562,7 +559,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) return localVarHttpResponse, nil } -/* +/* UserApiService Updated user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -635,3 +632,4 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U return localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore-withXml/client.go b/samples/client/petstore/go/go-petstore-withXml/client.go index 3c9aacc301c..4c15f024f11 100644 --- a/samples/client/petstore/go/go-petstore-withXml/client.go +++ b/samples/client/petstore/go/go-petstore-withXml/client.go @@ -34,8 +34,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the Swagger Petstore API v1.0.0 @@ -197,7 +197,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -236,6 +236,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -477,4 +487,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md index ea30cde9a03..d0d2bff425d 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/FakeApi.md @@ -27,10 +27,10 @@ Test serialization of outer boolean types Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterBooleanSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -62,10 +62,10 @@ Test serialization of object with outer number type Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterCompositeSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterCompositeSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -97,10 +97,10 @@ Test serialization of outer number types Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterNumberSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -132,10 +132,10 @@ Test serialization of outer string types Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterStringSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterStringSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterStringSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterStringSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -226,10 +226,10 @@ Name | Type | Description | Notes **double** | **float64**| None | **patternWithoutDelimiter** | **string**| None | **byte_** | **string**| None | - **optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiTestEndpointParametersOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a TestEndpointParametersOpts struct +Optional parameters are passed through a pointer to a FakeApiTestEndpointParametersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -274,10 +274,10 @@ To test enum parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***TestEnumParametersOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiTestEnumParametersOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a TestEnumParametersOpts struct +Optional parameters are passed through a pointer to a FakeApiTestEnumParametersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md b/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md index 3498e990c4f..3c50da7a3fe 100644 --- a/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore-withXml/docs/PetApi.md @@ -54,10 +54,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| Pet id to delete | - **optional** | ***DeletePetOpts** | optional parameters | nil if no parameters + **optional** | ***PetApiDeletePetOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a DeletePetOpts struct +Optional parameters are passed through a pointer to a PetApiDeletePetOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -203,10 +203,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| ID of pet that needs to be updated | - **optional** | ***UpdatePetWithFormOpts** | optional parameters | nil if no parameters + **optional** | ***PetApiUpdatePetWithFormOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a UpdatePetWithFormOpts struct +Optional parameters are passed through a pointer to a PetApiUpdatePetWithFormOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -241,10 +241,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| ID of pet to update | - **optional** | ***UploadFileOpts** | optional parameters | nil if no parameters + **optional** | ***PetApiUploadFileOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a UploadFileOpts struct +Optional parameters are passed through a pointer to a PetApiUploadFileOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION b/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION index 017674fb59d..1bdaf4866d9 100644 --- a/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION +++ b/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.20-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/go/go-petstore/README.md b/samples/client/petstore/go/go-petstore/README.md index d3d111dda49..2637183ee36 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/README.md @@ -63,15 +63,19 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [Boolean](docs/Boolean.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Ints](docs/Ints.md) - [List](docs/List.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -80,6 +84,7 @@ Class | Method | HTTP request | Description - [ModelReturn](docs/ModelReturn.md) - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) + - [Numbers](docs/Numbers.md) - [Order](docs/Order.md) - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) @@ -91,8 +96,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation For Authorization diff --git a/samples/client/petstore/go/go-petstore/api/swagger.yaml b/samples/client/petstore/go/go-petstore/api/swagger.yaml index 5031bb90c30..7a6cb59c696 100644 --- a/samples/client/petstore/go/go-petstore/api/swagger.yaml +++ b/samples/client/petstore/go/go-petstore/api/swagger.yaml @@ -52,7 +52,7 @@ paths: $ref: "#/definitions/Pet" x-exportParamName: "Body" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: @@ -79,11 +79,11 @@ paths: $ref: "#/definitions/Pet" x-exportParamName: "Body" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" - 405: + "405": description: "Validation exception" security: - petstore_auth: @@ -115,13 +115,13 @@ paths: collectionFormat: "csv" x-exportParamName: "Status" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid status value" security: - petstore_auth: @@ -149,13 +149,13 @@ paths: collectionFormat: "csv" x-exportParamName: "Tags" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid tag value" security: - petstore_auth: @@ -181,13 +181,13 @@ paths: format: "int64" x-exportParamName: "PetId" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" security: - api_key: [] @@ -225,7 +225,7 @@ paths: x-exportParamName: "Status" x-optionalDataType: "String" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: @@ -255,7 +255,7 @@ paths: format: "int64" x-exportParamName: "PetId" responses: - 400: + "400": description: "Invalid pet value" security: - petstore_auth: @@ -294,7 +294,7 @@ paths: type: "file" x-exportParamName: "File" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/ApiResponse" @@ -313,7 +313,7 @@ paths: - "application/json" parameters: [] responses: - 200: + "200": description: "successful operation" schema: type: "object" @@ -341,11 +341,11 @@ paths: $ref: "#/definitions/Order" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid Order" /store/order/{order_id}: get: @@ -369,13 +369,13 @@ paths: format: "int64" x-exportParamName: "OrderId" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" delete: tags: @@ -395,9 +395,9 @@ paths: type: "string" x-exportParamName: "OrderId" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" /user: post: @@ -490,7 +490,7 @@ paths: type: "string" x-exportParamName: "Password" responses: - 200: + "200": description: "successful operation" headers: X-Rate-Limit: @@ -503,7 +503,7 @@ paths: description: "date in UTC when token expires" schema: type: "string" - 400: + "400": description: "Invalid username/password supplied" /user/logout: get: @@ -537,13 +537,13 @@ paths: type: "string" x-exportParamName: "Username" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/User" - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" put: tags: @@ -569,9 +569,9 @@ paths: $ref: "#/definitions/User" x-exportParamName: "Body" responses: - 400: + "400": description: "Invalid user supplied" - 404: + "404": description: "User not found" delete: tags: @@ -590,9 +590,9 @@ paths: type: "string" x-exportParamName: "Username" responses: - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" /fake_classname_test: patch: @@ -614,7 +614,7 @@ paths: $ref: "#/definitions/Client" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Client" @@ -727,9 +727,9 @@ paths: x-exportParamName: "EnumQueryDouble" x-optionalDataType: "Float64" responses: - 400: + "400": description: "Invalid request" - 404: + "404": description: "Not found" post: tags: @@ -863,9 +863,9 @@ paths: x-exportParamName: "Callback" x-optionalDataType: "String" responses: - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" security: - http_basic_test: [] @@ -888,7 +888,7 @@ paths: $ref: "#/definitions/Client" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Client" @@ -907,7 +907,7 @@ paths: $ref: "#/definitions/OuterNumber" x-exportParamName: "Body" responses: - 200: + "200": description: "Output number" schema: $ref: "#/definitions/OuterNumber" @@ -926,7 +926,7 @@ paths: $ref: "#/definitions/OuterString" x-exportParamName: "Body" responses: - 200: + "200": description: "Output string" schema: $ref: "#/definitions/OuterString" @@ -945,7 +945,7 @@ paths: $ref: "#/definitions/OuterBoolean" x-exportParamName: "Body" responses: - 200: + "200": description: "Output boolean" schema: $ref: "#/definitions/OuterBoolean" @@ -964,7 +964,7 @@ paths: $ref: "#/definitions/OuterComposite" x-exportParamName: "Body" responses: - 200: + "200": description: "Output composite" schema: $ref: "#/definitions/OuterComposite" @@ -991,7 +991,7 @@ paths: type: "string" x-exportParamName: "Param2" responses: - 200: + "200": description: "successful operation" /fake/inline-additionalProperties: post: @@ -1013,7 +1013,7 @@ paths: type: "string" x-exportParamName: "Param" responses: - 200: + "200": description: "successful operation" /fake/body-with-query-params: put: @@ -1035,7 +1035,7 @@ paths: type: "string" x-exportParamName: "Query" responses: - 200: + "200": description: "Success" /another-fake/dummy: patch: @@ -1057,7 +1057,7 @@ paths: $ref: "#/definitions/Client" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Client" @@ -1108,12 +1108,12 @@ definitions: xml: name: "Order" example: - id: 0 petId: 6 - complete: false - status: "placed" quantity: 1 + id: 0 shipDate: "2000-01-23T04:56:07.000+00:00" + complete: false + status: "placed" Category: type: "object" properties: @@ -1125,8 +1125,8 @@ definitions: xml: name: "Category" example: - id: 6 name: "name" + id: 6 User: type: "object" properties: @@ -1153,14 +1153,14 @@ definitions: xml: name: "User" example: - id: 0 + firstName: "firstName" lastName: "lastName" + password: "password" + userStatus: 6 phone: "phone" - username: "username" + id: 0 email: "email" - userStatus: 6 - firstName: "firstName" - password: "password" + username: "username" Tag: type: "object" properties: @@ -1172,8 +1172,8 @@ definitions: xml: name: "Tag" example: - id: 1 name: "name" + id: 1 Pet: type: "object" required: @@ -1213,20 +1213,20 @@ definitions: xml: name: "Pet" example: - tags: - - id: 1 - name: "name" - - id: 1 - name: "name" + photoUrls: + - "photoUrls" + - "photoUrls" + name: "doggie" id: 0 category: - id: 6 name: "name" + id: 6 + tags: + - name: "name" + id: 1 + - name: "name" + id: 1 status: "available" - name: "doggie" - photoUrls: - - "photoUrls" - - "photoUrls" ApiResponse: type: "object" properties: @@ -1238,9 +1238,9 @@ definitions: message: type: "string" example: - message: "message" code: 0 type: "type" + message: "message" $special[model.name]: properties: $special[property.name]: @@ -1269,13 +1269,13 @@ definitions: readOnly: true property: type: "string" - 123Number: + "123Number": type: "integer" readOnly: true xml: name: "Name" description: "Model for testing model name same as property name" - 200_response: + "200_response": properties: name: type: "integer" @@ -1444,7 +1444,7 @@ definitions: List: type: "object" properties: - 123-list: + "123-list": type: "string" Client: type: "object" @@ -1574,8 +1574,8 @@ definitions: my_boolean: $ref: "#/definitions/OuterBoolean" example: - my_number: {} my_string: {} + my_number: {} my_boolean: {} OuterNumber: type: "number" @@ -1583,6 +1583,32 @@ definitions: type: "string" OuterBoolean: type: "boolean" + Boolean: + type: "boolean" + description: "True or False indicator" + enum: + - "true" + - "false" + Ints: + type: "integer" + format: "int32" + description: "True or False indicator" + enum: + - "0" + - "1" + - "2" + - "3" + - "4" + - "5" + - "6" + Numbers: + type: "number" + description: "some number" + enum: + - "7" + - "8" + - "9" + - "10" externalDocs: description: "Find out more about Swagger" url: "http://swagger.io" diff --git a/samples/client/petstore/go/go-petstore/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index d3fe864a4f4..89e7e97727b 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -25,7 +26,7 @@ var ( type AnotherFakeApiService service -/* +/* AnotherFakeApiService To test special tags To test special tags * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -87,9 +88,7 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -114,3 +113,4 @@ func (a *AnotherFakeApiService) TestSpecialTags(ctx context.Context, body Client return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore/api_fake.go b/samples/client/petstore/go/go-petstore/api_fake.go index df64bc00413..b4ed102daf4 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -26,21 +27,21 @@ var ( type FakeApiService service -/* +/* FakeApiService Test serialization of outer boolean types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterBooleanSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterBooleanSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterBoolean) - Input boolean as post body @return OuterBoolean */ -type FakeOuterBooleanSerializeOpts struct { +type FakeApiFakeOuterBooleanSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeOuterBooleanSerializeOpts) (OuterBoolean, *http.Response, error) { +func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterBooleanSerializeOpts) (OuterBoolean, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -101,9 +102,7 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -129,21 +128,21 @@ func (a *FakeApiService) FakeOuterBooleanSerialize(ctx context.Context, localVar return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of object with outer number type * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterCompositeSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterCompositeSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterComposite) - Input composite as post body @return OuterComposite */ -type FakeOuterCompositeSerializeOpts struct { +type FakeApiFakeOuterCompositeSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { +func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterCompositeSerializeOpts) (OuterComposite, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -204,9 +203,7 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -232,21 +229,21 @@ func (a *FakeApiService) FakeOuterCompositeSerialize(ctx context.Context, localV return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer number types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterNumberSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterNumberSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterNumber) - Input number as post body @return OuterNumber */ -type FakeOuterNumberSerializeOpts struct { +type FakeApiFakeOuterNumberSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeOuterNumberSerializeOpts) (OuterNumber, *http.Response, error) { +func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterNumberSerializeOpts) (OuterNumber, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -307,9 +304,7 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -335,21 +330,21 @@ func (a *FakeApiService) FakeOuterNumberSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Test serialization of outer string types * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *FakeOuterStringSerializeOpts - Optional Parameters: + * @param optional nil or *FakeApiFakeOuterStringSerializeOpts - Optional Parameters: * @param "Body" (optional.Interface of OuterString) - Input string as post body @return OuterString */ -type FakeOuterStringSerializeOpts struct { +type FakeApiFakeOuterStringSerializeOpts struct { Body optional.Interface } -func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeOuterStringSerializeOpts) (OuterString, *http.Response, error) { +func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarOptionals *FakeApiFakeOuterStringSerializeOpts) (OuterString, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -410,9 +405,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -438,7 +431,7 @@ func (a *FakeApiService) FakeOuterStringSerialize(ctx context.Context, localVarO return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param body @@ -511,7 +504,7 @@ func (a *FakeApiService) TestBodyWithQueryParams(ctx context.Context, body User, return localVarHttpResponse, nil } -/* +/* FakeApiService To test \"client\" model To test \"client\" model * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -573,9 +566,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -601,7 +592,7 @@ func (a *FakeApiService) TestClientModel(ctx context.Context, body Client) (Clie return localVarReturnValue, localVarHttpResponse, nil } -/* +/* FakeApiService Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -609,7 +600,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン * @param double None * @param patternWithoutDelimiter None * @param byte_ None - * @param optional nil or *TestEndpointParametersOpts - Optional Parameters: + * @param optional nil or *FakeApiTestEndpointParametersOpts - Optional Parameters: * @param "Integer" (optional.Int32) - None * @param "Int32_" (optional.Int32) - None * @param "Int64_" (optional.Int64) - None @@ -624,7 +615,7 @@ Fake endpoint for testing various parameters 假端點 偽のエンドポイン */ -type TestEndpointParametersOpts struct { +type FakeApiTestEndpointParametersOpts struct { Integer optional.Int32 Int32_ optional.Int32 Int64_ optional.Int64 @@ -637,7 +628,7 @@ type TestEndpointParametersOpts struct { Callback optional.String } -func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *TestEndpointParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number float32, double float64, patternWithoutDelimiter string, byte_ string, localVarOptionals *FakeApiTestEndpointParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -745,11 +736,11 @@ func (a *FakeApiService) TestEndpointParameters(ctx context.Context, number floa return localVarHttpResponse, nil } -/* +/* FakeApiService To test enum parameters To test enum parameters * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - * @param optional nil or *TestEnumParametersOpts - Optional Parameters: + * @param optional nil or *FakeApiTestEnumParametersOpts - Optional Parameters: * @param "EnumFormStringArray" (optional.Interface of []string) - Form parameter enum test (string array) * @param "EnumFormString" (optional.String) - Form parameter enum test (string) * @param "EnumHeaderStringArray" (optional.Interface of []string) - Header parameter enum test (string array) @@ -762,7 +753,7 @@ To test enum parameters */ -type TestEnumParametersOpts struct { +type FakeApiTestEnumParametersOpts struct { EnumFormStringArray optional.Interface EnumFormString optional.String EnumHeaderStringArray optional.Interface @@ -773,7 +764,7 @@ type TestEnumParametersOpts struct { EnumQueryDouble optional.Float64 } -func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *TestEnumParametersOpts) (*http.Response, error) { +func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptionals *FakeApiTestEnumParametersOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Get") localVarPostBody interface{} @@ -859,7 +850,7 @@ func (a *FakeApiService) TestEnumParameters(ctx context.Context, localVarOptiona return localVarHttpResponse, nil } -/* +/* FakeApiService test inline additionalProperties * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -931,7 +922,7 @@ func (a *FakeApiService) TestInlineAdditionalProperties(ctx context.Context, par return localVarHttpResponse, nil } -/* +/* FakeApiService test json serialization of form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -1003,3 +994,4 @@ func (a *FakeApiService) TestJsonFormData(ctx context.Context, param string, par return localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go index c73a6ed75e4..6dc2f67b0a3 100644 --- a/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go +++ b/samples/client/petstore/go/go-petstore/api_fake_classname_tags123.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -25,7 +26,7 @@ var ( type FakeClassnameTags123ApiService service -/* +/* FakeClassnameTags123ApiService To test class name in snake case To test class name in snake case * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -100,9 +101,7 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -127,3 +126,4 @@ func (a *FakeClassnameTags123ApiService) TestClassname(ctx context.Context, body return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore/api_pet.go b/samples/client/petstore/go/go-petstore/api_pet.go index c9b03c438d9..1d1fd3cfb5d 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -28,7 +29,7 @@ var ( type PetApiService service -/* +/* PetApiService Add a new pet to the store * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -100,22 +101,22 @@ func (a *PetApiService) AddPet(ctx context.Context, body Pet) (*http.Response, e return localVarHttpResponse, nil } -/* +/* PetApiService Deletes a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId Pet id to delete - * @param optional nil or *DeletePetOpts - Optional Parameters: + * @param optional nil or *PetApiDeletePetOpts - Optional Parameters: * @param "ApiKey" (optional.String) - */ -type DeletePetOpts struct { +type PetApiDeletePetOpts struct { ApiKey optional.String } -func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *DeletePetOpts) (*http.Response, error) { +func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOptionals *PetApiDeletePetOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Delete") localVarPostBody interface{} @@ -181,7 +182,7 @@ func (a *PetApiService) DeletePet(ctx context.Context, petId int64, localVarOpti return localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by status Multiple status values can be provided with comma separated strings * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -242,9 +243,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -270,7 +269,7 @@ func (a *PetApiService) FindPetsByStatus(ctx context.Context, status []string) ( return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Finds Pets by tags Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -331,9 +330,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -359,7 +356,7 @@ func (a *PetApiService) FindPetsByTags(ctx context.Context, tags []string) ([]Pe return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Find pet by ID Returns a single pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -433,9 +430,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -461,7 +456,7 @@ func (a *PetApiService) GetPetById(ctx context.Context, petId int64) (Pet, *http return localVarReturnValue, localVarHttpResponse, nil } -/* +/* PetApiService Update an existing pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -533,24 +528,24 @@ func (a *PetApiService) UpdatePet(ctx context.Context, body Pet) (*http.Response return localVarHttpResponse, nil } -/* +/* PetApiService Updates a pet in the store with form data * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet that needs to be updated - * @param optional nil or *UpdatePetWithFormOpts - Optional Parameters: + * @param optional nil or *PetApiUpdatePetWithFormOpts - Optional Parameters: * @param "Name" (optional.String) - Updated name of the pet * @param "Status" (optional.String) - Updated status of the pet */ -type UpdatePetWithFormOpts struct { +type PetApiUpdatePetWithFormOpts struct { Name optional.String Status optional.String } -func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *UpdatePetWithFormOpts) (*http.Response, error) { +func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, localVarOptionals *PetApiUpdatePetWithFormOpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -619,24 +614,24 @@ func (a *PetApiService) UpdatePetWithForm(ctx context.Context, petId int64, loca return localVarHttpResponse, nil } -/* +/* PetApiService uploads an image * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). * @param petId ID of pet to update - * @param optional nil or *UploadFileOpts - Optional Parameters: + * @param optional nil or *PetApiUploadFileOpts - Optional Parameters: * @param "AdditionalMetadata" (optional.String) - Additional data to pass to server * @param "File" (optional.Interface of *os.File) - file to upload @return ModelApiResponse */ -type UploadFileOpts struct { +type PetApiUploadFileOpts struct { AdditionalMetadata optional.String File optional.Interface } -func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *UploadFileOpts) (ModelApiResponse, *http.Response, error) { +func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOptionals *PetApiUploadFileOpts) (ModelApiResponse, *http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Post") localVarPostBody interface{} @@ -673,7 +668,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarOptionals != nil && localVarOptionals.AdditionalMetadata.IsSet() { localVarFormParams.Add("additionalMetadata", parameterToString(localVarOptionals.AdditionalMetadata.Value(), "")) } - var localVarFile *os.File + var localVarFile *os.File if localVarOptionals != nil && localVarOptionals.File.IsSet() { localVarFileOk := false localVarFile, localVarFileOk = localVarOptionals.File.Value().(*os.File) @@ -706,9 +701,7 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -733,3 +726,4 @@ func (a *PetApiService) UploadFile(ctx context.Context, petId int64, localVarOpt return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore/api_store.go b/samples/client/petstore/go/go-petstore/api_store.go index 0e6aba450ef..92e538eddff 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -26,7 +27,7 @@ var ( type StoreApiService 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 ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -97,7 +98,7 @@ func (a *StoreApiService) DeleteOrder(ctx context.Context, orderId string) (*htt return localVarHttpResponse, nil } -/* +/* StoreApiService Returns pet inventories by status Returns a map of status codes to quantities * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -169,9 +170,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -197,7 +196,7 @@ func (a *StoreApiService) GetInventory(ctx context.Context) (map[string]int32, * return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Find purchase order by ID For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -264,9 +263,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -292,7 +289,7 @@ func (a *StoreApiService) GetOrderById(ctx context.Context, orderId int64) (Orde return localVarReturnValue, localVarHttpResponse, nil } -/* +/* StoreApiService Place an order for a pet * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -354,9 +351,7 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -381,3 +376,4 @@ func (a *StoreApiService) PlaceOrder(ctx context.Context, body Order) (Order, *h return localVarReturnValue, localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore/api_user.go b/samples/client/petstore/go/go-petstore/api_user.go index 9e8e05374fb..a80240c9ca3 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore * @@ -26,7 +27,7 @@ var ( type UserApiService service -/* +/* UserApiService Create user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -98,7 +99,7 @@ func (a *UserApiService) CreateUser(ctx context.Context, body User) (*http.Respo return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -170,7 +171,7 @@ func (a *UserApiService) CreateUsersWithArrayInput(ctx context.Context, body []U return localVarHttpResponse, nil } -/* +/* UserApiService Creates list of users with given input array * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -242,7 +243,7 @@ func (a *UserApiService) CreateUsersWithListInput(ctx context.Context, body []Us return localVarHttpResponse, nil } -/* +/* UserApiService Delete user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -313,7 +314,7 @@ func (a *UserApiService) DeleteUser(ctx context.Context, username string) (*http return localVarHttpResponse, nil } -/* +/* UserApiService Get user by user name * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -374,9 +375,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -402,7 +401,7 @@ func (a *UserApiService) GetUserByName(ctx context.Context, username string) (Us return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs user into the system * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -465,9 +464,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor if localVarHttpResponse.StatusCode < 300 { // If we succeed, return the data, otherwise pass on to decode error. err = a.client.decode(&localVarReturnValue, localVarBody, localVarHttpResponse.Header.Get("Content-Type")); - if err == nil { - return localVarReturnValue, localVarHttpResponse, err - } + return localVarReturnValue, localVarHttpResponse, err } if localVarHttpResponse.StatusCode >= 300 { @@ -493,7 +490,7 @@ func (a *UserApiService) LoginUser(ctx context.Context, username string, passwor return localVarReturnValue, localVarHttpResponse, nil } -/* +/* UserApiService Logs out current logged in user session * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -562,7 +559,7 @@ func (a *UserApiService) LogoutUser(ctx context.Context) (*http.Response, error) return localVarHttpResponse, nil } -/* +/* UserApiService Updated user This can only be done by the logged in user. * @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -635,3 +632,4 @@ func (a *UserApiService) UpdateUser(ctx context.Context, username string, body U return localVarHttpResponse, nil } + diff --git a/samples/client/petstore/go/go-petstore/client.go b/samples/client/petstore/go/go-petstore/client.go index 3c9aacc301c..4c15f024f11 100644 --- a/samples/client/petstore/go/go-petstore/client.go +++ b/samples/client/petstore/go/go-petstore/client.go @@ -34,8 +34,8 @@ import ( ) var ( - jsonCheck = regexp.MustCompile("(?i:[application|text]/json)") - xmlCheck = regexp.MustCompile("(?i:[application|text]/xml)") + jsonCheck = regexp.MustCompile("(?i:(?:application|text)/json)") + xmlCheck = regexp.MustCompile("(?i:(?:application|text)/xml)") ) // APIClient manages communication with the Swagger Petstore API v1.0.0 @@ -197,7 +197,7 @@ func (c *APIClient) prepareRequest( } // add form parameters and file if available. - if len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(fileBytes) > 0 && fileName != "") { if body != nil { return nil, errors.New("Cannot specify postBody and multipart form at the same time.") } @@ -236,6 +236,16 @@ func (c *APIClient) prepareRequest( w.Close() } + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + // Setup path and query parameters url, err := url.Parse(path) if err != nil { @@ -477,4 +487,4 @@ func (e GenericSwaggerError) Body() []byte { // Model returns the unpacked model of the error func (e GenericSwaggerError) Model() interface{} { return e.model -} \ No newline at end of file +} diff --git a/samples/client/petstore/go/go-petstore/docs/Boolean.md b/samples/client/petstore/go/go-petstore/docs/Boolean.md new file mode 100644 index 00000000000..d0b536f8086 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/Boolean.md @@ -0,0 +1,9 @@ +# Boolean + +## 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/go/go-petstore/docs/FakeApi.md b/samples/client/petstore/go/go-petstore/docs/FakeApi.md index ea30cde9a03..ecb030cd17d 100644 --- a/samples/client/petstore/go/go-petstore/docs/FakeApi.md +++ b/samples/client/petstore/go/go-petstore/docs/FakeApi.md @@ -27,10 +27,10 @@ Test serialization of outer boolean types Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterBooleanSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterBooleanSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterBooleanSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -62,10 +62,10 @@ Test serialization of object with outer number type Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterCompositeSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterCompositeSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterCompositeSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -97,10 +97,10 @@ Test serialization of outer number types Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterNumberSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterNumberSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterNumberSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -132,10 +132,10 @@ Test serialization of outer string types Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***FakeOuterStringSerializeOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiFakeOuterStringSerializeOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a FakeOuterStringSerializeOpts struct +Optional parameters are passed through a pointer to a FakeApiFakeOuterStringSerializeOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -226,10 +226,10 @@ Name | Type | Description | Notes **double** | **float64**| None | **patternWithoutDelimiter** | **string**| None | **byte_** | **string**| None | - **optional** | ***TestEndpointParametersOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiTestEndpointParametersOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a TestEndpointParametersOpts struct +Optional parameters are passed through a pointer to a FakeApiTestEndpointParametersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -274,10 +274,10 @@ To test enum parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **optional** | ***TestEnumParametersOpts** | optional parameters | nil if no parameters + **optional** | ***FakeApiTestEnumParametersOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a TestEnumParametersOpts struct +Optional parameters are passed through a pointer to a FakeApiTestEnumParametersOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -316,7 +316,7 @@ test inline additionalProperties Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. - **param** | [**interface{}**](interface{}.md)| request body | + **param** | **interface{}**| request body | ### Return type diff --git a/samples/client/petstore/go/go-petstore/docs/Ints.md b/samples/client/petstore/go/go-petstore/docs/Ints.md new file mode 100644 index 00000000000..78218e2a730 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/Ints.md @@ -0,0 +1,9 @@ +# Ints + +## 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/go/go-petstore/docs/Numbers.md b/samples/client/petstore/go/go-petstore/docs/Numbers.md new file mode 100644 index 00000000000..33da59af68c --- /dev/null +++ b/samples/client/petstore/go/go-petstore/docs/Numbers.md @@ -0,0 +1,9 @@ +# Numbers + +## 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/go/go-petstore/docs/PetApi.md b/samples/client/petstore/go/go-petstore/docs/PetApi.md index 3498e990c4f..3c50da7a3fe 100644 --- a/samples/client/petstore/go/go-petstore/docs/PetApi.md +++ b/samples/client/petstore/go/go-petstore/docs/PetApi.md @@ -54,10 +54,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| Pet id to delete | - **optional** | ***DeletePetOpts** | optional parameters | nil if no parameters + **optional** | ***PetApiDeletePetOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a DeletePetOpts struct +Optional parameters are passed through a pointer to a PetApiDeletePetOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -203,10 +203,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| ID of pet that needs to be updated | - **optional** | ***UpdatePetWithFormOpts** | optional parameters | nil if no parameters + **optional** | ***PetApiUpdatePetWithFormOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a UpdatePetWithFormOpts struct +Optional parameters are passed through a pointer to a PetApiUpdatePetWithFormOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- @@ -241,10 +241,10 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc. **petId** | **int64**| ID of pet to update | - **optional** | ***UploadFileOpts** | optional parameters | nil if no parameters + **optional** | ***PetApiUploadFileOpts** | optional parameters | nil if no parameters ### Optional Parameters -Optional parameters are passed through a pointer to a UploadFileOpts struct +Optional parameters are passed through a pointer to a PetApiUploadFileOpts struct Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/go/go-petstore/model_boolean.go b/samples/client/petstore/go/go-petstore/model_boolean.go new file mode 100644 index 00000000000..3361f159495 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_boolean.go @@ -0,0 +1,19 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package petstore +// Boolean : True or False indicator +type Boolean bool + +// List of Boolean +const ( + TRUE Boolean = true + FALSE Boolean = false +) diff --git a/samples/client/petstore/go/go-petstore/model_enum_class.go b/samples/client/petstore/go/go-petstore/model_enum_class.go index ca1f2daae70..4950a03e747 100644 --- a/samples/client/petstore/go/go-petstore/model_enum_class.go +++ b/samples/client/petstore/go/go-petstore/model_enum_class.go @@ -14,7 +14,7 @@ type EnumClass string // List of EnumClass const ( - ABC_EnumClass EnumClass = "_abc" - EFG_EnumClass EnumClass = "-efg" - XYZ_EnumClass EnumClass = "(xyz)" + ABC EnumClass = "_abc" + EFG EnumClass = "-efg" + XYZ EnumClass = "(xyz)" ) diff --git a/samples/client/petstore/go/go-petstore/model_ints.go b/samples/client/petstore/go/go-petstore/model_ints.go new file mode 100644 index 00000000000..5b84b665bf8 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_ints.go @@ -0,0 +1,24 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package petstore +// Ints : True or False indicator +type Ints int32 + +// List of Ints +const ( + _0 Ints = 0 + _1 Ints = 1 + _2 Ints = 2 + _3 Ints = 3 + _4 Ints = 4 + _5 Ints = 5 + _6 Ints = 6 +) diff --git a/samples/client/petstore/go/go-petstore/model_numbers.go b/samples/client/petstore/go/go-petstore/model_numbers.go new file mode 100644 index 00000000000..4cf7b54cef5 --- /dev/null +++ b/samples/client/petstore/go/go-petstore/model_numbers.go @@ -0,0 +1,21 @@ +/* + * Swagger Petstore + * + * 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 + * Contact: apiteam@swagger.io + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package petstore +// Numbers : some number +type Numbers float32 + +// List of Numbers +const ( + _7 Numbers = 7 + _8 Numbers = 8 + _9 Numbers = 9 + _10 Numbers = 10 +) diff --git a/samples/client/petstore/go/go-petstore/model_outer_enum.go b/samples/client/petstore/go/go-petstore/model_outer_enum.go index 31ce691a70a..0e724d17c5c 100644 --- a/samples/client/petstore/go/go-petstore/model_outer_enum.go +++ b/samples/client/petstore/go/go-petstore/model_outer_enum.go @@ -14,7 +14,7 @@ type OuterEnum string // List of OuterEnum const ( - PLACED_OuterEnum OuterEnum = "placed" - APPROVED_OuterEnum OuterEnum = "approved" - DELIVERED_OuterEnum OuterEnum = "delivered" + PLACED OuterEnum = "placed" + APPROVED OuterEnum = "approved" + DELIVERED OuterEnum = "delivered" ) diff --git a/samples/client/petstore/go/pet_api_test.go b/samples/client/petstore/go/pet_api_test.go index aa16a8b8acc..d2ea96acead 100644 --- a/samples/client/petstore/go/pet_api_test.go +++ b/samples/client/petstore/go/pet_api_test.go @@ -75,7 +75,7 @@ func TestGetPetByIdWithInvalidID(t *testing.T) { } func TestUpdatePetWithForm(t *testing.T) { - r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830, &sw.UpdatePetWithFormOpts{ + r, err := client.PetApi.UpdatePetWithForm(context.Background(), 12830, &sw.PetApiUpdatePetWithFormOpts{ Name: optional.NewString("golang"), Status: optional.NewString("available"), }) @@ -104,7 +104,7 @@ func TestFindPetsByTag(t *testing.T) { assert := assert.New(t) for i := 0; i < len(resp); i++ { if resp[i].Id == 12830 { - assert.Equal(resp[i].Status, "pending", "Pet status should be `pending`") + assert.Equal(resp[i].Status, "available", "Pet status should be `available`") found = true } } @@ -145,7 +145,7 @@ func TestFindPetsByStatus(t *testing.T) { func TestUploadFile(t *testing.T) { file, _ := os.Open("../python/testfiles/foo.png") - _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.UploadFileOpts{ + _, r, err := client.PetApi.UploadFile(context.Background(), 12830, &sw.PetApiUploadFileOpts{ AdditionalMetadata: optional.NewString("golang"), File: optional.NewInterface(file), }) diff --git a/samples/client/petstore/groovy/build.gradle b/samples/client/petstore/groovy/build.gradle index cc54061bf46..51150d40c6e 100644 --- a/samples/client/petstore/groovy/build.gradle +++ b/samples/client/petstore/groovy/build.gradle @@ -24,7 +24,7 @@ repositories { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.10.1" + jackson_version = "2.11.4" } dependencies { diff --git a/samples/client/petstore/java/feign/.swagger-codegen/VERSION b/samples/client/petstore/java/feign/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/client/petstore/java/feign/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/feign/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/README.md b/samples/client/petstore/java/feign/README.md index d5d447e2865..debee3090f7 100644 --- a/samples/client/petstore/java/feign/README.md +++ b/samples/client/petstore/java/feign/README.md @@ -34,7 +34,7 @@ After the client library is installed/deployed, you can use it in your Maven pro ## Recommendation -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issue. +It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. ## Author diff --git a/samples/client/petstore/java/feign/build.gradle b/samples/client/petstore/java/feign/build.gradle index 4f1ab5acc60..cb4cff18558 100644 --- a/samples/client/petstore/java/feign/build.gradle +++ b/samples/client/petstore/java/feign/build.gradle @@ -95,7 +95,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.9" - jackson_version = "2.10.1" + jackson_version = "2.11.4" threepane_version = "2.6.4" feign_version = "9.4.0" feign_form_version = "2.1.0" diff --git a/samples/client/petstore/java/feign/build.sbt b/samples/client/petstore/java/feign/build.sbt index d79374bf81e..5b81eb30e57 100644 --- a/samples/client/petstore/java/feign/build.sbt +++ b/samples/client/petstore/java/feign/build.sbt @@ -14,10 +14,10 @@ lazy val root = (project in file(".")). "io.github.openfeign" % "feign-jackson" % "9.4.0" % "compile", "io.github.openfeign" % "feign-slf4j" % "9.4.0" % "compile", "io.github.openfeign.form" % "feign-form" % "2.1.0" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.11.4" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", "com.brsanthu" % "migbase64" % "2.2" % "compile", "junit" % "junit" % "4.12" % "test", diff --git a/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 0437c4dd8cc..00000000000 --- a/samples/client/petstore/java/feign/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ - -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **Map<String, String>** | | [optional] -**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Animal.md b/samples/client/petstore/java/feign/docs/Animal.md deleted file mode 100644 index b3f325c3524..00000000000 --- a/samples/client/petstore/java/feign/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/AnimalFarm.md b/samples/client/petstore/java/feign/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/feign/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 77292549927..00000000000 --- a/samples/client/petstore/java/feign/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md deleted file mode 100644 index e8cc4cd36dc..00000000000 --- a/samples/client/petstore/java/feign/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ArrayTest.md b/samples/client/petstore/java/feign/docs/ArrayTest.md deleted file mode 100644 index 9feee16427f..00000000000 --- a/samples/client/petstore/java/feign/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **List<String>** | | [optional] -**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] -**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Cat.md b/samples/client/petstore/java/feign/docs/Cat.md deleted file mode 100644 index be6e56fa8ce..00000000000 --- a/samples/client/petstore/java/feign/docs/Cat.md +++ /dev/null @@ -1,12 +0,0 @@ - -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] -**declawed** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Category.md b/samples/client/petstore/java/feign/docs/Category.md deleted file mode 100644 index e2df0803278..00000000000 --- a/samples/client/petstore/java/feign/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Dog.md b/samples/client/petstore/java/feign/docs/Dog.md deleted file mode 100644 index 71a7dbe809e..00000000000 --- a/samples/client/petstore/java/feign/docs/Dog.md +++ /dev/null @@ -1,12 +0,0 @@ - -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] -**breed** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/EnumClass.md b/samples/client/petstore/java/feign/docs/EnumClass.md deleted file mode 100644 index c746edc3cb1..00000000000 --- a/samples/client/petstore/java/feign/docs/EnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ - -# EnumClass - -## Enum - - -* `_ABC` (value: `"_abc"`) - -* `_EFG` (value: `"-efg"`) - -* `_XYZ_` (value: `"(xyz)"`) - - - diff --git a/samples/client/petstore/java/feign/docs/EnumTest.md b/samples/client/petstore/java/feign/docs/EnumTest.md deleted file mode 100644 index deb1951c552..00000000000 --- a/samples/client/petstore/java/feign/docs/EnumTest.md +++ /dev/null @@ -1,36 +0,0 @@ - -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] -**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] -**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] - - - -## Enum: EnumStringEnum -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" - - - -## Enum: EnumIntegerEnum -Name | Value ----- | ----- -NUMBER_1 | 1 -NUMBER_MINUS_1 | -1 - - - -## Enum: EnumNumberEnum -Name | Value ----- | ----- -NUMBER_1_DOT_1 | 1.1 -NUMBER_MINUS_1_DOT_2 | -1.2 - - - diff --git a/samples/client/petstore/java/feign/docs/FakeApi.md b/samples/client/petstore/java/feign/docs/FakeApi.md deleted file mode 100644 index 21a4db7c377..00000000000 --- a/samples/client/petstore/java/feign/docs/FakeApi.md +++ /dev/null @@ -1,122 +0,0 @@ -# FakeApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testEndpointParameters**](FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -[**testEnumQueryParameters**](FakeApi.md#testEnumQueryParameters) | **GET** /fake | To test enum query parameters - - - -# **testEndpointParameters** -> testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -BigDecimal number = new BigDecimal(); // BigDecimal | None -Double _double = 3.4D; // Double | None -String string = "string_example"; // String | None -byte[] _byte = B; // byte[] | None -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -byte[] binary = B; // byte[] | None -LocalDate date = new LocalDate(); // LocalDate | None -DateTime dateTime = new DateTime(); // DateTime | None -String password = "password_example"; // String | None -try { - apiInstance.testEndpointParameters(number, _double, string, _byte, integer, int32, int64, _float, binary, date, dateTime, password); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **string** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **DateTime**| None | [optional] - **password** | **String**| None | [optional] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 - - -# **testEnumQueryParameters** -> testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble) - -To test enum query parameters - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -String enumQueryString = "-efg"; // String | Query parameter enum test (string) -BigDecimal enumQueryInteger = new BigDecimal(); // BigDecimal | Query parameter enum test (double) -Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) -try { - apiInstance.testEnumQueryParameters(enumQueryString, enumQueryInteger, enumQueryDouble); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEnumQueryParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **BigDecimal**| Query parameter enum test (double) | [optional] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/feign/docs/FormatTest.md b/samples/client/petstore/java/feign/docs/FormatTest.md deleted file mode 100644 index 44de7d9511a..00000000000 --- a/samples/client/petstore/java/feign/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ - -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | | [optional] -**int32** | **Integer** | | [optional] -**int64** | **Long** | | [optional] -**number** | [**BigDecimal**](BigDecimal.md) | | -**_float** | **Float** | | [optional] -**_double** | **Double** | | [optional] -**string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] -**date** | [**LocalDate**](LocalDate.md) | | -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**uuid** | **String** | | [optional] -**password** | **String** | | - - - diff --git a/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md deleted file mode 100644 index c1d0aac5672..00000000000 --- a/samples/client/petstore/java/feign/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ - -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/MapTest.md b/samples/client/petstore/java/feign/docs/MapTest.md deleted file mode 100644 index c671e97ffbc..00000000000 --- a/samples/client/petstore/java/feign/docs/MapTest.md +++ /dev/null @@ -1,17 +0,0 @@ - -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] -**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] - - - -## Enum: Map<String, InnerEnum> -Name | Value ----- | ----- - - - diff --git a/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index e3487bcc501..00000000000 --- a/samples/client/petstore/java/feign/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ - -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | **String** | | [optional] -**dateTime** | [**DateTime**](DateTime.md) | | [optional] -**map** | [**Map<String, Animal>**](Animal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Model200Response.md b/samples/client/petstore/java/feign/docs/Model200Response.md deleted file mode 100644 index b47618b28cc..00000000000 --- a/samples/client/petstore/java/feign/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | [optional] -**PropertyClass** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ModelApiResponse.md b/samples/client/petstore/java/feign/docs/ModelApiResponse.md deleted file mode 100644 index 3eec8686cc9..00000000000 --- a/samples/client/petstore/java/feign/docs/ModelApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ModelApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/ModelReturn.md b/samples/client/petstore/java/feign/docs/ModelReturn.md deleted file mode 100644 index a679b04953e..00000000000 --- a/samples/client/petstore/java/feign/docs/ModelReturn.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ModelReturn - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Integer** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Name.md b/samples/client/petstore/java/feign/docs/Name.md deleted file mode 100644 index ce2fb4dee50..00000000000 --- a/samples/client/petstore/java/feign/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | -**snakeCase** | **Integer** | | [optional] -**property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/NumberOnly.md b/samples/client/petstore/java/feign/docs/NumberOnly.md deleted file mode 100644 index a3feac7fadc..00000000000 --- a/samples/client/petstore/java/feign/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/Order.md b/samples/client/petstore/java/feign/docs/Order.md deleted file mode 100644 index a1089f5384e..00000000000 --- a/samples/client/petstore/java/feign/docs/Order.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**petId** | **Long** | | [optional] -**quantity** | **Integer** | | [optional] -**shipDate** | [**DateTime**](DateTime.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] -**complete** | **Boolean** | | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" - - - diff --git a/samples/client/petstore/java/feign/docs/Pet.md b/samples/client/petstore/java/feign/docs/Pet.md deleted file mode 100644 index 5b63109ef92..00000000000 --- a/samples/client/petstore/java/feign/docs/Pet.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **List<String>** | | -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -AVAILABLE | "available" -PENDING | "pending" -SOLD | "sold" - - - diff --git a/samples/client/petstore/java/feign/docs/PetApi.md b/samples/client/petstore/java/feign/docs/PetApi.md deleted file mode 100644 index e0314e20e51..00000000000 --- a/samples/client/petstore/java/feign/docs/PetApi.md +++ /dev/null @@ -1,448 +0,0 @@ -# PetApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**addPet**](PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -[**deletePet**](PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -[**findPetsByStatus**](PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -[**findPetsByTags**](PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -[**getPetById**](PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -[**updatePet**](PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -[**updatePetWithForm**](PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -[**uploadFile**](PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image - - - -# **addPet** -> addPet(body) - -Add a new pet to the store - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.addPet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete -String apiKey = "apiKey_example"; // String | -try { - apiInstance.deletePet(petId, apiKey); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByStatus** -> List<Pet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter -try { - List result = apiInstance.findPetsByStatus(status); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); - e.printStackTrace(); -} -``` - -### 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 request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List tags = Arrays.asList("tags_example"); // List | Tags to filter by -try { - List result = apiInstance.findPetsByTags(tags); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return -try { - Pet result = apiInstance.getPetById(petId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(body) - -Update an existing pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.updatePet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated -String name = "name_example"; // String | Updated name of the pet -String status = "status_example"; // String | Updated status of the pet -try { - apiInstance.updatePetWithForm(petId, name, status); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json - - -# **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update -String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload -try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md b/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md deleted file mode 100644 index 426b7cde95a..00000000000 --- a/samples/client/petstore/java/feign/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ - -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/SpecialModelName.md b/samples/client/petstore/java/feign/docs/SpecialModelName.md deleted file mode 100644 index c2c6117c552..00000000000 --- a/samples/client/petstore/java/feign/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ - -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/StoreApi.md b/samples/client/petstore/java/feign/docs/StoreApi.md deleted file mode 100644 index 0b30791725a..00000000000 --- a/samples/client/petstore/java/feign/docs/StoreApi.md +++ /dev/null @@ -1,197 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{orderId} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{orderId} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted -try { - apiInstance.deleteOrder(orderId); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#deleteOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getInventory** -> Map<String, Integer> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.StoreApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -StoreApi apiInstance = new StoreApi(); -try { - Map result = apiInstance.getInventory(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getInventory"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -[**Map<String, Integer>**](Map.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched -try { - Order result = apiInstance.getOrderById(orderId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getOrderById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet -try { - Order result = apiInstance.placeOrder(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#placeOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/feign/docs/Tag.md b/samples/client/petstore/java/feign/docs/Tag.md deleted file mode 100644 index de6814b55d5..00000000000 --- a/samples/client/petstore/java/feign/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/User.md b/samples/client/petstore/java/feign/docs/User.md deleted file mode 100644 index 8b6753dd284..00000000000 --- a/samples/client/petstore/java/feign/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ - -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Integer** | User Status | [optional] - - - diff --git a/samples/client/petstore/java/feign/docs/UserApi.md b/samples/client/petstore/java/feign/docs/UserApi.md deleted file mode 100644 index 8cdc15992ee..00000000000 --- a/samples/client/petstore/java/feign/docs/UserApi.md +++ /dev/null @@ -1,370 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(body) - -Create user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object -try { - apiInstance.createUser(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithArrayInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithListInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithListInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted -try { - apiInstance.deleteUser(username); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. -try { - User result = apiInstance.getUserByName(username); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserByName"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The user name for login -String password = "password_example"; // String | The password for login in clear text -try { - String result = apiInstance.loginUser(username, password); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#loginUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -try { - apiInstance.logoutUser(); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#logoutUser"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object -try { - apiInstance.updateUser(username, body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index f8e5e037e30..3a1c9215eb4 100644 --- a/samples/client/petstore/java/feign/pom.xml +++ b/samples/client/petstore/java/feign/pom.xml @@ -268,12 +268,12 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.4.0 2.1.0 - 2.10.1 + 2.11.4 2.6.4 - 4.12 + 4.13.1 1.0.0 1.0.1 diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java index daefd52aed7..06ec271623f 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java index 18d50df62fb..a7ce02b7ac1 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java index dec431cf77e..6dd16b910dd 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java index 1c0816f7b08..d2ed608f202 100644 --- a/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java index c27524de1f6..9b5e4f2ba21 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/PetApiTest.java @@ -29,6 +29,7 @@ public class PetApiTest { @Before public void setup() { apiClient = new ApiClient(); + apiClient.setBasePath("http://petstore.swagger.io:80/v2"); api = apiClient.buildClient(PetApi.class); localServer = new MockWebServer(); localClient = new ApiClient(); diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java index 5492695f8aa..61782ed1b2f 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/StoreApiTest.java @@ -21,6 +21,7 @@ public class StoreApiTest { @Before public void setup() { ApiClient apiClient = new ApiClient(); + apiClient.setBasePath("http://petstore.swagger.io:80/v2"); api = apiClient.buildClient(StoreApi.class); } diff --git a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java index d1c9b67f722..f8d6616a569 100644 --- a/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/feign/src/test/java/io/swagger/client/api/UserApiTest.java @@ -16,6 +16,7 @@ public class UserApiTest { @Before public void setup() { ApiClient apiClient = new ApiClient(); + apiClient.setBasePath("http://petstore.swagger.io:80/v2"); api = apiClient.buildClient(UserApi.class); } diff --git a/samples/client/petstore/java/google-api-client/.swagger-codegen/VERSION b/samples/client/petstore/java/google-api-client/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/client/petstore/java/google-api-client/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/google-api-client/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index fae19029a3d..0530780ac5c 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -35,7 +35,7 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -51,7 +51,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -63,12 +63,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -86,7 +86,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = 'swagger-petstore-google-api-client' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath @@ -94,11 +94,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" google_api_client_version = "1.23.0" jersey_common_version = "2.29.1" - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" junit_version = "4.12" jackson_threeten_version = "2.6.4" } diff --git a/samples/client/petstore/java/google-api-client/build.sbt b/samples/client/petstore/java/google-api-client/build.sbt index 7374e3dac71..69452f52c2f 100644 --- a/samples/client/petstore/java/google-api-client/build.sbt +++ b/samples/client/petstore/java/google-api-client/build.sbt @@ -12,9 +12,9 @@ lazy val root = (project in file(".")). "io.swagger" % "swagger-annotations" % "1.5.17", "com.google.api-client" % "google-api-client" % "1.23.0", "org.glassfish.jersey.core" % "jersey-common" % "2.29.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/google-api-client/docs/Ints.md b/samples/client/petstore/java/google-api-client/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/google-api-client/docs/ModelBoolean.md b/samples/client/petstore/java/google-api-client/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/google-api-client/docs/ModelList.md b/samples/client/petstore/java/google-api-client/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/google-api-client/docs/Numbers.md b/samples/client/petstore/java/google-api-client/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index d2ea0f1d2fe..9118024f60c 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -250,9 +250,9 @@ 1.5.17 1.23.0 2.29.1 - 2.10.1 + 2.11.4 2.6.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java index daefd52aed7..06ec271623f 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java index 18d50df62fb..a7ce02b7ac1 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java index dec431cf77e..6dd16b910dd 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java index 1c0816f7b08..d2ed608f202 100644 --- a/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/google-api-client/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey1/build.gradle b/samples/client/petstore/java/jersey1/build.gradle index 9f3bb3cb70b..57c00d31b34 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -90,7 +90,7 @@ if(hasProperty('target') && target == 'android') { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath } - + task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource @@ -108,10 +108,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.6.4" jersey_version = "1.19.4" - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" junit_version = "4.12" } diff --git a/samples/client/petstore/java/jersey1/docs/Ints.md b/samples/client/petstore/java/jersey1/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/jersey1/docs/ModelBoolean.md b/samples/client/petstore/java/jersey1/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/jersey1/docs/ModelList.md b/samples/client/petstore/java/jersey1/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey1/docs/Numbers.md b/samples/client/petstore/java/jersey1/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/jersey1/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/jersey1/pom.xml b/samples/client/petstore/java/jersey1/pom.xml index 5b0aa55e110..fbf08a0f257 100644 --- a/samples/client/petstore/java/jersey1/pom.xml +++ b/samples/client/petstore/java/jersey1/pom.xml @@ -262,6 +262,6 @@ 1.19.4 2.6.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java index b5c1c21eefe..af34d858267 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/ApiClient.java @@ -640,12 +640,12 @@ private ClientResponse getAPIResponse(String path, String method, List que builder = httpClient.resource(url).accept(accept); } - for (Entry keyValue : headerParams.entrySet()) { - builder = builder.header(keyValue.getKey(), keyValue.getValue()); + for (String key : headerParams.keySet()) { + builder = builder.header(key, headerParams.get(key)); } - for (Map.Entry keyValue : defaultHeaderMap.entrySet()) { - if (!headerParams.containsKey(keyValue.getKey())) { - builder = builder.header(keyValue.getKey(), keyValue.getValue()); + for (String key : defaultHeaderMap.keySet()) { + if (!headerParams.containsKey(key)) { + builder = builder.header(key, defaultHeaderMap.get(key)); } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java index daefd52aed7..06ec271623f 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java index 18d50df62fb..a7ce02b7ac1 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java index dec431cf77e..6dd16b910dd 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java index 1c0816f7b08..d2ed608f202 100644 --- a/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java index c7fb92d2552..908f6e82e07 100644 --- a/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/jersey1/src/test/java/io/swagger/client/api/UserApiTest.java @@ -64,7 +64,7 @@ public void testLoginUser() throws Exception { api.createUser(user); String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + assertTrue(token.contains("logged in user session:")); } @Test diff --git a/samples/client/petstore/java/jersey2-java6/.gitignore b/samples/client/petstore/java/jersey2-java6/.gitignore deleted file mode 100644 index a530464afa1..00000000000 --- a/samples/client/petstore/java/jersey2-java6/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -*.class - -# Mobile Tools for Java (J2ME) -.mtj.tmp/ - -# Package Files # -*.jar -*.war -*.ear - -# exclude jar for gradle wrapper -!gradle/wrapper/*.jar - -# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml -hs_err_pid* - -# build files -**/target -target -.gradle -build diff --git a/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION deleted file mode 100644 index 017674fb59d..00000000000 --- a/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -2.4.3-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/.travis.yml b/samples/client/petstore/java/jersey2-java6/.travis.yml deleted file mode 100644 index 70cb81a67c2..00000000000 --- a/samples/client/petstore/java/jersey2-java6/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -# -# Generated by: https://github.com/swagger-api/swagger-codegen.git -# -language: java -jdk: - - oraclejdk8 - - oraclejdk7 -before_install: - # ensure gradlew has proper permission - - chmod a+x ./gradlew -script: - # test using maven - - mvn test - # uncomment below to test using gradle - # - gradle test - # uncomment below to test using sbt - # - sbt test diff --git a/samples/client/petstore/java/jersey2-java6/README.md b/samples/client/petstore/java/jersey2-java6/README.md deleted file mode 100644 index b53485ad7d9..00000000000 --- a/samples/client/petstore/java/jersey2-java6/README.md +++ /dev/null @@ -1,198 +0,0 @@ -# swagger-petstore-jersey2-java6 - -## Requirements - -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. - -## Installation - -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. - -### Maven users - -Add this dependency to your project's POM: - -```xml - - io.swagger - swagger-petstore-jersey2-java6 - 1.0.0 - compile - -``` - -### Gradle users - -Add this dependency to your project's build file: - -```groovy -compile "io.swagger:swagger-petstore-jersey2-java6:1.0.0" -``` - -### Others - -At first generate the JAR by executing: - - mvn package - -Then manually install the following JARs: - -* target/swagger-petstore-jersey2-java6-1.0.0.jar -* target/lib/*.jar - -## Getting Started - -Please follow the [installation](#installation) instruction and execute the following Java code: - -```java - -import io.swagger.client.*; -import io.swagger.client.auth.*; -import io.swagger.client.model.*; -import io.swagger.client.api.AnotherFakeApi; - -import java.io.File; -import java.util.*; - -public class AnotherFakeApiExample { - - public static void main(String[] args) { - - AnotherFakeApi apiInstance = new AnotherFakeApi(); - Client body = new Client(); // Client | client model - try { - Client result = apiInstance.testSpecialTags(body); - System.out.println(result); - } catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); - e.printStackTrace(); - } - } -} - -``` - -## Documentation for API Endpoints - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AnotherFakeApi* | [**testSpecialTags**](docs/AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags -*FakeApi* | [**fakeOuterBooleanSerialize**](docs/FakeApi.md#fakeOuterBooleanSerialize) | **POST** /fake/outer/boolean | -*FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | -*FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | -*FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | -*FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model -*FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -*FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters -*FakeApi* | [**testInlineAdditionalProperties**](docs/FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -*FakeApi* | [**testJsonFormData**](docs/FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data -*FakeClassnameTags123Api* | [**testClassname**](docs/FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case -*PetApi* | [**addPet**](docs/PetApi.md#addPet) | **POST** /pet | Add a new pet to the store -*PetApi* | [**deletePet**](docs/PetApi.md#deletePet) | **DELETE** /pet/{petId} | Deletes a pet -*PetApi* | [**findPetsByStatus**](docs/PetApi.md#findPetsByStatus) | **GET** /pet/findByStatus | Finds Pets by status -*PetApi* | [**findPetsByTags**](docs/PetApi.md#findPetsByTags) | **GET** /pet/findByTags | Finds Pets by tags -*PetApi* | [**getPetById**](docs/PetApi.md#getPetById) | **GET** /pet/{petId} | Find pet by ID -*PetApi* | [**updatePet**](docs/PetApi.md#updatePet) | **PUT** /pet | Update an existing pet -*PetApi* | [**updatePetWithForm**](docs/PetApi.md#updatePetWithForm) | **POST** /pet/{petId} | Updates a pet in the store with form data -*PetApi* | [**uploadFile**](docs/PetApi.md#uploadFile) | **POST** /pet/{petId}/uploadImage | uploads an image -*StoreApi* | [**deleteOrder**](docs/StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -*StoreApi* | [**getInventory**](docs/StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -*StoreApi* | [**getOrderById**](docs/StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID -*StoreApi* | [**placeOrder**](docs/StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet -*UserApi* | [**createUser**](docs/UserApi.md#createUser) | **POST** /user | Create user -*UserApi* | [**createUsersWithArrayInput**](docs/UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -*UserApi* | [**createUsersWithListInput**](docs/UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -*UserApi* | [**deleteUser**](docs/UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -*UserApi* | [**getUserByName**](docs/UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -*UserApi* | [**loginUser**](docs/UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -*UserApi* | [**logoutUser**](docs/UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -*UserApi* | [**updateUser**](docs/UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - -## Documentation for Models - - - [AdditionalPropertiesClass](docs/AdditionalPropertiesClass.md) - - [Animal](docs/Animal.md) - - [AnimalFarm](docs/AnimalFarm.md) - - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - - [ArrayTest](docs/ArrayTest.md) - - [Capitalization](docs/Capitalization.md) - - [Category](docs/Category.md) - - [ClassModel](docs/ClassModel.md) - - [Client](docs/Client.md) - - [EnumArrays](docs/EnumArrays.md) - - [EnumClass](docs/EnumClass.md) - - [EnumTest](docs/EnumTest.md) - - [FormatTest](docs/FormatTest.md) - - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) - - [MapTest](docs/MapTest.md) - - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - - [Model200Response](docs/Model200Response.md) - - [ModelApiResponse](docs/ModelApiResponse.md) - - [ModelReturn](docs/ModelReturn.md) - - [Name](docs/Name.md) - - [NumberOnly](docs/NumberOnly.md) - - [Order](docs/Order.md) - - [OuterComposite](docs/OuterComposite.md) - - [OuterEnum](docs/OuterEnum.md) - - [Pet](docs/Pet.md) - - [ReadOnlyFirst](docs/ReadOnlyFirst.md) - - [SpecialModelName](docs/SpecialModelName.md) - - [Tag](docs/Tag.md) - - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) - - -## Documentation for Authorization - -Authentication schemes defined for the API: -### 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 - -### 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 - - -## Recommendation - -It's recommended to create an instance of `ApiClient` per thread in a multithreaded environment to avoid any potential issues. - -## Author - -apiteam@swagger.io - diff --git a/samples/client/petstore/java/jersey2-java6/build.gradle b/samples/client/petstore/java/jersey2-java6/build.gradle deleted file mode 100644 index 6f54775fc64..00000000000 --- a/samples/client/petstore/java/jersey2-java6/build.gradle +++ /dev/null @@ -1,117 +0,0 @@ -apply plugin: 'idea' -apply plugin: 'eclipse' - -group = 'io.swagger' -version = '1.0.0' - -buildscript { - repositories { - jcenter() - } - dependencies { - classpath 'com.android.tools.build:gradle:2.3.+' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' - } -} - -repositories { - jcenter() -} - - -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_7 - targetCompatibility JavaVersion.VERSION_1_7 - } - - // 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 'javax.annotation:jsr250-api:1.0' - } - } - - 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); - } - } - - task sourcesJar(type: Jar) { - from android.sourceSets.main.java.srcDirs - classifier = 'sources' - } - - artifacts { - archives sourcesJar - } - -} else { - - apply plugin: 'java' - apply plugin: 'maven' - sourceCompatibility = JavaVersion.VERSION_1_7 - targetCompatibility = JavaVersion.VERSION_1_7 - - install { - repositories.mavenInstaller { - pom.artifactId = 'swagger-petstore-jersey2-java6' - } - } - - task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath - } -} - -ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.8.9" - jersey_version = "2.6" - commons_io_version=2.5 - commons_lang3_version=3.6 - junit_version = "4.12" -} - -dependencies { - compile "io.swagger:swagger-annotations:$swagger_annotations_version" - compile "org.glassfish.jersey.core:jersey-client:$jersey_version" - compile "org.glassfish.jersey.media:jersey-media-multipart:$jersey_version" - compile "org.glassfish.jersey.media:jersey-media-json-jackson:$jersey_version" - compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" - compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" - compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" - compile "commons-io:commons-io:$commons_io_version" - compile "org.apache.commons:commons-lang3:$commons_lang3_version" - compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version", - compile "com.brsanthu:migbase64:2.2" - testCompile "junit:junit:$junit_version" -} diff --git a/samples/client/petstore/java/jersey2-java6/build.sbt b/samples/client/petstore/java/jersey2-java6/build.sbt deleted file mode 100644 index 2e7737c2d69..00000000000 --- a/samples/client/petstore/java/jersey2-java6/build.sbt +++ /dev/null @@ -1,26 +0,0 @@ -lazy val root = (project in file(".")). - settings( - organization := "io.swagger", - name := "swagger-petstore-jersey2-java6", - version := "1.0.0", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "io.swagger" % "swagger-annotations" % "1.5.17", - "org.glassfish.jersey.core" % "jersey-client" % "2.6", - "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.6", - "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.6", - "com.fasterxml.jackson.core" % "jackson-core" % "2.6.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.6.4" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.6.4" % "compile", - "com.github.joschi.jackson" % "jackson-datatype-threetenbp" % "2.6.4" % "compile", - "com.brsanthu" % "migbase64" % "2.2", - "org.apache.commons" % "commons-lang3" % "3.6", - "commons-io" % "commons-io" % "2.5", - "junit" % "junit" % "4.12" % "test", - "com.novocode" % "junit-interface" % "0.10" % "test" - ) - ) diff --git a/samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md deleted file mode 100644 index 0437c4dd8cc..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/AdditionalPropertiesClass.md +++ /dev/null @@ -1,11 +0,0 @@ - -# AdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapProperty** | **Map<String, String>** | | [optional] -**mapOfMapProperty** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Animal.md b/samples/client/petstore/java/jersey2-java6/docs/Animal.md deleted file mode 100644 index b3f325c3524..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Animal.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Animal - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**className** | **String** | | -**color** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnimalFarm.md b/samples/client/petstore/java/jersey2-java6/docs/AnimalFarm.md deleted file mode 100644 index c7c7f1ddcce..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/AnimalFarm.md +++ /dev/null @@ -1,9 +0,0 @@ - -# AnimalFarm - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md deleted file mode 100644 index 7a04619aaba..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/AnotherFakeApi.md +++ /dev/null @@ -1,54 +0,0 @@ -# AnotherFakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testSpecialTags**](AnotherFakeApi.md#testSpecialTags) | **PATCH** /another-fake/dummy | To test special tags - - - -# **testSpecialTags** -> Client testSpecialTags(body) - -To test special tags - -To test special tags - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.AnotherFakeApi; - - -AnotherFakeApi apiInstance = new AnotherFakeApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testSpecialTags(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling AnotherFakeApi#testSpecialTags"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2-java6/docs/ArrayOfArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java6/docs/ArrayOfArrayOfNumberOnly.md deleted file mode 100644 index 77292549927..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/ArrayOfArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayArrayNumber** | [**List<List<BigDecimal>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/ArrayOfNumberOnly.md b/samples/client/petstore/java/jersey2-java6/docs/ArrayOfNumberOnly.md deleted file mode 100644 index e8cc4cd36dc..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/ArrayOfNumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ArrayOfNumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayNumber** | [**List<BigDecimal>**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md b/samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md deleted file mode 100644 index 9feee16427f..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/ArrayTest.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ArrayTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**arrayOfString** | **List<String>** | | [optional] -**arrayArrayOfInteger** | [**List<List<Long>>**](List.md) | | [optional] -**arrayArrayOfModel** | [**List<List<ReadOnlyFirst>>**](List.md) | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Capitalization.md b/samples/client/petstore/java/jersey2-java6/docs/Capitalization.md deleted file mode 100644 index 0f3064c1996..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Capitalization.md +++ /dev/null @@ -1,15 +0,0 @@ - -# Capitalization - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**smallCamel** | **String** | | [optional] -**capitalCamel** | **String** | | [optional] -**smallSnake** | **String** | | [optional] -**capitalSnake** | **String** | | [optional] -**scAETHFlowPoints** | **String** | | [optional] -**ATT_NAME** | **String** | Name of the pet | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Cat.md b/samples/client/petstore/java/jersey2-java6/docs/Cat.md deleted file mode 100644 index 6e9f71ce7dd..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Cat.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Cat - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**declawed** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Category.md b/samples/client/petstore/java/jersey2-java6/docs/Category.md deleted file mode 100644 index e2df0803278..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Category.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Category - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/ClassModel.md b/samples/client/petstore/java/jersey2-java6/docs/ClassModel.md deleted file mode 100644 index 64f880c8786..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/ClassModel.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ClassModel - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**propertyClass** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Client.md b/samples/client/petstore/java/jersey2-java6/docs/Client.md deleted file mode 100644 index 5c490ea166c..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Client.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Client - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**client** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Dog.md b/samples/client/petstore/java/jersey2-java6/docs/Dog.md deleted file mode 100644 index ac7cea323ff..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Dog.md +++ /dev/null @@ -1,10 +0,0 @@ - -# Dog - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**breed** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/EnumArrays.md b/samples/client/petstore/java/jersey2-java6/docs/EnumArrays.md deleted file mode 100644 index 4dddc0bfd27..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/EnumArrays.md +++ /dev/null @@ -1,27 +0,0 @@ - -# EnumArrays - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justSymbol** | [**JustSymbolEnum**](#JustSymbolEnum) | | [optional] -**arrayEnum** | [**List<ArrayEnumEnum>**](#List<ArrayEnumEnum>) | | [optional] - - - -## Enum: JustSymbolEnum -Name | Value ----- | ----- -GREATER_THAN_OR_EQUAL_TO | ">=" -DOLLAR | "$" - - - -## Enum: List<ArrayEnumEnum> -Name | Value ----- | ----- -FISH | "fish" -CRAB | "crab" - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/EnumClass.md b/samples/client/petstore/java/jersey2-java6/docs/EnumClass.md deleted file mode 100644 index c746edc3cb1..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/EnumClass.md +++ /dev/null @@ -1,14 +0,0 @@ - -# EnumClass - -## Enum - - -* `_ABC` (value: `"_abc"`) - -* `_EFG` (value: `"-efg"`) - -* `_XYZ_` (value: `"(xyz)"`) - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md b/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md deleted file mode 100644 index ca048bcc515..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/EnumTest.md +++ /dev/null @@ -1,48 +0,0 @@ - -# EnumTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**enumString** | [**EnumStringEnum**](#EnumStringEnum) | | [optional] -**enumStringRequired** | [**EnumStringRequiredEnum**](#EnumStringRequiredEnum) | | -**enumInteger** | [**EnumIntegerEnum**](#EnumIntegerEnum) | | [optional] -**enumNumber** | [**EnumNumberEnum**](#EnumNumberEnum) | | [optional] -**outerEnum** | [**OuterEnum**](OuterEnum.md) | | [optional] - - - -## Enum: EnumStringEnum -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" -EMPTY | "" - - - -## Enum: EnumStringRequiredEnum -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" -EMPTY | "" - - - -## Enum: EnumIntegerEnum -Name | Value ----- | ----- -NUMBER_1 | 1 -NUMBER_MINUS_1 | -1 - - - -## Enum: EnumNumberEnum -Name | Value ----- | ----- -NUMBER_1_DOT_1 | 1.1 -NUMBER_MINUS_1_DOT_2 | -1.2 - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md b/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md deleted file mode 100644 index d5b690c99d2..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeApi.md +++ /dev/null @@ -1,514 +0,0 @@ -# FakeApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**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 | -[**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 -[**testInlineAdditionalProperties**](FakeApi.md#testInlineAdditionalProperties) | **POST** /fake/inline-additionalProperties | test inline additionalProperties -[**testJsonFormData**](FakeApi.md#testJsonFormData) | **GET** /fake/jsonFormData | test json serialization of form data - - - -# **fakeOuterBooleanSerialize** -> Boolean fakeOuterBooleanSerialize(body) - - - -Test serialization of outer boolean types - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -Boolean body = true; // Boolean | Input boolean as post body -try { - Boolean result = apiInstance.fakeOuterBooleanSerialize(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterBooleanSerialize"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Boolean**](Boolean.md)| Input boolean as post body | [optional] - -### Return type - -**Boolean** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **fakeOuterCompositeSerialize** -> OuterComposite fakeOuterCompositeSerialize(body) - - - -Test serialization of object with outer number type - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -OuterComposite body = new OuterComposite(); // OuterComposite | Input composite as post body -try { - OuterComposite result = apiInstance.fakeOuterCompositeSerialize(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterCompositeSerialize"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**OuterComposite**](OuterComposite.md)| Input composite as post body | [optional] - -### Return type - -[**OuterComposite**](OuterComposite.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **fakeOuterNumberSerialize** -> BigDecimal fakeOuterNumberSerialize(body) - - - -Test serialization of outer number types - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -BigDecimal body = new BigDecimal(); // BigDecimal | Input number as post body -try { - BigDecimal result = apiInstance.fakeOuterNumberSerialize(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterNumberSerialize"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**BigDecimal**](BigDecimal.md)| Input number as post body | [optional] - -### Return type - -[**BigDecimal**](BigDecimal.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **fakeOuterStringSerialize** -> String fakeOuterStringSerialize(body) - - - -Test serialization of outer string types - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -String body = "body_example"; // String | Input string as post body -try { - String result = apiInstance.fakeOuterStringSerialize(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#fakeOuterStringSerialize"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**String**](String.md)| Input string as post body | [optional] - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: Not defined - - -# **testBodyWithQueryParams** -> testBodyWithQueryParams(body, query) - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -User body = new User(); // User | -String query = "query_example"; // String | -try { - apiInstance.testBodyWithQueryParams(body, query); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testBodyWithQueryParams"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| | - **query** | **String**| | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **testClientModel** -> Client testClientModel(body) - -To test \"client\" model - -To test \"client\" model - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClientModel(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testClientModel"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - - -# **testEndpointParameters** -> testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback) - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.FakeApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure HTTP basic authorization: http_basic_test -HttpBasicAuth http_basic_test = (HttpBasicAuth) defaultClient.getAuthentication("http_basic_test"); -http_basic_test.setUsername("YOUR USERNAME"); -http_basic_test.setPassword("YOUR PASSWORD"); - -FakeApi apiInstance = new FakeApi(); -BigDecimal number = new BigDecimal(); // BigDecimal | None -Double _double = 3.4D; // Double | None -String patternWithoutDelimiter = "patternWithoutDelimiter_example"; // String | None -byte[] _byte = B; // byte[] | None -Integer integer = 56; // Integer | None -Integer int32 = 56; // Integer | None -Long int64 = 789L; // Long | None -Float _float = 3.4F; // Float | None -String string = "string_example"; // String | None -byte[] binary = B; // byte[] | None -LocalDate date = LocalDate.now(); // LocalDate | None -OffsetDateTime dateTime = OffsetDateTime.now(); // OffsetDateTime | None -String password = "password_example"; // String | None -String paramCallback = "paramCallback_example"; // String | None -try { - apiInstance.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEndpointParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **number** | **BigDecimal**| None | - **_double** | **Double**| None | - **patternWithoutDelimiter** | **String**| None | - **_byte** | **byte[]**| None | - **integer** | **Integer**| None | [optional] - **int32** | **Integer**| None | [optional] - **int64** | **Long**| None | [optional] - **_float** | **Float**| None | [optional] - **string** | **String**| None | [optional] - **binary** | **byte[]**| None | [optional] - **date** | **LocalDate**| None | [optional] - **dateTime** | **OffsetDateTime**| None | [optional] - **password** | **String**| None | [optional] - **paramCallback** | **String**| None | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[http_basic_test](../README.md#http_basic_test) - -### HTTP request headers - - - **Content-Type**: application/xml; charset=utf-8, application/json; charset=utf-8 - - **Accept**: application/xml; charset=utf-8, application/json; charset=utf-8 - - -# **testEnumParameters** -> testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble) - -To test enum parameters - -To test enum parameters - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -List enumFormStringArray = Arrays.asList("enumFormStringArray_example"); // List | Form parameter enum test (string array) -String enumFormString = "-efg"; // String | Form parameter enum test (string) -List enumHeaderStringArray = Arrays.asList("enumHeaderStringArray_example"); // List | Header parameter enum test (string array) -String enumHeaderString = "-efg"; // String | Header parameter enum test (string) -List enumQueryStringArray = Arrays.asList("enumQueryStringArray_example"); // List | Query parameter enum test (string array) -String enumQueryString = "-efg"; // String | Query parameter enum test (string) -Integer enumQueryInteger = 56; // Integer | Query parameter enum test (double) -Double enumQueryDouble = 3.4D; // Double | Query parameter enum test (double) -try { - apiInstance.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testEnumParameters"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **enumFormStringArray** | [**List<String>**](String.md)| Form parameter enum test (string array) | [optional] [enum: >, $] - **enumFormString** | **String**| Form parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumHeaderStringArray** | [**List<String>**](String.md)| Header parameter enum test (string array) | [optional] [enum: >, $] - **enumHeaderString** | **String**| Header parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryStringArray** | [**List<String>**](String.md)| Query parameter enum test (string array) | [optional] [enum: >, $] - **enumQueryString** | **String**| Query parameter enum test (string) | [optional] [default to -efg] [enum: _abc, -efg, (xyz)] - **enumQueryInteger** | **Integer**| Query parameter enum test (double) | [optional] [enum: 1, -2] - **enumQueryDouble** | **Double**| Query parameter enum test (double) | [optional] [enum: 1.1, -1.2] - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: */* - - **Accept**: */* - - -# **testInlineAdditionalProperties** -> testInlineAdditionalProperties(param) - -test inline additionalProperties - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -Object param = null; // Object | request body -try { - apiInstance.testInlineAdditionalProperties(param); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testInlineAdditionalProperties"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **Object**| request body | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - - -# **testJsonFormData** -> testJsonFormData(param, param2) - -test json serialization of form data - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeApi; - - -FakeApi apiInstance = new FakeApi(); -String param = "param_example"; // String | field1 -String param2 = "param2_example"; // String | field2 -try { - apiInstance.testJsonFormData(param, param2); -} catch (ApiException e) { - System.err.println("Exception when calling FakeApi#testJsonFormData"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **param** | **String**| field1 | - **param2** | **String**| field2 | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: Not defined - diff --git a/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md b/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md deleted file mode 100644 index eb030817b50..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/FakeClassnameTags123Api.md +++ /dev/null @@ -1,64 +0,0 @@ -# FakeClassnameTags123Api - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeClassnameTags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.FakeClassnameTags123Api; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key_query -ApiKeyAuth api_key_query = (ApiKeyAuth) defaultClient.getAuthentication("api_key_query"); -api_key_query.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key_query.setApiKeyPrefix("Token"); - -FakeClassnameTags123Api apiInstance = new FakeClassnameTags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeClassnameTags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -[api_key_query](../README.md#api_key_query) - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md b/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md deleted file mode 100644 index c7a3acb3cb7..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/FormatTest.md +++ /dev/null @@ -1,22 +0,0 @@ - -# FormatTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**integer** | **Integer** | | [optional] -**int32** | **Integer** | | [optional] -**int64** | **Long** | | [optional] -**number** | [**BigDecimal**](BigDecimal.md) | | -**_float** | **Float** | | [optional] -**_double** | **Double** | | [optional] -**string** | **String** | | [optional] -**_byte** | **byte[]** | | -**binary** | **byte[]** | | [optional] -**date** | [**LocalDate**](LocalDate.md) | | -**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] -**uuid** | [**UUID**](UUID.md) | | [optional] -**password** | **String** | | - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/HasOnlyReadOnly.md b/samples/client/petstore/java/jersey2-java6/docs/HasOnlyReadOnly.md deleted file mode 100644 index c1d0aac5672..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/HasOnlyReadOnly.md +++ /dev/null @@ -1,11 +0,0 @@ - -# HasOnlyReadOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**foo** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md b/samples/client/petstore/java/jersey2-java6/docs/MapTest.md deleted file mode 100644 index 714a97a40d9..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/MapTest.md +++ /dev/null @@ -1,19 +0,0 @@ - -# MapTest - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**mapMapOfString** | [**Map<String, Map<String, String>>**](Map.md) | | [optional] -**mapOfEnumString** | [**Map<String, InnerEnum>**](#Map<String, InnerEnum>) | | [optional] - - - -## Enum: Map<String, InnerEnum> -Name | Value ----- | ----- -UPPER | "UPPER" -LOWER | "lower" - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md b/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md deleted file mode 100644 index b12e2cd70e6..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/MixedPropertiesAndAdditionalPropertiesClass.md +++ /dev/null @@ -1,12 +0,0 @@ - -# MixedPropertiesAndAdditionalPropertiesClass - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**uuid** | [**UUID**](UUID.md) | | [optional] -**dateTime** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] -**map** | [**Map<String, Animal>**](Animal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Model200Response.md b/samples/client/petstore/java/jersey2-java6/docs/Model200Response.md deleted file mode 100644 index 5b3a9a0e46d..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Model200Response.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Model200Response - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | [optional] -**propertyClass** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/ModelApiResponse.md b/samples/client/petstore/java/jersey2-java6/docs/ModelApiResponse.md deleted file mode 100644 index 3eec8686cc9..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/ModelApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ModelApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/ModelReturn.md b/samples/client/petstore/java/jersey2-java6/docs/ModelReturn.md deleted file mode 100644 index a679b04953e..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/ModelReturn.md +++ /dev/null @@ -1,10 +0,0 @@ - -# ModelReturn - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_return** | **Integer** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Name.md b/samples/client/petstore/java/jersey2-java6/docs/Name.md deleted file mode 100644 index ce2fb4dee50..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Name.md +++ /dev/null @@ -1,13 +0,0 @@ - -# Name - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **Integer** | | -**snakeCase** | **Integer** | | [optional] -**property** | **String** | | [optional] -**_123Number** | **Integer** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/NumberOnly.md b/samples/client/petstore/java/jersey2-java6/docs/NumberOnly.md deleted file mode 100644 index a3feac7fadc..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/NumberOnly.md +++ /dev/null @@ -1,10 +0,0 @@ - -# NumberOnly - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**justNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Order.md b/samples/client/petstore/java/jersey2-java6/docs/Order.md deleted file mode 100644 index 268c617d1ff..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Order.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Order - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**petId** | **Long** | | [optional] -**quantity** | **Integer** | | [optional] -**shipDate** | [**OffsetDateTime**](OffsetDateTime.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | Order Status | [optional] -**complete** | **Boolean** | | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -PLACED | "placed" -APPROVED | "approved" -DELIVERED | "delivered" - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md b/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md deleted file mode 100644 index 3f5a633c998..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/OuterComposite.md +++ /dev/null @@ -1,12 +0,0 @@ - -# OuterComposite - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**myNumber** | [**BigDecimal**](BigDecimal.md) | | [optional] -**myString** | **String** | | [optional] -**myBoolean** | **Boolean** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/OuterEnum.md b/samples/client/petstore/java/jersey2-java6/docs/OuterEnum.md deleted file mode 100644 index ed2cb206789..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/OuterEnum.md +++ /dev/null @@ -1,14 +0,0 @@ - -# OuterEnum - -## Enum - - -* `PLACED` (value: `"placed"`) - -* `APPROVED` (value: `"approved"`) - -* `DELIVERED` (value: `"delivered"`) - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Pet.md b/samples/client/petstore/java/jersey2-java6/docs/Pet.md deleted file mode 100644 index 5b63109ef92..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Pet.md +++ /dev/null @@ -1,24 +0,0 @@ - -# Pet - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**category** | [**Category**](Category.md) | | [optional] -**name** | **String** | | -**photoUrls** | **List<String>** | | -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | [**StatusEnum**](#StatusEnum) | pet status in the store | [optional] - - - -## Enum: StatusEnum -Name | Value ----- | ----- -AVAILABLE | "available" -PENDING | "pending" -SOLD | "sold" - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md b/samples/client/petstore/java/jersey2-java6/docs/PetApi.md deleted file mode 100644 index b5fa395947d..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/PetApi.md +++ /dev/null @@ -1,448 +0,0 @@ -# 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 - - - -# **addPet** -> addPet(body) - -Add a new pet to the store - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.addPet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#addPet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **deletePet** -> deletePet(petId, apiKey) - -Deletes a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | Pet id to delete -String apiKey = "apiKey_example"; // String | -try { - apiInstance.deletePet(petId, apiKey); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#deletePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| Pet id to delete | - **apiKey** | **String**| | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByStatus** -> List<Pet> findPetsByStatus(status) - -Finds Pets by status - -Multiple status values can be provided with comma separated strings - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List status = Arrays.asList("status_example"); // List | Status values that need to be considered for filter -try { - List result = apiInstance.findPetsByStatus(status); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByStatus"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **status** | [**List<String>**](String.md)| Status values that need to be considered for filter | [enum: available, pending, sold] - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **findPetsByTags** -> List<Pet> findPetsByTags(tags) - -Finds Pets by tags - -Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -List tags = Arrays.asList("tags_example"); // List | Tags to filter by -try { - List result = apiInstance.findPetsByTags(tags); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#findPetsByTags"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **tags** | [**List<String>**](String.md)| Tags to filter by | - -### Return type - -[**List<Pet>**](Pet.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getPetById** -> Pet getPetById(petId) - -Find pet by ID - -Returns a single pet - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to return -try { - Pet result = apiInstance.getPetById(petId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#getPetById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to return | - -### Return type - -[**Pet**](Pet.md) - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updatePet** -> updatePet(body) - -Update an existing pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Pet body = new Pet(); // Pet | Pet object that needs to be added to the store -try { - apiInstance.updatePet(body); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePet"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Pet**](Pet.md)| Pet object that needs to be added to the store | - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/json, application/xml - - **Accept**: application/xml, application/json - - -# **updatePetWithForm** -> updatePetWithForm(petId, name, status) - -Updates a pet in the store with form data - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet that needs to be updated -String name = "name_example"; // String | Updated name of the pet -String status = "status_example"; // String | Updated status of the pet -try { - apiInstance.updatePetWithForm(petId, name, status); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#updatePetWithForm"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet that needs to be updated | - **name** | **String**| Updated name of the pet | [optional] - **status** | **String**| Updated status of the pet | [optional] - -### Return type - -null (empty response body) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: application/x-www-form-urlencoded - - **Accept**: application/xml, application/json - - -# **uploadFile** -> ModelApiResponse uploadFile(petId, additionalMetadata, file) - -uploads an image - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.PetApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure OAuth2 access token for authorization: petstore_auth -OAuth petstore_auth = (OAuth) defaultClient.getAuthentication("petstore_auth"); -petstore_auth.setAccessToken("YOUR ACCESS TOKEN"); - -PetApi apiInstance = new PetApi(); -Long petId = 789L; // Long | ID of pet to update -String additionalMetadata = "additionalMetadata_example"; // String | Additional data to pass to server -File file = new File("/path/to/file.txt"); // File | file to upload -try { - ModelApiResponse result = apiInstance.uploadFile(petId, additionalMetadata, file); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling PetApi#uploadFile"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **petId** | **Long**| ID of pet to update | - **additionalMetadata** | **String**| Additional data to pass to server | [optional] - **file** | **File**| file to upload | [optional] - -### Return type - -[**ModelApiResponse**](ModelApiResponse.md) - -### Authorization - -[petstore_auth](../README.md#petstore_auth) - -### HTTP request headers - - - **Content-Type**: multipart/form-data - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2-java6/docs/ReadOnlyFirst.md b/samples/client/petstore/java/jersey2-java6/docs/ReadOnlyFirst.md deleted file mode 100644 index 426b7cde95a..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/ReadOnlyFirst.md +++ /dev/null @@ -1,11 +0,0 @@ - -# ReadOnlyFirst - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bar** | **String** | | [optional] -**baz** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md b/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md deleted file mode 100644 index c2c6117c552..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/SpecialModelName.md +++ /dev/null @@ -1,10 +0,0 @@ - -# SpecialModelName - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**specialPropertyName** | **Long** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md b/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md deleted file mode 100644 index 7aed6450e6a..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/StoreApi.md +++ /dev/null @@ -1,197 +0,0 @@ -# StoreApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**deleteOrder**](StoreApi.md#deleteOrder) | **DELETE** /store/order/{order_id} | Delete purchase order by ID -[**getInventory**](StoreApi.md#getInventory) | **GET** /store/inventory | Returns pet inventories by status -[**getOrderById**](StoreApi.md#getOrderById) | **GET** /store/order/{order_id} | Find purchase order by ID -[**placeOrder**](StoreApi.md#placeOrder) | **POST** /store/order | Place an order for a pet - - - -# **deleteOrder** -> deleteOrder(orderId) - -Delete purchase order by ID - -For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -String orderId = "orderId_example"; // String | ID of the order that needs to be deleted -try { - apiInstance.deleteOrder(orderId); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#deleteOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **String**| ID of the order that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getInventory** -> Map<String, Integer> getInventory() - -Returns pet inventories by status - -Returns a map of status codes to quantities - -### Example -```java -// Import classes: -//import io.swagger.client.ApiClient; -//import io.swagger.client.ApiException; -//import io.swagger.client.Configuration; -//import io.swagger.client.auth.*; -//import io.swagger.client.api.StoreApi; - -ApiClient defaultClient = Configuration.getDefaultApiClient(); - -// Configure API key authorization: api_key -ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key"); -api_key.setApiKey("YOUR API KEY"); -// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null) -//api_key.setApiKeyPrefix("Token"); - -StoreApi apiInstance = new StoreApi(); -try { - Map result = apiInstance.getInventory(); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getInventory"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -**Map<String, Integer>** - -### Authorization - -[api_key](../README.md#api_key) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -# **getOrderById** -> Order getOrderById(orderId) - -Find purchase order by ID - -For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Long orderId = 789L; // Long | ID of pet that needs to be fetched -try { - Order result = apiInstance.getOrderById(orderId); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#getOrderById"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **orderId** | **Long**| ID of pet that needs to be fetched | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **placeOrder** -> Order placeOrder(body) - -Place an order for a pet - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.StoreApi; - - -StoreApi apiInstance = new StoreApi(); -Order body = new Order(); // Order | order placed for purchasing the pet -try { - Order result = apiInstance.placeOrder(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling StoreApi#placeOrder"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Order**](Order.md)| order placed for purchasing the pet | - -### Return type - -[**Order**](Order.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/jersey2-java6/docs/Tag.md b/samples/client/petstore/java/jersey2-java6/docs/Tag.md deleted file mode 100644 index de6814b55d5..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/Tag.md +++ /dev/null @@ -1,11 +0,0 @@ - -# Tag - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**name** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/User.md b/samples/client/petstore/java/jersey2-java6/docs/User.md deleted file mode 100644 index 8b6753dd284..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/User.md +++ /dev/null @@ -1,17 +0,0 @@ - -# User - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **Long** | | [optional] -**username** | **String** | | [optional] -**firstName** | **String** | | [optional] -**lastName** | **String** | | [optional] -**email** | **String** | | [optional] -**password** | **String** | | [optional] -**phone** | **String** | | [optional] -**userStatus** | **Integer** | User Status | [optional] - - - diff --git a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md b/samples/client/petstore/java/jersey2-java6/docs/UserApi.md deleted file mode 100644 index 1c5218ac128..00000000000 --- a/samples/client/petstore/java/jersey2-java6/docs/UserApi.md +++ /dev/null @@ -1,370 +0,0 @@ -# UserApi - -All URIs are relative to *http://petstore.swagger.io:80/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**createUser**](UserApi.md#createUser) | **POST** /user | Create user -[**createUsersWithArrayInput**](UserApi.md#createUsersWithArrayInput) | **POST** /user/createWithArray | Creates list of users with given input array -[**createUsersWithListInput**](UserApi.md#createUsersWithListInput) | **POST** /user/createWithList | Creates list of users with given input array -[**deleteUser**](UserApi.md#deleteUser) | **DELETE** /user/{username} | Delete user -[**getUserByName**](UserApi.md#getUserByName) | **GET** /user/{username} | Get user by user name -[**loginUser**](UserApi.md#loginUser) | **GET** /user/login | Logs user into the system -[**logoutUser**](UserApi.md#logoutUser) | **GET** /user/logout | Logs out current logged in user session -[**updateUser**](UserApi.md#updateUser) | **PUT** /user/{username} | Updated user - - - -# **createUser** -> createUser(body) - -Create user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -User body = new User(); // User | Created user object -try { - apiInstance.createUser(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**User**](User.md)| Created user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithArrayInput** -> createUsersWithArrayInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithArrayInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithArrayInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **createUsersWithListInput** -> createUsersWithListInput(body) - -Creates list of users with given input array - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -List body = Arrays.asList(new User()); // List | List of user object -try { - apiInstance.createUsersWithListInput(body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#createUsersWithListInput"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**List<User>**](User.md)| List of user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **deleteUser** -> deleteUser(username) - -Delete user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be deleted -try { - apiInstance.deleteUser(username); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#deleteUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be deleted | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **getUserByName** -> User getUserByName(username) - -Get user by user name - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The name that needs to be fetched. Use user1 for testing. -try { - User result = apiInstance.getUserByName(username); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#getUserByName"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The name that needs to be fetched. Use user1 for testing. | - -### Return type - -[**User**](User.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **loginUser** -> String loginUser(username, password) - -Logs user into the system - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | The user name for login -String password = "password_example"; // String | The password for login in clear text -try { - String result = apiInstance.loginUser(username, password); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#loginUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| The user name for login | - **password** | **String**| The password for login in clear text | - -### Return type - -**String** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **logoutUser** -> logoutUser() - -Logs out current logged in user session - - - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -try { - apiInstance.logoutUser(); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#logoutUser"); - e.printStackTrace(); -} -``` - -### Parameters -This endpoint does not need any parameter. - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - - -# **updateUser** -> updateUser(username, body) - -Updated user - -This can only be done by the logged in user. - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.UserApi; - - -UserApi apiInstance = new UserApi(); -String username = "username_example"; // String | name that need to be deleted -User body = new User(); // User | Updated user object -try { - apiInstance.updateUser(username, body); -} catch (ApiException e) { - System.err.println("Exception when calling UserApi#updateUser"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **username** | **String**| name that need to be deleted | - **body** | [**User**](User.md)| Updated user object | - -### Return type - -null (empty response body) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/xml, application/json - diff --git a/samples/client/petstore/java/jersey2-java6/git_push.sh b/samples/client/petstore/java/jersey2-java6/git_push.sh deleted file mode 100644 index ae01b182ae9..00000000000 --- a/samples/client/petstore/java/jersey2-java6/git_push.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/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 swagger-petstore-perl "minor update" - -git_user_id=$1 -git_repo_id=$2 -release_note=$3 - -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://github.com/${git_user_id}/${git_repo_id}.git - else - git remote add origin https://${git_user_id}:${GIT_TOKEN}@github.com/${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://github.com/${git_user_id}/${git_repo_id}.git" -git push origin master 2>&1 | grep -v 'To https' - diff --git a/samples/client/petstore/java/jersey2-java6/gradle.properties b/samples/client/petstore/java/jersey2-java6/gradle.properties deleted file mode 100644 index 05644f0754a..00000000000 --- a/samples/client/petstore/java/jersey2-java6/gradle.properties +++ /dev/null @@ -1,2 +0,0 @@ -# Uncomment to build for Android -#target = android \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar b/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar deleted file mode 100644 index 2c6137b8789..00000000000 Binary files a/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.jar and /dev/null differ diff --git a/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.properties b/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.properties deleted file mode 100644 index b7a36473955..00000000000 --- a/samples/client/petstore/java/jersey2-java6/gradle/wrapper/gradle-wrapper.properties +++ /dev/null @@ -1,6 +0,0 @@ -#Tue May 17 23:08:05 CST 2016 -distributionBase=GRADLE_USER_HOME -distributionPath=wrapper/dists -zipStoreBase=GRADLE_USER_HOME -zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.6-bin.zip diff --git a/samples/client/petstore/java/jersey2-java6/gradlew b/samples/client/petstore/java/jersey2-java6/gradlew deleted file mode 100644 index 9d82f789151..00000000000 --- a/samples/client/petstore/java/jersey2-java6/gradlew +++ /dev/null @@ -1,160 +0,0 @@ -#!/usr/bin/env bash - -############################################################################## -## -## Gradle start up script for UN*X -## -############################################################################## - -# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. -DEFAULT_JVM_OPTS="" - -APP_NAME="Gradle" -APP_BASE_NAME=`basename "$0"` - -# Use the maximum available, or set MAX_FD != -1 to use that value. -MAX_FD="maximum" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# OS specific support (must be 'true' or 'false'). -cygwin=false -msys=false -darwin=false -case "`uname`" in - CYGWIN* ) - cygwin=true - ;; - Darwin* ) - darwin=true - ;; - MINGW* ) - msys=true - ;; -esac - -# Attempt to set APP_HOME -# Resolve links: $0 may be a link -PRG="$0" -# Need this for relative symlinks. -while [ -h "$PRG" ] ; do - ls=`ls -ld "$PRG"` - link=`expr "$ls" : '.*-> \(.*\)$'` - if expr "$link" : '/.*' > /dev/null; then - PRG="$link" - else - PRG=`dirname "$PRG"`"/$link" - fi -done -SAVED="`pwd`" -cd "`dirname \"$PRG\"`/" >/dev/null -APP_HOME="`pwd -P`" -cd "$SAVED" >/dev/null - -CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar - -# Determine the Java command to use to start the JVM. -if [ -n "$JAVA_HOME" ] ; then - if [ -x "$JAVA_HOME/jre/sh/java" ] ; then - # IBM's JDK on AIX uses strange locations for the executables - JAVACMD="$JAVA_HOME/jre/sh/java" - else - JAVACMD="$JAVA_HOME/bin/java" - fi - if [ ! -x "$JAVACMD" ] ; then - die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." - fi -else - JAVACMD="java" - which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. - -Please set the JAVA_HOME variable in your environment to match the -location of your Java installation." -fi - -# Increase the maximum file descriptors if we can. -if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then - MAX_FD_LIMIT=`ulimit -H -n` - if [ $? -eq 0 ] ; then - if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then - MAX_FD="$MAX_FD_LIMIT" - fi - ulimit -n $MAX_FD - if [ $? -ne 0 ] ; then - warn "Could not set maximum file descriptor limit: $MAX_FD" - fi - else - warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" - fi -fi - -# For Darwin, add options to specify how the application appears in the dock -if $darwin; then - GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" -fi - -# For Cygwin, switch paths to Windows format before running java -if $cygwin ; then - APP_HOME=`cygpath --path --mixed "$APP_HOME"` - CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - JAVACMD=`cygpath --unix "$JAVACMD"` - - # We build the pattern for arguments to be converted via cygpath - ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` - SEP="" - for dir in $ROOTDIRSRAW ; do - ROOTDIRS="$ROOTDIRS$SEP$dir" - SEP="|" - done - OURCYGPATTERN="(^($ROOTDIRS))" - # Add a user-defined pattern to the cygpath arguments - if [ "$GRADLE_CYGPATTERN" != "" ] ; then - OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" - fi - # Now convert the arguments - kludge to limit ourselves to /bin/sh - i=0 - for arg in "$@" ; do - CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` - CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option - - if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition - eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` - else - eval `echo args$i`="\"$arg\"" - fi - i=$((i+1)) - done - case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; - esac -fi - -# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules -function splitJvmOpts() { - JVM_OPTS=("$@") -} -eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS -JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" - -exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" diff --git a/samples/client/petstore/java/jersey2-java6/gradlew.bat b/samples/client/petstore/java/jersey2-java6/gradlew.bat deleted file mode 100644 index 5f192121eb4..00000000000 --- a/samples/client/petstore/java/jersey2-java6/gradlew.bat +++ /dev/null @@ -1,90 +0,0 @@ -@if "%DEBUG%" == "" @echo off -@rem ########################################################################## -@rem -@rem Gradle startup script for Windows -@rem -@rem ########################################################################## - -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal - -@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= - -set DIRNAME=%~dp0 -if "%DIRNAME%" == "" set DIRNAME=. -set APP_BASE_NAME=%~n0 -set APP_HOME=%DIRNAME% - -@rem Find java.exe -if defined JAVA_HOME goto findJavaFromJavaHome - -set JAVA_EXE=java.exe -%JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init - -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. - -goto fail - -:findJavaFromJavaHome -set JAVA_HOME=%JAVA_HOME:"=% -set JAVA_EXE=%JAVA_HOME%/bin/java.exe - -if exist "%JAVA_EXE%" goto init - -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 - -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args -if "%@eval[2+2]" == "4" goto 4NT_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* -goto execute - -:4NT_args -@rem Get arguments from the 4NT Shell from JP Software -set CMD_LINE_ARGS=%$ - -:execute -@rem Setup the command line - -set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar - -@rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% - -:end -@rem End local scope for the variables with windows NT shell -if "%ERRORLEVEL%"=="0" goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 -exit /b 1 - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega diff --git a/samples/client/petstore/java/jersey2-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml deleted file mode 100644 index b349f521749..00000000000 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ /dev/null @@ -1,279 +0,0 @@ - - 4.0.0 - io.swagger - swagger-petstore-jersey2-java6 - jar - swagger-petstore-jersey2-java6 - 1.0.0 - https://github.com/swagger-api/swagger-codegen - Swagger Java - - scm:git:git@github.com:swagger-api/swagger-codegen.git - scm:git:git@github.com:swagger-api/swagger-codegen.git - https://github.com/swagger-api/swagger-codegen - - - - - Unlicense - http://www.apache.org/licenses/LICENSE-2.0.html - repo - - - - - - Swagger - apiteam@swagger.io - Swagger - http://swagger.io - - - - - - - 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.6 - - - - 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.7 - 1.7 - - - - org.apache.maven.plugins - maven-javadoc-plugin - 2.10.4 - - - 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 - - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger-core-version} - - - - - org.glassfish.jersey.core - jersey-client - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-multipart - ${jersey-version} - - - org.glassfish.jersey.media - jersey-media-json-jackson - ${jersey-version} - - - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${jackson-version} - - - - com.brsanthu - migbase64 - 2.2 - - - org.apache.commons - commons-lang3 - ${commons_lang3_version} - - - commons-io - commons-io - ${commons_io_version} - - - - junit - junit - ${junit-version} - test - - - - UTF-8 - 1.5.18 - 2.6 - 2.5 - 3.6 - 2.6.4 - 1.0.0 - 4.12 - - diff --git a/samples/client/petstore/java/jersey2-java6/settings.gradle b/samples/client/petstore/java/jersey2-java6/settings.gradle deleted file mode 100644 index 4449df58659..00000000000 --- a/samples/client/petstore/java/jersey2-java6/settings.gradle +++ /dev/null @@ -1 +0,0 @@ -rootProject.name = "swagger-petstore-jersey2-java6" \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/src/main/AndroidManifest.xml b/samples/client/petstore/java/jersey2-java6/src/main/AndroidManifest.xml deleted file mode 100644 index 465dcb520c4..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/AndroidManifest.xml +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java deleted file mode 100644 index 36feb989ae7..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiClient.java +++ /dev/null @@ -1,780 +0,0 @@ -package io.swagger.client; - -import javax.ws.rs.client.Client; -import javax.ws.rs.client.ClientBuilder; -import javax.ws.rs.client.Entity; -import javax.ws.rs.client.Invocation; -import javax.ws.rs.client.WebTarget; -import javax.ws.rs.core.Form; -import javax.ws.rs.core.GenericType; -import javax.ws.rs.core.MediaType; -import javax.ws.rs.core.Response; -import javax.ws.rs.core.Response.Status; - -import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.client.HttpUrlConnectorProvider; -import org.glassfish.jersey.jackson.JacksonFeature; -import org.glassfish.jersey.media.multipart.FormDataBodyPart; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.MultiPart; -import org.glassfish.jersey.media.multipart.MultiPartFeature; - -import java.io.IOException; -import java.io.InputStream; - -import org.apache.commons.io.FileUtils; -import org.glassfish.jersey.filter.LoggingFilter; -import java.util.Collection; -import java.util.Collections; -import java.util.Map; -import java.util.Map.Entry; -import java.util.HashMap; -import java.util.List; -import java.util.ArrayList; -import java.util.Date; -import java.util.TimeZone; - -import java.net.URLEncoder; - -import java.io.File; -import java.io.UnsupportedEncodingException; - -import java.text.DateFormat; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import io.swagger.client.auth.Authentication; -import io.swagger.client.auth.HttpBasicAuth; -import io.swagger.client.auth.ApiKeyAuth; -import io.swagger.client.auth.OAuth; - - -public class ApiClient { - protected Map defaultHeaderMap = new HashMap(); - protected String basePath = "http://petstore.swagger.io:80/v2"; - protected boolean debugging = false; - protected int connectionTimeout = 0; - private int readTimeout = 0; - - protected Client httpClient; - protected JSON json; - protected String tempFolderPath = null; - - protected Map authentications; - - protected DateFormat dateFormat; - - public ApiClient() { - json = new JSON(); - httpClient = buildHttpClient(debugging); - - this.dateFormat = new RFC3339DateFormat(); - - // Set default User-Agent. - setUserAgent("Swagger-Codegen/1.0.0/java"); - - // Setup authentications (key: authentication name, value: authentication). - authentications = new HashMap(); - authentications.put("api_key", new ApiKeyAuth("header", "api_key")); - authentications.put("api_key_query", new ApiKeyAuth("query", "api_key_query")); - authentications.put("http_basic_test", new HttpBasicAuth()); - authentications.put("petstore_auth", new OAuth()); - // Prevent the authentications from being modified. - authentications = Collections.unmodifiableMap(authentications); - } - - /** - * Gets the JSON instance to do JSON serialization and deserialization. - * @return JSON - */ - public JSON getJSON() { - return json; - } - - public Client getHttpClient() { - return httpClient; - } - - public ApiClient setHttpClient(Client httpClient) { - this.httpClient = httpClient; - return this; - } - - public String getBasePath() { - return basePath; - } - - public ApiClient setBasePath(String basePath) { - this.basePath = basePath; - return this; - } - - /** - * Get authentications (key: authentication name, value: authentication). - * @return Map of authentication object - */ - public Map getAuthentications() { - return authentications; - } - - /** - * Get authentication for the given name. - * - * @param authName The authentication name - * @return The authentication, null if not found - */ - public Authentication getAuthentication(String authName) { - return authentications.get(authName); - } - - /** - * Helper method to set username for the first HTTP basic authentication. - * @param username Username - */ - public void setUsername(String username) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setUsername(username); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set password for the first HTTP basic authentication. - * @param password Password - */ - public void setPassword(String password) { - for (Authentication auth : authentications.values()) { - if (auth instanceof HttpBasicAuth) { - ((HttpBasicAuth) auth).setPassword(password); - return; - } - } - throw new RuntimeException("No HTTP basic authentication configured!"); - } - - /** - * Helper method to set API key value for the first API key authentication. - * @param apiKey API key - */ - public void setApiKey(String apiKey) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKey(apiKey); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set API key prefix for the first API key authentication. - * @param apiKeyPrefix API key prefix - */ - public void setApiKeyPrefix(String apiKeyPrefix) { - for (Authentication auth : authentications.values()) { - if (auth instanceof ApiKeyAuth) { - ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); - return; - } - } - throw new RuntimeException("No API key authentication configured!"); - } - - /** - * Helper method to set access token for the first OAuth2 authentication. - * @param accessToken Access token - */ - public void setAccessToken(String accessToken) { - for (Authentication auth : authentications.values()) { - if (auth instanceof OAuth) { - ((OAuth) auth).setAccessToken(accessToken); - return; - } - } - throw new RuntimeException("No OAuth2 authentication configured!"); - } - - /** - * Set the User-Agent header's value (by adding to the default header map). - * @param userAgent Http user agent - * @return API client - */ - public ApiClient setUserAgent(String userAgent) { - addDefaultHeader("User-Agent", userAgent); - return this; - } - - /** - * Add a default header. - * - * @param key The header's key - * @param value The header's value - * @return API client - */ - public ApiClient addDefaultHeader(String key, String value) { - defaultHeaderMap.put(key, value); - return this; - } - - /** - * Check that whether debugging is enabled for this API client. - * @return True if debugging is switched on - */ - public boolean isDebugging() { - return debugging; - } - - /** - * Enable/disable debugging for this API client. - * - * @param debugging To enable (true) or disable (false) debugging - * @return API client - */ - public ApiClient setDebugging(boolean debugging) { - this.debugging = debugging; - // Rebuild HTTP Client according to the new "debugging" value. - this.httpClient = buildHttpClient(debugging); - return this; - } - - /** - * The path of temporary folder used to store downloaded files from endpoints - * with file response. The default value is null, i.e. using - * the system's default tempopary folder. - * - * @return Temp folder path - */ - public String getTempFolderPath() { - return tempFolderPath; - } - - /** - * Set temp folder path - * @param tempFolderPath Temp folder path - * @return API client - */ - public ApiClient setTempFolderPath(String tempFolderPath) { - this.tempFolderPath = tempFolderPath; - return this; - } - - /** - * Connect timeout (in milliseconds). - * @return Connection timeout - */ - public int getConnectTimeout() { - return connectionTimeout; - } - - /** - * Set the connect timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * @param connectionTimeout Connection timeout in milliseconds - * @return API client - */ - public ApiClient setConnectTimeout(int connectionTimeout) { - this.connectionTimeout = connectionTimeout; - httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); - return this; - } - - /** - * read timeout (in milliseconds). - * @return Read timeout - */ - public int getReadTimeout() { - return readTimeout; - } - - /** - * Set the read timeout (in milliseconds). - * A value of 0 means no timeout, otherwise values must be between 1 and - * {@link Integer#MAX_VALUE}. - * @param readTimeout Read timeout in milliseconds - * @return API client - */ - public ApiClient setReadTimeout(int readTimeout) { - this.readTimeout = readTimeout; - httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); - return this; - } - - /** - * Get the date format used to parse/format date parameters. - * @return Date format - */ - public DateFormat getDateFormat() { - return dateFormat; - } - - /** - * Set the date format used to parse/format date parameters. - * @param dateFormat Date format - * @return API client - */ - public ApiClient setDateFormat(DateFormat dateFormat) { - this.dateFormat = dateFormat; - // also set the date format for model (de)serialization with Date properties - this.json.setDateFormat((DateFormat) dateFormat.clone()); - return this; - } - - /** - * Parse the given string into Date object. - * @param str String - * @return Date - */ - public Date parseDate(String str) { - try { - return dateFormat.parse(str); - } catch (java.text.ParseException e) { - throw new RuntimeException(e); - } - } - - /** - * Format the given Date object into string. - * @param date Date - * @return Date in string format - */ - public String formatDate(Date date) { - return dateFormat.format(date); - } - - /** - * Format the given parameter object into string. - * @param param Object - * @return Object in string format - */ - public String parameterToString(Object param) { - if (param == null) { - return ""; - } else if (param instanceof Date) { - return formatDate((Date) param); - } else if (param instanceof Collection) { - StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { - b.append(','); - } - b.append(String.valueOf(o)); - } - return b.toString(); - } else { - return String.valueOf(param); - } - } - - /* - * Format to {@code Pair} objects. - * @param collectionFormat Collection format - * @param name Name - * @param value Value - * @return List of pairs - */ - public List parameterToPairs(String collectionFormat, String name, Object value){ - List params = new ArrayList(); - - // preconditions - if (name == null || name.isEmpty() || value == null) return params; - - Collection valueCollection; - if (value instanceof Collection) { - valueCollection = (Collection) value; - } else { - params.add(new Pair(name, parameterToString(value))); - return params; - } - - if (valueCollection.isEmpty()){ - return params; - } - - // get the collection format (default: csv) - String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); - - // create the params based on the collection format - if ("multi".equals(format)) { - for (Object item : valueCollection) { - params.add(new Pair(name, parameterToString(item))); - } - - return params; - } - - String delimiter = ","; - - if ("csv".equals(format)) { - delimiter = ","; - } else if ("ssv".equals(format)) { - delimiter = " "; - } else if ("tsv".equals(format)) { - delimiter = "\t"; - } else if ("pipes".equals(format)) { - delimiter = "|"; - } - - StringBuilder sb = new StringBuilder() ; - for (Object item : valueCollection) { - sb.append(delimiter); - sb.append(parameterToString(item)); - } - - params.add(new Pair(name, sb.substring(1))); - - return params; - } - - /** - * Check if the given MIME is a JSON MIME. - * JSON MIME examples: - * application/json - * application/json; charset=UTF8 - * APPLICATION/JSON - * application/vnd.company+json - * "* / *" is also default to JSON - * @param mime MIME - * @return True if the MIME type is JSON - */ - public boolean isJsonMime(String mime) { - String jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"; - return mime != null && (mime.matches(jsonMime) || mime.equals("*/*")); - } - - /** - * Select the Accept header's value from the given accepts array: - * if JSON exists in the given array, use it; - * otherwise use all of them (joining into a string) - * - * @param accepts The accepts array to select from - * @return The Accept header to use. If the given array is empty, - * null will be returned (not to set the Accept header explicitly). - */ - public String selectHeaderAccept(String[] accepts) { - if (accepts.length == 0) { - return null; - } - for (String accept : accepts) { - if (isJsonMime(accept)) { - return accept; - } - } - return StringUtil.join(accepts, ","); - } - - /** - * Select the Content-Type header's value from the given array: - * if JSON exists in the given array, use it; - * otherwise use the first one of the array. - * - * @param contentTypes The Content-Type array to select from - * @return The Content-Type header to use. If the given array is empty, - * JSON will be used. - */ - public String selectHeaderContentType(String[] contentTypes) { - if (contentTypes.length == 0) { - return "application/json"; - } - for (String contentType : contentTypes) { - if (isJsonMime(contentType)) { - return contentType; - } - } - return contentTypes[0]; - } - - /** - * Escape the given string to be used as URL query value. - * @param str String - * @return Escaped string - */ - public String escapeString(String str) { - try { - return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); - } catch (UnsupportedEncodingException e) { - return str; - } - } - - /** - * Serialize the given Java object into string entity according the given - * Content-Type (only JSON is supported for now). - * @param obj Object - * @param formParams Form parameters - * @param contentType Context type - * @return Entity - * @throws ApiException API exception - */ - public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { - Entity entity; - if (contentType.startsWith("multipart/form-data")) { - MultiPart multiPart = new MultiPart(); - for (Entry param: formParams.entrySet()) { - if (param.getValue() instanceof File) { - File file = (File) param.getValue(); - FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()) - .fileName(file.getName()).size(file.length()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, MediaType.APPLICATION_OCTET_STREAM_TYPE)); - } else { - FormDataContentDisposition contentDisp = FormDataContentDisposition.name(param.getKey()).build(); - multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(param.getValue()))); - } - } - entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); - } else if (contentType.startsWith("application/x-www-form-urlencoded")) { - Form form = new Form(); - for (Entry param: formParams.entrySet()) { - form.param(param.getKey(), parameterToString(param.getValue())); - } - entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); - } else { - // We let jersey handle the serialization - entity = Entity.entity(obj, contentType); - } - return entity; - } - - /** - * Deserialize response body to Java object according to the Content-Type. - * @param Type - * @param response Response - * @param returnType Return type - * @return Deserialize object - * @throws ApiException API exception - */ - @SuppressWarnings("unchecked") - public T deserialize(Response response, GenericType returnType) throws ApiException { - if (response == null || returnType == null) { - return null; - } - - if ("byte[]".equals(returnType.toString())) { - // Handle binary response (byte array). - return (T) response.readEntity(byte[].class); - } else if (returnType.getRawType() == File.class) { - // Handle file downloading. - T file = (T) downloadFileFromResponse(response); - return file; - } - - String contentType = null; - List contentTypes = response.getHeaders().get("Content-Type"); - if (contentTypes != null && !contentTypes.isEmpty()) - contentType = String.valueOf(contentTypes.get(0)); - - return response.readEntity(returnType); - } - - /** - * Download file from the given response. - * @param response Response - * @return File - * @throws ApiException If fail to read file content from response and write to disk - */ - public File downloadFileFromResponse(Response response) throws ApiException { - try { - File file = prepareDownloadFile(response); - // Java6 falls back to commons.io for file copying - FileUtils.copyToFile(response.readEntity(InputStream.class), file); - return file; - } catch (IOException e) { - throw new ApiException(e); - } - } - - public File prepareDownloadFile(Response response) throws IOException { - String filename = null; - String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); - if (contentDisposition != null && !"".equals(contentDisposition)) { - // Get filename from the Content-Disposition header. - Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); - Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) - filename = matcher.group(1); - } - - String prefix; - String suffix = null; - if (filename == null) { - prefix = "download-"; - suffix = ""; - } else { - int pos = filename.lastIndexOf('.'); - if (pos == -1) { - prefix = filename + "-"; - } else { - prefix = filename.substring(0, pos) + "-"; - suffix = filename.substring(pos); - } - // File.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; - } - - if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); - else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); - } - - /** - * Invoke API by sending HTTP request with the given options. - * - * @param Type - * @param path The sub-path of the HTTP URL - * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" - * @param queryParams The query parameters - * @param body The request body object - * @param headerParams The header parameters - * @param formParams The form parameters - * @param accept The request's Accept header - * @param contentType The request's Content-Type header - * @param authNames The authentications to apply - * @param returnType The return type into which to deserialize the response - * @return The response body in type of string - * @throws ApiException API exception - */ - public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType) throws ApiException { - updateParamsForAuth(authNames, queryParams, headerParams); - - // Not using `.target(this.basePath).path(path)` below, - // to support (constant) query string in `path`, e.g. "/posts?draft=1" - WebTarget target = httpClient.target(this.basePath + path); - - if (queryParams != null) { - for (Pair queryParam : queryParams) { - if (queryParam.getValue() != null) { - target = target.queryParam(queryParam.getName(), queryParam.getValue()); - } - } - } - - Invocation.Builder invocationBuilder = target.request().accept(accept); - - for (Entry entry : headerParams.entrySet()) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(entry.getKey(), value); - } - } - - for (Entry entry : defaultHeaderMap.entrySet()) { - String key = entry.getKey(); - if (!headerParams.containsKey(key)) { - String value = entry.getValue(); - if (value != null) { - invocationBuilder = invocationBuilder.header(key, value); - } - } - } - - Entity entity = serialize(body, formParams, contentType); - - Response response = null; - - try { - if ("GET".equals(method)) { - response = invocationBuilder.get(); - } else if ("POST".equals(method)) { - response = invocationBuilder.post(entity); - } else if ("PUT".equals(method)) { - response = invocationBuilder.put(entity); - } else if ("DELETE".equals(method)) { - response = invocationBuilder.delete(); - } else if ("PATCH".equals(method)) { - response = invocationBuilder.method("PATCH", entity); - } else if ("HEAD".equals(method)) { - response = invocationBuilder.head(); - } else { - throw new ApiException(500, "unknown method type " + method); - } - - int statusCode = response.getStatusInfo().getStatusCode(); - Map> responseHeaders = buildResponseHeaders(response); - - if (response.getStatus() == Status.NO_CONTENT.getStatusCode()) { - return new ApiResponse<>(statusCode, responseHeaders); - } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { - if (returnType == null) - return new ApiResponse<>(statusCode, responseHeaders); - else - return new ApiResponse<>(statusCode, responseHeaders, deserialize(response, returnType)); - } else { - String message = "error"; - String respBody = null; - if (response.hasEntity()) { - try { - respBody = String.valueOf(response.readEntity(String.class)); - message = respBody; - } catch (RuntimeException e) { - // e.printStackTrace(); - } - } - throw new ApiException( - response.getStatus(), - message, - buildResponseHeaders(response), - respBody); - } - } finally { - try { - response.close(); - } catch (Exception e) { - // it's not critical, since the response object is local in method invokeAPI; that's fine, just continue - } - } - } - - /** - * Build the Client used to make HTTP requests. - * @param debugging Debug setting - * @return Client - */ - protected Client buildHttpClient(boolean debugging) { - final ClientConfig clientConfig = new ClientConfig(); - clientConfig.register(MultiPartFeature.class); - clientConfig.register(json); - clientConfig.register(JacksonFeature.class); - clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); - if (debugging) { - clientConfig.register(new LoggingFilter(java.util.logging.Logger.getLogger(LoggingFilter.class.getName()), true)); - } - performAdditionalClientConfiguration(clientConfig); - return ClientBuilder.newClient(clientConfig); - } - - protected void performAdditionalClientConfiguration(ClientConfig clientConfig) { - // No-op extension point - } - - protected Map> buildResponseHeaders(Response response) { - Map> responseHeaders = new HashMap>(); - for (Entry> entry: response.getHeaders().entrySet()) { - List values = entry.getValue(); - List headers = new ArrayList(); - for (Object o : values) { - headers.add(String.valueOf(o)); - } - responseHeaders.put(entry.getKey(), headers); - } - return responseHeaders; - } - - /** - * Update query and header parameters based on authentication settings. - * - * @param authNames The authentications to apply - */ - protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams) { - for (String authName : authNames) { - Authentication auth = authentications.get(authName); - if (auth == null) throw new RuntimeException("Authentication undefined: " + authName); - auth.applyToParams(queryParams, headerParams); - } - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiException.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiException.java deleted file mode 100644 index d0b5cfc1e57..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiException.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client; - -import java.util.Map; -import java.util.List; - - -public class ApiException extends Exception { - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - - public ApiException() {} - - public ApiException(Throwable throwable) { - super(throwable); - } - - public ApiException(String message) { - super(message); - } - - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiResponse.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiResponse.java deleted file mode 100644 index 389c0b199b7..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/ApiResponse.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client; - -import java.util.List; -import java.util.Map; - -/** - * API response returned by API call. - * - * @param The type of data that is deserialized from response body - */ -public class ApiResponse { - private final int statusCode; - private final Map> headers; - private final T data; - - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } - - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } - - public int getStatusCode() { - return statusCode; - } - - public Map> getHeaders() { - return headers; - } - - public T getData() { - return data; - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Configuration.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Configuration.java deleted file mode 100644 index cbf868efb85..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Configuration.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client; - - -public class Configuration { - private static ApiClient defaultApiClient = new ApiClient(); - - /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() { - return defaultApiClient; - } - - /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. - * - * @param apiClient API client - */ - public static void setDefaultApiClient(ApiClient apiClient) { - defaultApiClient = apiClient; - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/CustomInstantDeserializer.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/CustomInstantDeserializer.java deleted file mode 100644 index 5ed8ba446ec..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/CustomInstantDeserializer.java +++ /dev/null @@ -1,232 +0,0 @@ -package io.swagger.client; - -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonTokenId; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.databind.DeserializationFeature; -import com.fasterxml.jackson.databind.JsonDeserializer; -import com.fasterxml.jackson.datatype.threetenbp.DateTimeUtils; -import com.fasterxml.jackson.datatype.threetenbp.DecimalUtils; -import com.fasterxml.jackson.datatype.threetenbp.deser.ThreeTenDateTimeDeserializerBase; -import com.fasterxml.jackson.datatype.threetenbp.function.BiFunction; -import com.fasterxml.jackson.datatype.threetenbp.function.Function; -import org.threeten.bp.DateTimeException; -import org.threeten.bp.Instant; -import org.threeten.bp.OffsetDateTime; -import org.threeten.bp.ZoneId; -import org.threeten.bp.ZonedDateTime; -import org.threeten.bp.format.DateTimeFormatter; -import org.threeten.bp.temporal.Temporal; -import org.threeten.bp.temporal.TemporalAccessor; - -import java.io.IOException; -import java.math.BigDecimal; - -/** - * Deserializer for ThreeTen temporal {@link Instant}s, {@link OffsetDateTime}, and {@link ZonedDateTime}s. - * Adapted from the jackson threetenbp InstantDeserializer to add support for deserializing rfc822 format. - * - * @author Nick Williams - */ -public class CustomInstantDeserializer - extends ThreeTenDateTimeDeserializerBase { - private static final long serialVersionUID = 1L; - - public static final CustomInstantDeserializer INSTANT = new CustomInstantDeserializer( - Instant.class, DateTimeFormatter.ISO_INSTANT, - new Function() { - @Override - public Instant apply(TemporalAccessor temporalAccessor) { - return Instant.from(temporalAccessor); - } - }, - new Function() { - @Override - public Instant apply(FromIntegerArguments a) { - return Instant.ofEpochMilli(a.value); - } - }, - new Function() { - @Override - public Instant apply(FromDecimalArguments a) { - return Instant.ofEpochSecond(a.integer, a.fraction); - } - }, - null - ); - - public static final CustomInstantDeserializer OFFSET_DATE_TIME = new CustomInstantDeserializer( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - new Function() { - @Override - public OffsetDateTime apply(TemporalAccessor temporalAccessor) { - return OffsetDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromIntegerArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public OffsetDateTime apply(FromDecimalArguments a) { - return OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public OffsetDateTime apply(OffsetDateTime d, ZoneId z) { - return d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime())); - } - } - ); - - public static final CustomInstantDeserializer ZONED_DATE_TIME = new CustomInstantDeserializer( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - new Function() { - @Override - public ZonedDateTime apply(TemporalAccessor temporalAccessor) { - return ZonedDateTime.from(temporalAccessor); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromIntegerArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId); - } - }, - new Function() { - @Override - public ZonedDateTime apply(FromDecimalArguments a) { - return ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId); - } - }, - new BiFunction() { - @Override - public ZonedDateTime apply(ZonedDateTime zonedDateTime, ZoneId zoneId) { - return zonedDateTime.withZoneSameInstant(zoneId); - } - } - ); - - protected final Function fromMilliseconds; - - protected final Function fromNanoseconds; - - protected final Function parsedToValue; - - protected final BiFunction adjust; - - protected CustomInstantDeserializer(Class supportedType, - DateTimeFormatter parser, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust) { - super(supportedType, parser); - this.parsedToValue = parsedToValue; - this.fromMilliseconds = fromMilliseconds; - this.fromNanoseconds = fromNanoseconds; - this.adjust = adjust == null ? new BiFunction() { - @Override - public T apply(T t, ZoneId zoneId) { - return t; - } - } : adjust; - } - - @SuppressWarnings("unchecked") - protected CustomInstantDeserializer(CustomInstantDeserializer base, DateTimeFormatter f) { - super((Class) base.handledType(), f); - parsedToValue = base.parsedToValue; - fromMilliseconds = base.fromMilliseconds; - fromNanoseconds = base.fromNanoseconds; - adjust = base.adjust; - } - - @Override - protected JsonDeserializer withDateFormat(DateTimeFormatter dtf) { - if (dtf == _formatter) { - return this; - } - return new CustomInstantDeserializer(this, dtf); - } - - @Override - public T deserialize(JsonParser parser, DeserializationContext context) throws IOException { - //NOTE: Timestamps contain no timezone info, and are always in configured TZ. Only - //string values have to be adjusted to the configured TZ. - switch (parser.getCurrentTokenId()) { - case JsonTokenId.ID_NUMBER_FLOAT: { - BigDecimal value = parser.getDecimalValue(); - long seconds = value.longValue(); - int nanoseconds = DecimalUtils.extractNanosecondDecimal(value, seconds); - return fromNanoseconds.apply(new FromDecimalArguments( - seconds, nanoseconds, getZone(context))); - } - - case JsonTokenId.ID_NUMBER_INT: { - long timestamp = parser.getLongValue(); - if (context.isEnabled(DeserializationFeature.READ_DATE_TIMESTAMPS_AS_NANOSECONDS)) { - return this.fromNanoseconds.apply(new FromDecimalArguments( - timestamp, 0, this.getZone(context) - )); - } - return this.fromMilliseconds.apply(new FromIntegerArguments( - timestamp, this.getZone(context) - )); - } - - case JsonTokenId.ID_STRING: { - String string = parser.getText().trim(); - if (string.length() == 0) { - return null; - } - if (string.endsWith("+0000")) { - string = string.substring(0, string.length() - 5) + "Z"; - } - T value; - try { - TemporalAccessor acc = _formatter.parse(string); - value = parsedToValue.apply(acc); - if (context.isEnabled(DeserializationFeature.ADJUST_DATES_TO_CONTEXT_TIME_ZONE)) { - return adjust.apply(value, this.getZone(context)); - } - } catch (DateTimeException e) { - throw _peelDTE(e); - } - return value; - } - } - throw context.mappingException("Expected type float, integer, or string."); - } - - private ZoneId getZone(DeserializationContext context) { - // Instants are always in UTC, so don't waste compute cycles - return (_valueClass == Instant.class) ? null : DateTimeUtils.timeZoneToZoneId(context.getTimeZone()); - } - - private static class FromIntegerArguments { - public final long value; - public final ZoneId zoneId; - - private FromIntegerArguments(long value, ZoneId zoneId) { - this.value = value; - this.zoneId = zoneId; - } - } - - private static class FromDecimalArguments { - public final long integer; - public final int fraction; - public final ZoneId zoneId; - - private FromDecimalArguments(long integer, int fraction, ZoneId zoneId) { - this.integer = integer; - this.fraction = fraction; - this.zoneId = zoneId; - } - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java deleted file mode 100644 index 433f1a313e1..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/JSON.java +++ /dev/null @@ -1,44 +0,0 @@ -package io.swagger.client; - -import org.threeten.bp.*; -import com.fasterxml.jackson.annotation.*; -import com.fasterxml.jackson.databind.*; -import com.fasterxml.jackson.datatype.threetenbp.ThreeTenModule; - -import java.text.DateFormat; - -import javax.ws.rs.ext.ContextResolver; - - -public class JSON implements ContextResolver { - private ObjectMapper mapper; - - public JSON() { - mapper = new ObjectMapper(); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, false); - mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS); - mapper.enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING); - mapper.enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING); - mapper.setDateFormat(new RFC3339DateFormat()); - ThreeTenModule module = new ThreeTenModule(); - module.addDeserializer(Instant.class, CustomInstantDeserializer.INSTANT); - module.addDeserializer(OffsetDateTime.class, CustomInstantDeserializer.OFFSET_DATE_TIME); - module.addDeserializer(ZonedDateTime.class, CustomInstantDeserializer.ZONED_DATE_TIME); - mapper.registerModule(module); - } - - /** - * Set the date format for JSON (de)serialization with Date properties. - * @param dateFormat Date format - */ - public void setDateFormat(DateFormat dateFormat) { - mapper.setDateFormat(dateFormat); - } - - @Override - public ObjectMapper getContext(Class type) { - return mapper; - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Pair.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Pair.java deleted file mode 100644 index b75cd316ac1..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/Pair.java +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client; - - -public class Pair { - private String name = ""; - private String value = ""; - - public Pair (String name, String value) { - setName(name); - setValue(value); - } - - private void setName(String name) { - if (!isValidString(name)) return; - - this.name = name; - } - - private void setValue(String value) { - if (!isValidString(value)) return; - - this.value = value; - } - - public String getName() { - return this.name; - } - - public String getValue() { - return this.value; - } - - private boolean isValidString(String arg) { - if (arg == null) return false; - if (arg.trim().isEmpty()) return false; - - return true; - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/RFC3339DateFormat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/RFC3339DateFormat.java deleted file mode 100644 index e8df24310aa..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/RFC3339DateFormat.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - -package io.swagger.client; - -import com.fasterxml.jackson.databind.util.ISO8601DateFormat; -import com.fasterxml.jackson.databind.util.ISO8601Utils; - -import java.text.FieldPosition; -import java.util.Date; - - -public class RFC3339DateFormat extends ISO8601DateFormat { - - // Same as ISO8601DateFormat but serializing milliseconds. - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - String value = ISO8601Utils.format(date, true); - toAppendTo.append(value); - return toAppendTo; - } - -} \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/StringUtil.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/StringUtil.java deleted file mode 100644 index 339a3fb36d5..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/StringUtil.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client; - - -public class StringUtil { - /** - * Check if the given array contains the given value (with case-insensitive comparison). - * - * @param array The array - * @param value The value to search - * @return true if the array contains the value - */ - public static boolean containsIgnoreCase(String[] array, String value) { - for (String str : array) { - if (value == null && str == null) return true; - if (value != null && value.equalsIgnoreCase(str)) return true; - } - return false; - } - - /** - * Join an array of strings with the given separator. - *

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

- * - * @param array The array of strings - * @param separator The separator - * @return the resulting string - */ - public static String join(String[] array, String separator) { - int len = array.length; - if (len == 0) return ""; - - StringBuilder out = new StringBuilder(); - out.append(array[0]); - for (int i = 1; i < len; i++) { - out.append(separator).append(array[i]); - } - return out.toString(); - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java deleted file mode 100644 index a4201c9391b..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/AnotherFakeApi.java +++ /dev/null @@ -1,90 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiResponse; -import io.swagger.client.Configuration; -import io.swagger.client.Pair; - -import javax.ws.rs.core.GenericType; - -import io.swagger.client.model.Client; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -public class AnotherFakeApi { - private ApiClient apiClient; - - public AnotherFakeApi() { - this(Configuration.getDefaultApiClient()); - } - - public AnotherFakeApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * To test special tags - * To test special tags - * @param body client model (required) - * @return Client - * @throws ApiException if fails to make API call - */ - public Client testSpecialTags(Client body) throws ApiException { - return testSpecialTagsWithHttpInfo(body).getData(); - } - - /** - * To test special tags - * To test special tags - * @param body client model (required) - * @return ApiResponse<Client> - * @throws ApiException if fails to make API call - */ - public ApiResponse testSpecialTagsWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testSpecialTags"); - } - - // create path and map variables - String localVarPath = "/another-fake/dummy"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java deleted file mode 100644 index 8467ae0508f..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeApi.java +++ /dev/null @@ -1,648 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiResponse; -import io.swagger.client.Configuration; -import io.swagger.client.Pair; - -import javax.ws.rs.core.GenericType; - -import java.math.BigDecimal; -import io.swagger.client.model.Client; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import io.swagger.client.model.OuterComposite; -import io.swagger.client.model.User; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -public class FakeApi { - private ApiClient apiClient; - - public FakeApi() { - this(Configuration.getDefaultApiClient()); - } - - public FakeApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return Boolean - * @throws ApiException if fails to make API call - */ - public Boolean fakeOuterBooleanSerialize(Boolean body) throws ApiException { - return fakeOuterBooleanSerializeWithHttpInfo(body).getData(); - } - - /** - * - * Test serialization of outer boolean types - * @param body Input boolean as post body (optional) - * @return ApiResponse<Boolean> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterBooleanSerializeWithHttpInfo(Boolean body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/boolean"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * - * Test serialization of object with outer number type - * @param body Input composite as post body (optional) - * @return OuterComposite - * @throws ApiException if fails to make API call - */ - public OuterComposite fakeOuterCompositeSerialize(OuterComposite body) throws ApiException { - return fakeOuterCompositeSerializeWithHttpInfo(body).getData(); - } - - /** - * - * Test serialization of object with outer number type - * @param body Input composite as post body (optional) - * @return ApiResponse<OuterComposite> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterCompositeSerializeWithHttpInfo(OuterComposite body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/composite"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return BigDecimal - * @throws ApiException if fails to make API call - */ - public BigDecimal fakeOuterNumberSerialize(BigDecimal body) throws ApiException { - return fakeOuterNumberSerializeWithHttpInfo(body).getData(); - } - - /** - * - * Test serialization of outer number types - * @param body Input number as post body (optional) - * @return ApiResponse<BigDecimal> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterNumberSerializeWithHttpInfo(BigDecimal body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/number"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return String - * @throws ApiException if fails to make API call - */ - public String fakeOuterStringSerialize(String body) throws ApiException { - return fakeOuterStringSerializeWithHttpInfo(body).getData(); - } - - /** - * - * Test serialization of outer string types - * @param body Input string as post body (optional) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse fakeOuterStringSerializeWithHttpInfo(String body) throws ApiException { - Object localVarPostBody = body; - - // create path and map variables - String localVarPath = "/fake/outer/string"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * - * - * @param body (required) - * @param query (required) - * @throws ApiException if fails to make API call - */ - public void testBodyWithQueryParams(User body, String query) throws ApiException { - - testBodyWithQueryParamsWithHttpInfo(body, query); - } - - /** - * - * - * @param body (required) - * @param query (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse testBodyWithQueryParamsWithHttpInfo(User body, String query) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testBodyWithQueryParams"); - } - - // verify the required parameter 'query' is set - if (query == null) { - throw new ApiException(400, "Missing the required parameter 'query' when calling testBodyWithQueryParams"); - } - - // create path and map variables - String localVarPath = "/fake/body-with-query-params"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "query", query)); - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) - * @return Client - * @throws ApiException if fails to make API call - */ - public Client testClientModel(Client body) throws ApiException { - return testClientModelWithHttpInfo(body).getData(); - } - - /** - * To test \"client\" model - * To test \"client\" model - * @param body client model (required) - * @return ApiResponse<Client> - * @throws ApiException if fails to make API call - */ - public ApiResponse testClientModelWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClientModel"); - } - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @throws ApiException if fails to make API call - */ - public void testEndpointParameters(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - - testEndpointParametersWithHttpInfo(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @throws ApiException if fails to make API call - */ - public ApiResponse testEndpointParametersWithHttpInfo(BigDecimal number, Double _double, String patternWithoutDelimiter, byte[] _byte, Integer integer, Integer int32, Long int64, Float _float, String string, byte[] binary, LocalDate date, OffsetDateTime dateTime, String password, String paramCallback) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'number' is set - if (number == null) { - throw new ApiException(400, "Missing the required parameter 'number' when calling testEndpointParameters"); - } - - // verify the required parameter '_double' is set - if (_double == null) { - throw new ApiException(400, "Missing the required parameter '_double' when calling testEndpointParameters"); - } - - // verify the required parameter 'patternWithoutDelimiter' is set - if (patternWithoutDelimiter == null) { - throw new ApiException(400, "Missing the required parameter 'patternWithoutDelimiter' when calling testEndpointParameters"); - } - - // verify the required parameter '_byte' is set - if (_byte == null) { - throw new ApiException(400, "Missing the required parameter '_byte' when calling testEndpointParameters"); - } - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - if (integer != null) - localVarFormParams.put("integer", integer); -if (int32 != null) - localVarFormParams.put("int32", int32); -if (int64 != null) - localVarFormParams.put("int64", int64); -if (number != null) - localVarFormParams.put("number", number); -if (_float != null) - localVarFormParams.put("float", _float); -if (_double != null) - localVarFormParams.put("double", _double); -if (string != null) - localVarFormParams.put("string", string); -if (patternWithoutDelimiter != null) - localVarFormParams.put("pattern_without_delimiter", patternWithoutDelimiter); -if (_byte != null) - localVarFormParams.put("byte", _byte); -if (binary != null) - localVarFormParams.put("binary", binary); -if (date != null) - localVarFormParams.put("date", date); -if (dateTime != null) - localVarFormParams.put("dateTime", dateTime); -if (password != null) - localVarFormParams.put("password", password); -if (paramCallback != null) - localVarFormParams.put("callback", paramCallback); - - final String[] localVarAccepts = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/xml; charset=utf-8", "application/json; charset=utf-8" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "http_basic_test" }; - - - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * To test enum parameters - * To test enum parameters - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @throws ApiException if fails to make API call - */ - public void testEnumParameters(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - - testEnumParametersWithHttpInfo(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); - } - - /** - * To test enum parameters - * To test enum parameters - * @param enumFormStringArray Form parameter enum test (string array) (optional) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @throws ApiException if fails to make API call - */ - public ApiResponse testEnumParametersWithHttpInfo(List enumFormStringArray, String enumFormString, List enumHeaderStringArray, String enumHeaderString, List enumQueryStringArray, String enumQueryString, Integer enumQueryInteger, Double enumQueryDouble) throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/fake"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "enum_query_string_array", enumQueryStringArray)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_string", enumQueryString)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "enum_query_integer", enumQueryInteger)); - - if (enumHeaderStringArray != null) - localVarHeaderParams.put("enum_header_string_array", apiClient.parameterToString(enumHeaderStringArray)); -if (enumHeaderString != null) - localVarHeaderParams.put("enum_header_string", apiClient.parameterToString(enumHeaderString)); - - if (enumFormStringArray != null) - localVarFormParams.put("enum_form_string_array", enumFormStringArray); -if (enumFormString != null) - localVarFormParams.put("enum_form_string", enumFormString); -if (enumQueryDouble != null) - localVarFormParams.put("enum_query_double", enumQueryDouble); - - final String[] localVarAccepts = { - "*/*" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "*/*" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * test inline additionalProperties - * - * @param param request body (required) - * @throws ApiException if fails to make API call - */ - public void testInlineAdditionalProperties(Object param) throws ApiException { - - testInlineAdditionalPropertiesWithHttpInfo(param); - } - - /** - * test inline additionalProperties - * - * @param param request body (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse testInlineAdditionalPropertiesWithHttpInfo(Object param) throws ApiException { - Object localVarPostBody = param; - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testInlineAdditionalProperties"); - } - - // create path and map variables - String localVarPath = "/fake/inline-additionalProperties"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @throws ApiException if fails to make API call - */ - public void testJsonFormData(String param, String param2) throws ApiException { - - testJsonFormDataWithHttpInfo(param, param2); - } - - /** - * test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse testJsonFormDataWithHttpInfo(String param, String param2) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'param' is set - if (param == null) { - throw new ApiException(400, "Missing the required parameter 'param' when calling testJsonFormData"); - } - - // verify the required parameter 'param2' is set - if (param2 == null) { - throw new ApiException(400, "Missing the required parameter 'param2' when calling testJsonFormData"); - } - - // create path and map variables - String localVarPath = "/fake/jsonFormData"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - if (param != null) - localVarFormParams.put("param", param); -if (param2 != null) - localVarFormParams.put("param2", param2); - - final String[] localVarAccepts = { - - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java deleted file mode 100644 index 4c15c19f414..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/FakeClassnameTags123Api.java +++ /dev/null @@ -1,90 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiResponse; -import io.swagger.client.Configuration; -import io.swagger.client.Pair; - -import javax.ws.rs.core.GenericType; - -import io.swagger.client.model.Client; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -public class FakeClassnameTags123Api { - private ApiClient apiClient; - - public FakeClassnameTags123Api() { - this(Configuration.getDefaultApiClient()); - } - - public FakeClassnameTags123Api(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * To test class name in snake case - * To test class name in snake case - * @param body client model (required) - * @return Client - * @throws ApiException if fails to make API call - */ - public Client testClassname(Client body) throws ApiException { - return testClassnameWithHttpInfo(body).getData(); - } - - /** - * To test class name in snake case - * To test class name in snake case - * @param body client model (required) - * @return ApiResponse<Client> - * @throws ApiException if fails to make API call - */ - public ApiResponse testClassnameWithHttpInfo(Client body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling testClassname"); - } - - // create path and map variables - String localVarPath = "/fake_classname_test"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key_query" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "PATCH", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java deleted file mode 100644 index e2cca5b3eec..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/PetApi.java +++ /dev/null @@ -1,482 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiResponse; -import io.swagger.client.Configuration; -import io.swagger.client.Pair; - -import javax.ws.rs.core.GenericType; - -import java.io.File; -import io.swagger.client.model.ModelApiResponse; -import io.swagger.client.model.Pet; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -public class PetApi { - private ApiClient apiClient; - - public PetApi() { - this(Configuration.getDefaultApiClient()); - } - - public PetApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @throws ApiException if fails to make API call - */ - public void addPet(Pet body) throws ApiException { - - addPetWithHttpInfo(body); - } - - /** - * Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse addPetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling addPet"); - } - - // create path and map variables - String localVarPath = "/pet"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @throws ApiException if fails to make API call - */ - public void deletePet(Long petId, String apiKey) throws ApiException { - - deletePetWithHttpInfo(petId, apiKey); - } - - /** - * Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @throws ApiException if fails to make API call - */ - public ApiResponse deletePetWithHttpInfo(Long petId, String apiKey) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling deletePet"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - if (apiKey != null) - localVarHeaderParams.put("api_key", apiClient.parameterToString(apiKey)); - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - - return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return List<Pet> - * @throws ApiException if fails to make API call - */ - public List findPetsByStatus(List status) throws ApiException { - return findPetsByStatusWithHttpInfo(status).getData(); - } - - /** - * Finds Pets by status - * Multiple status values can be provided with comma separated strings - * @param status Status values that need to be considered for filter (required) - * @return ApiResponse<List<Pet>> - * @throws ApiException if fails to make API call - */ - public ApiResponse> findPetsByStatusWithHttpInfo(List status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'status' is set - if (status == null) { - throw new ApiException(400, "Missing the required parameter 'status' when calling findPetsByStatus"); - } - - // create path and map variables - String localVarPath = "/pet/findByStatus"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "status", status)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - GenericType> localVarReturnType = new GenericType>() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return List<Pet> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public List findPetsByTags(List tags) throws ApiException { - return findPetsByTagsWithHttpInfo(tags).getData(); - } - - /** - * Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * @param tags Tags to filter by (required) - * @return ApiResponse<List<Pet>> - * @throws ApiException if fails to make API call - * @deprecated - */ - @Deprecated - public ApiResponse> findPetsByTagsWithHttpInfo(List tags) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'tags' is set - if (tags == null) { - throw new ApiException(400, "Missing the required parameter 'tags' when calling findPetsByTags"); - } - - // create path and map variables - String localVarPath = "/pet/findByTags"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("csv", "tags", tags)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - GenericType> localVarReturnType = new GenericType>() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return Pet - * @throws ApiException if fails to make API call - */ - public Pet getPetById(Long petId) throws ApiException { - return getPetByIdWithHttpInfo(petId).getData(); - } - - /** - * Find pet by ID - * Returns a single pet - * @param petId ID of pet to return (required) - * @return ApiResponse<Pet> - * @throws ApiException if fails to make API call - */ - public ApiResponse getPetByIdWithHttpInfo(Long petId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling getPetById"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @throws ApiException if fails to make API call - */ - public void updatePet(Pet body) throws ApiException { - - updatePetWithHttpInfo(body); - } - - /** - * Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse updatePetWithHttpInfo(Pet body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updatePet"); - } - - // create path and map variables - String localVarPath = "/pet"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/json", "application/xml" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - - return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @throws ApiException if fails to make API call - */ - public void updatePetWithForm(Long petId, String name, String status) throws ApiException { - - updatePetWithFormWithHttpInfo(petId, name, status); - } - - /** - * Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @throws ApiException if fails to make API call - */ - public ApiResponse updatePetWithFormWithHttpInfo(Long petId, String name, String status) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling updatePetWithForm"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - if (name != null) - localVarFormParams.put("name", name); -if (status != null) - localVarFormParams.put("status", status); - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "application/x-www-form-urlencoded" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ModelApiResponse - * @throws ApiException if fails to make API call - */ - public ModelApiResponse uploadFile(Long petId, String additionalMetadata, File file) throws ApiException { - return uploadFileWithHttpInfo(petId, additionalMetadata, file).getData(); - } - - /** - * uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return ApiResponse<ModelApiResponse> - * @throws ApiException if fails to make API call - */ - public ApiResponse uploadFileWithHttpInfo(Long petId, String additionalMetadata, File file) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'petId' is set - if (petId == null) { - throw new ApiException(400, "Missing the required parameter 'petId' when calling uploadFile"); - } - - // create path and map variables - String localVarPath = "/pet/{petId}/uploadImage" - .replaceAll("\\{" + "petId" + "\\}", apiClient.escapeString(petId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - if (additionalMetadata != null) - localVarFormParams.put("additionalMetadata", additionalMetadata); -if (file != null) - localVarFormParams.put("file", file); - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - "multipart/form-data" - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "petstore_auth" }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java deleted file mode 100644 index ede729d9540..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/StoreApi.java +++ /dev/null @@ -1,240 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiResponse; -import io.swagger.client.Configuration; -import io.swagger.client.Pair; - -import javax.ws.rs.core.GenericType; - -import io.swagger.client.model.Order; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -public class StoreApi { - private ApiClient apiClient; - - public StoreApi() { - this(Configuration.getDefaultApiClient()); - } - - public StoreApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @throws ApiException if fails to make API call - */ - public void deleteOrder(String orderId) throws ApiException { - - deleteOrderWithHttpInfo(orderId); - } - - /** - * Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * @param orderId ID of the order that needs to be deleted (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse deleteOrderWithHttpInfo(String orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling deleteOrder"); - } - - // create path and map variables - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return Map<String, Integer> - * @throws ApiException if fails to make API call - */ - public Map getInventory() throws ApiException { - return getInventoryWithHttpInfo().getData(); - } - - /** - * Returns pet inventories by status - * Returns a map of status codes to quantities - * @return ApiResponse<Map<String, Integer>> - * @throws ApiException if fails to make API call - */ - public ApiResponse> getInventoryWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/store/inventory"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { "api_key" }; - - GenericType> localVarReturnType = new GenericType>() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return Order - * @throws ApiException if fails to make API call - */ - public Order getOrderById(Long orderId) throws ApiException { - return getOrderByIdWithHttpInfo(orderId).getData(); - } - - /** - * Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * @param orderId ID of pet that needs to be fetched (required) - * @return ApiResponse<Order> - * @throws ApiException if fails to make API call - */ - public ApiResponse getOrderByIdWithHttpInfo(Long orderId) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'orderId' is set - if (orderId == null) { - throw new ApiException(400, "Missing the required parameter 'orderId' when calling getOrderById"); - } - - // create path and map variables - String localVarPath = "/store/order/{order_id}" - .replaceAll("\\{" + "order_id" + "\\}", apiClient.escapeString(orderId.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return Order - * @throws ApiException if fails to make API call - */ - public Order placeOrder(Order body) throws ApiException { - return placeOrderWithHttpInfo(body).getData(); - } - - /** - * Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return ApiResponse<Order> - * @throws ApiException if fails to make API call - */ - public ApiResponse placeOrderWithHttpInfo(Order body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling placeOrder"); - } - - // create path and map variables - String localVarPath = "/store/order"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java deleted file mode 100644 index 6535ce10427..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/api/UserApi.java +++ /dev/null @@ -1,460 +0,0 @@ -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.ApiClient; -import io.swagger.client.ApiResponse; -import io.swagger.client.Configuration; -import io.swagger.client.Pair; - -import javax.ws.rs.core.GenericType; - -import io.swagger.client.model.User; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - - -public class UserApi { - private ApiClient apiClient; - - public UserApi() { - this(Configuration.getDefaultApiClient()); - } - - public UserApi(ApiClient apiClient) { - this.apiClient = apiClient; - } - - public ApiClient getApiClient() { - return apiClient; - } - - public void setApiClient(ApiClient apiClient) { - this.apiClient = apiClient; - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) - * @throws ApiException if fails to make API call - */ - public void createUser(User body) throws ApiException { - - createUserWithHttpInfo(body); - } - - /** - * Create user - * This can only be done by the logged in user. - * @param body Created user object (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse createUserWithHttpInfo(User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUser"); - } - - // create path and map variables - String localVarPath = "/user"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @throws ApiException if fails to make API call - */ - public void createUsersWithArrayInput(List body) throws ApiException { - - createUsersWithArrayInputWithHttpInfo(body); - } - - /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse createUsersWithArrayInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithArrayInput"); - } - - // create path and map variables - String localVarPath = "/user/createWithArray"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @throws ApiException if fails to make API call - */ - public void createUsersWithListInput(List body) throws ApiException { - - createUsersWithListInputWithHttpInfo(body); - } - - /** - * Creates list of users with given input array - * - * @param body List of user object (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse createUsersWithListInputWithHttpInfo(List body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling createUsersWithListInput"); - } - - // create path and map variables - String localVarPath = "/user/createWithList"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @throws ApiException if fails to make API call - */ - public void deleteUser(String username) throws ApiException { - - deleteUserWithHttpInfo(username); - } - - /** - * Delete user - * This can only be done by the logged in user. - * @param username The name that needs to be deleted (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse deleteUserWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling deleteUser"); - } - - // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return User - * @throws ApiException if fails to make API call - */ - public User getUserByName(String username) throws ApiException { - return getUserByNameWithHttpInfo(username).getData(); - } - - /** - * Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return ApiResponse<User> - * @throws ApiException if fails to make API call - */ - public ApiResponse getUserByNameWithHttpInfo(String username) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling getUserByName"); - } - - // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return String - * @throws ApiException if fails to make API call - */ - public String loginUser(String username, String password) throws ApiException { - return loginUserWithHttpInfo(username, password).getData(); - } - - /** - * Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return ApiResponse<String> - * @throws ApiException if fails to make API call - */ - public ApiResponse loginUserWithHttpInfo(String username, String password) throws ApiException { - Object localVarPostBody = null; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling loginUser"); - } - - // verify the required parameter 'password' is set - if (password == null) { - throw new ApiException(400, "Missing the required parameter 'password' when calling loginUser"); - } - - // create path and map variables - String localVarPath = "/user/login"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - localVarQueryParams.addAll(apiClient.parameterToPairs("", "username", username)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "password", password)); - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); - } - /** - * Logs out current logged in user session - * - * @throws ApiException if fails to make API call - */ - public void logoutUser() throws ApiException { - - logoutUserWithHttpInfo(); - } - - /** - * Logs out current logged in user session - * - * @throws ApiException if fails to make API call - */ - public ApiResponse logoutUserWithHttpInfo() throws ApiException { - Object localVarPostBody = null; - - // create path and map variables - String localVarPath = "/user/logout"; - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "GET", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @throws ApiException if fails to make API call - */ - public void updateUser(String username, User body) throws ApiException { - - updateUserWithHttpInfo(username, body); - } - - /** - * Updated user - * This can only be done by the logged in user. - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @throws ApiException if fails to make API call - */ - public ApiResponse updateUserWithHttpInfo(String username, User body) throws ApiException { - Object localVarPostBody = body; - - // verify the required parameter 'username' is set - if (username == null) { - throw new ApiException(400, "Missing the required parameter 'username' when calling updateUser"); - } - - // verify the required parameter 'body' is set - if (body == null) { - throw new ApiException(400, "Missing the required parameter 'body' when calling updateUser"); - } - - // create path and map variables - String localVarPath = "/user/{username}" - .replaceAll("\\{" + "username" + "\\}", apiClient.escapeString(username.toString())); - - // query params - List localVarQueryParams = new ArrayList(); - Map localVarHeaderParams = new HashMap(); - Map localVarFormParams = new HashMap(); - - - - - final String[] localVarAccepts = { - "application/xml", "application/json" - }; - final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); - - final String[] localVarContentTypes = { - - }; - final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); - - String[] localVarAuthNames = new String[] { }; - - - return apiClient.invokeAPI(localVarPath, "PUT", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null); - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/ApiKeyAuth.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/ApiKeyAuth.java deleted file mode 100644 index 5c6925473e5..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/ApiKeyAuth.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import java.util.Map; -import java.util.List; - - -public class ApiKeyAuth implements Authentication { - private final String location; - private final String paramName; - - private String apiKey; - private String apiKeyPrefix; - - public ApiKeyAuth(String location, String paramName) { - this.location = location; - this.paramName = paramName; - } - - public String getLocation() { - return location; - } - - public String getParamName() { - return paramName; - } - - public String getApiKey() { - return apiKey; - } - - public void setApiKey(String apiKey) { - this.apiKey = apiKey; - } - - public String getApiKeyPrefix() { - return apiKeyPrefix; - } - - public void setApiKeyPrefix(String apiKeyPrefix) { - this.apiKeyPrefix = apiKeyPrefix; - } - - @Override - public void applyToParams(List queryParams, Map headerParams) { - if (apiKey == null) { - return; - } - String value; - if (apiKeyPrefix != null) { - value = apiKeyPrefix + " " + apiKey; - } else { - value = apiKey; - } - if ("query".equals(location)) { - queryParams.add(new Pair(paramName, value)); - } else if ("header".equals(location)) { - headerParams.put(paramName, value); - } - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/Authentication.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/Authentication.java deleted file mode 100644 index e40d7ff7002..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/Authentication.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import java.util.Map; -import java.util.List; - -public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - */ - void applyToParams(List queryParams, Map headerParams); -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/HttpBasicAuth.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/HttpBasicAuth.java deleted file mode 100644 index 788b63a9918..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/HttpBasicAuth.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import com.migcomponents.migbase64.Base64; - -import java.util.Map; -import java.util.List; - -import java.io.UnsupportedEncodingException; - - -public class HttpBasicAuth implements Authentication { - private String username; - private String password; - - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @Override - public void applyToParams(List queryParams, Map headerParams) { - if (username == null && password == null) { - return; - } - String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - try { - headerParams.put("Authorization", "Basic " + Base64.encodeToString(str.getBytes("UTF-8"), false)); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/OAuth.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/OAuth.java deleted file mode 100644 index 2d9dc9da8b5..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/OAuth.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.auth; - -import io.swagger.client.Pair; - -import java.util.Map; -import java.util.List; - - -public class OAuth implements Authentication { - private String accessToken; - - public String getAccessToken() { - return accessToken; - } - - public void setAccessToken(String accessToken) { - this.accessToken = accessToken; - } - - @Override - public void applyToParams(List queryParams, Map headerParams) { - if (accessToken != null) { - headerParams.put("Authorization", "Bearer " + accessToken); - } - } -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/OAuthFlow.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/OAuthFlow.java deleted file mode 100644 index b3718a0643c..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/auth/OAuthFlow.java +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.auth; - -public enum OAuthFlow { - accessCode, implicit, password, application -} diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java deleted file mode 100644 index 2be1838838c..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -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; - -/** - * AdditionalPropertiesClass - */ - -public class AdditionalPropertiesClass { - @JsonProperty("map_property") - private Map mapProperty = null; - - @JsonProperty("map_of_map_property") - private Map> mapOfMapProperty = null; - - public AdditionalPropertiesClass mapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - return this; - } - - public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { - if (this.mapProperty == null) { - this.mapProperty = new HashMap(); - } - this.mapProperty.put(key, mapPropertyItem); - return this; - } - - /** - * Get mapProperty - * @return mapProperty - **/ - @ApiModelProperty(value = "") - public Map getMapProperty() { - return mapProperty; - } - - public void setMapProperty(Map mapProperty) { - this.mapProperty = mapProperty; - } - - public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - return this; - } - - public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { - if (this.mapOfMapProperty == null) { - this.mapOfMapProperty = new HashMap>(); - } - this.mapOfMapProperty.put(key, mapOfMapPropertyItem); - return this; - } - - /** - * Get mapOfMapProperty - * @return mapOfMapProperty - **/ - @ApiModelProperty(value = "") - public Map> getMapOfMapProperty() { - return mapOfMapProperty; - } - - public void setMapOfMapProperty(Map> mapOfMapProperty) { - this.mapOfMapProperty = mapOfMapProperty; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return ObjectUtils.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && - ObjectUtils.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(mapProperty, mapOfMapProperty); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - - sb.append(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); - sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Animal.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Animal.java deleted file mode 100644 index b64a9d4388d..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Animal.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -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.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Animal - */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) -@JsonSubTypes({ - @JsonSubTypes.Type(value = Dog.class, name = "Dog"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), -}) - -public class Animal { - @JsonProperty("className") - private String className = null; - - @JsonProperty("color") - private String color = "red"; - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - **/ - @ApiModelProperty(required = true, value = "") - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - **/ - @ApiModelProperty(value = "") - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return ObjectUtils.equals(this.className, animal.className) && - ObjectUtils.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(className, color); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AnimalFarm.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AnimalFarm.java deleted file mode 100644 index 382a9368aa0..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/AnimalFarm.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import io.swagger.client.model.Animal; -import java.util.ArrayList; -import java.util.List; - -/** - * AnimalFarm - */ - -public class AnimalFarm extends ArrayList { - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - return true; - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AnimalFarm {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index f4b8c8c9fb3..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -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.List; - -/** - * ArrayOfArrayOfNumberOnly - */ - -public class ArrayOfArrayOfNumberOnly { - @JsonProperty("ArrayArrayNumber") - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - **/ - @ApiModelProperty(value = "") - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return ObjectUtils.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(arrayArrayNumber); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java deleted file mode 100644 index 7eb9c03fc79..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -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.List; - -/** - * ArrayOfNumberOnly - */ - -public class ArrayOfNumberOnly { - @JsonProperty("ArrayNumber") - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - **/ - @ApiModelProperty(value = "") - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return ObjectUtils.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(arrayNumber); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java deleted file mode 100644 index 11505132cd9..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ArrayTest.java +++ /dev/null @@ -1,163 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.client.model.ReadOnlyFirst; -import java.util.ArrayList; -import java.util.List; - -/** - * ArrayTest - */ - -public class ArrayTest { - @JsonProperty("array_of_string") - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - **/ - @ApiModelProperty(value = "") - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - **/ - @ApiModelProperty(value = "") - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - **/ - @ApiModelProperty(value = "") - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return ObjectUtils.equals(this.arrayOfString, arrayTest.arrayOfString) && - ObjectUtils.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - ObjectUtils.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Capitalization.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Capitalization.java deleted file mode 100644 index 8bf2311949e..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Capitalization.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Capitalization - */ - -public class Capitalization { - @JsonProperty("smallCamel") - private String smallCamel = null; - - @JsonProperty("CapitalCamel") - private String capitalCamel = null; - - @JsonProperty("small_Snake") - private String smallSnake = null; - - @JsonProperty("Capital_Snake") - private String capitalSnake = null; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints = null; - - @JsonProperty("ATT_NAME") - private String ATT_NAME = null; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - **/ - @ApiModelProperty(value = "") - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - **/ - @ApiModelProperty(value = "") - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - **/ - @ApiModelProperty(value = "") - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - **/ - @ApiModelProperty(value = "") - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - **/ - @ApiModelProperty(value = "") - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - **/ - @ApiModelProperty(value = "Name of the pet ") - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return ObjectUtils.equals(this.smallCamel, capitalization.smallCamel) && - ObjectUtils.equals(this.capitalCamel, capitalization.capitalCamel) && - ObjectUtils.equals(this.smallSnake, capitalization.smallSnake) && - ObjectUtils.equals(this.capitalSnake, capitalization.capitalSnake) && - ObjectUtils.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - ObjectUtils.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java deleted file mode 100644 index 958c985cb92..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Cat.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.client.model.Animal; - -/** - * Cat - */ - -public class Cat extends Animal { - @JsonProperty("declawed") - private Boolean declawed = null; - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - **/ - @ApiModelProperty(value = "") - public Boolean isDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return ObjectUtils.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(declawed, super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Category.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Category.java deleted file mode 100644 index 1853e6d1589..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Category.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Category - */ - -public class Category { - @JsonProperty("id") - private Long id = null; - - @JsonProperty("name") - private String name = null; - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return ObjectUtils.equals(this.id, category.id) && - ObjectUtils.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(id, name); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ClassModel.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ClassModel.java deleted file mode 100644 index 4f3a3145863..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ClassModel.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Model for testing model with \"_class\" property - */ -@ApiModel(description = "Model for testing model with \"_class\" property") - -public class ClassModel { - @JsonProperty("_class") - private String propertyClass = null; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return ObjectUtils.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(propertyClass); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Client.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Client.java deleted file mode 100644 index d85880077b5..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Client.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Client - */ - -public class Client { - @JsonProperty("client") - private String client = null; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - **/ - @ApiModelProperty(value = "") - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return ObjectUtils.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(client); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Dog.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Dog.java deleted file mode 100644 index 8c67027ad96..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Dog.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.client.model.Animal; - -/** - * Dog - */ - -public class Dog extends Animal { - @JsonProperty("breed") - private String breed = null; - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - **/ - @ApiModelProperty(value = "") - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return ObjectUtils.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(breed, super.hashCode()); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java deleted file mode 100644 index fa58bb72b8c..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumArrays.java +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.ArrayList; -import java.util.List; - -/** - * EnumArrays - */ - -public class EnumArrays { - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String text) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol = null; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String text) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("array_enum") - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - **/ - @ApiModelProperty(value = "") - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - **/ - @ApiModelProperty(value = "") - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return ObjectUtils.equals(this.justSymbol, enumArrays.justSymbol) && - ObjectUtils.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(justSymbol, arrayEnum); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumClass.java deleted file mode 100644 index 3c92d19b127..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumClass.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String text) { - for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java deleted file mode 100644 index f7710aa02c0..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/EnumTest.java +++ /dev/null @@ -1,327 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.client.model.OuterEnum; - -/** - * EnumTest - */ - -public class EnumTest { - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String text) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString = null; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired = null; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(String text) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger = null; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(String text) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber = null; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum = null; - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - **/ - @ApiModelProperty(value = "") - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - **/ - @ApiModelProperty(required = true, value = "") - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - **/ - @ApiModelProperty(value = "") - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - **/ - @ApiModelProperty(value = "") - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - **/ - @ApiModelProperty(value = "") - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return ObjectUtils.equals(this.enumString, enumTest.enumString) && - ObjectUtils.equals(this.enumStringRequired, enumTest.enumStringRequired) && - ObjectUtils.equals(this.enumInteger, enumTest.enumInteger) && - ObjectUtils.equals(this.enumNumber, enumTest.enumNumber) && - ObjectUtils.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java deleted file mode 100644 index 1eac24d55c6..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/FormatTest.java +++ /dev/null @@ -1,380 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.UUID; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; - -/** - * FormatTest - */ - -public class FormatTest { - @JsonProperty("integer") - private Integer integer = null; - - @JsonProperty("int32") - private Integer int32 = null; - - @JsonProperty("int64") - private Long int64 = null; - - @JsonProperty("number") - private BigDecimal number = null; - - @JsonProperty("float") - private Float _float = null; - - @JsonProperty("double") - private Double _double = null; - - @JsonProperty("string") - private String string = null; - - @JsonProperty("byte") - private byte[] _byte = null; - - @JsonProperty("binary") - private byte[] binary = null; - - @JsonProperty("date") - private LocalDate date = null; - - @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; - - @JsonProperty("uuid") - private UUID uuid = null; - - @JsonProperty("password") - private String password = null; - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - **/ - @ApiModelProperty(value = "") - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - **/ - @ApiModelProperty(value = "") - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - **/ - @ApiModelProperty(value = "") - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - **/ - @ApiModelProperty(required = true, value = "") - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - **/ - @ApiModelProperty(value = "") - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - **/ - @ApiModelProperty(value = "") - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - **/ - @ApiModelProperty(value = "") - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - **/ - @ApiModelProperty(required = true, value = "") - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(byte[] binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - **/ - @ApiModelProperty(value = "") - public byte[] getBinary() { - return binary; - } - - public void setBinary(byte[] binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - **/ - @ApiModelProperty(required = true, value = "") - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @ApiModelProperty(value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @ApiModelProperty(required = true, value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return ObjectUtils.equals(this.integer, formatTest.integer) && - ObjectUtils.equals(this.int32, formatTest.int32) && - ObjectUtils.equals(this.int64, formatTest.int64) && - ObjectUtils.equals(this.number, formatTest.number) && - ObjectUtils.equals(this._float, formatTest._float) && - ObjectUtils.equals(this._double, formatTest._double) && - ObjectUtils.equals(this.string, formatTest.string) && - ObjectUtils.equals(this._byte, formatTest._byte) && - ObjectUtils.equals(this.binary, formatTest.binary) && - ObjectUtils.equals(this.date, formatTest.date) && - ObjectUtils.equals(this.dateTime, formatTest.dateTime) && - ObjectUtils.equals(this.uuid, formatTest.uuid) && - ObjectUtils.equals(this.password, formatTest.password); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java deleted file mode 100644 index cbf3cb3f955..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * HasOnlyReadOnly - */ - -public class HasOnlyReadOnly { - @JsonProperty("bar") - private String bar = null; - - @JsonProperty("foo") - private String foo = null; - - /** - * Get bar - * @return bar - **/ - @ApiModelProperty(value = "") - public String getBar() { - return bar; - } - - /** - * Get foo - * @return foo - **/ - @ApiModelProperty(value = "") - public String getFoo() { - return foo; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return ObjectUtils.equals(this.bar, hasOnlyReadOnly.bar) && - ObjectUtils.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(bar, foo); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java deleted file mode 100644 index 6e0a97bbc72..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MapTest.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -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; - -/** - * MapTest - */ - -public class MapTest { - @JsonProperty("map_map_of_string") - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String text) { - for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("map_of_enum_string") - private Map mapOfEnumString = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - **/ - @ApiModelProperty(value = "") - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - **/ - @ApiModelProperty(value = "") - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return ObjectUtils.equals(this.mapMapOfString, mapTest.mapMapOfString) && - ObjectUtils.equals(this.mapOfEnumString, mapTest.mapOfEnumString); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(mapMapOfString, mapOfEnumString); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index 5ff907a7900..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.client.model.Animal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.UUID; -import org.threeten.bp.OffsetDateTime; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -public class MixedPropertiesAndAdditionalPropertiesClass { - @JsonProperty("uuid") - private UUID uuid = null; - - @JsonProperty("dateTime") - private OffsetDateTime dateTime = null; - - @JsonProperty("map") - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - **/ - @ApiModelProperty(value = "") - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - **/ - @ApiModelProperty(value = "") - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - **/ - @ApiModelProperty(value = "") - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return ObjectUtils.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - ObjectUtils.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - ObjectUtils.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(uuid, dateTime, map); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java deleted file mode 100644 index b32ea0a16c4..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Model200Response.java +++ /dev/null @@ -1,114 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Model for testing model name starting with number - */ -@ApiModel(description = "Model for testing model name starting with number") - -public class Model200Response { - @JsonProperty("name") - private Integer name = null; - - @JsonProperty("class") - private String propertyClass = null; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - **/ - @ApiModelProperty(value = "") - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200Response = (Model200Response) o; - return ObjectUtils.equals(this.name, _200Response.name) && - ObjectUtils.equals(this.propertyClass, _200Response.propertyClass); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(name, propertyClass); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelApiResponse.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelApiResponse.java deleted file mode 100644 index 764534696b7..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelApiResponse.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * ModelApiResponse - */ - -public class ModelApiResponse { - @JsonProperty("code") - private Integer code = null; - - @JsonProperty("type") - private String type = null; - - @JsonProperty("message") - private String message = null; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - **/ - @ApiModelProperty(value = "") - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - **/ - @ApiModelProperty(value = "") - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - **/ - @ApiModelProperty(value = "") - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return ObjectUtils.equals(this.code, _apiResponse.code) && - ObjectUtils.equals(this.type, _apiResponse.type) && - ObjectUtils.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(code, type, message); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelReturn.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelReturn.java deleted file mode 100644 index f8c0979d43c..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelReturn.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Model for testing reserved words - */ -@ApiModel(description = "Model for testing reserved words") - -public class ModelReturn { - @JsonProperty("return") - private Integer _return = null; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - **/ - @ApiModelProperty(value = "") - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return ObjectUtils.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(_return); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java deleted file mode 100644 index a3c678b021f..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Name.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Model for testing model name same as property name - */ -@ApiModel(description = "Model for testing model name same as property name") - -public class Name { - @JsonProperty("name") - private Integer name = null; - - @JsonProperty("snake_case") - private Integer snakeCase = null; - - @JsonProperty("property") - private String property = null; - - @JsonProperty("123Number") - private Integer _123Number = null; - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(required = true, value = "") - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - /** - * Get snakeCase - * @return snakeCase - **/ - @ApiModelProperty(value = "") - public Integer getSnakeCase() { - return snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - **/ - @ApiModelProperty(value = "") - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - /** - * Get _123Number - * @return _123Number - **/ - @ApiModelProperty(value = "") - public Integer get123Number() { - return _123Number; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return ObjectUtils.equals(this.name, name.name) && - ObjectUtils.equals(this.snakeCase, name.snakeCase) && - ObjectUtils.equals(this.property, name.property) && - ObjectUtils.equals(this._123Number, name._123Number); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(name, snakeCase, property, _123Number); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123Number: ").append(toIndentedString(_123Number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/NumberOnly.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/NumberOnly.java deleted file mode 100644 index a4fffd86805..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/NumberOnly.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; - -/** - * NumberOnly - */ - -public class NumberOnly { - @JsonProperty("JustNumber") - private BigDecimal justNumber = null; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - **/ - @ApiModelProperty(value = "") - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return ObjectUtils.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(justNumber); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java deleted file mode 100644 index fba033c63b9..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Order.java +++ /dev/null @@ -1,243 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.threeten.bp.OffsetDateTime; - -/** - * Order - */ - -public class Order { - @JsonProperty("id") - private Long id = null; - - @JsonProperty("petId") - private Long petId = null; - - @JsonProperty("quantity") - private Integer quantity = null; - - @JsonProperty("shipDate") - private OffsetDateTime shipDate = null; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("status") - private StatusEnum status = null; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - **/ - @ApiModelProperty(value = "") - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - **/ - @ApiModelProperty(value = "") - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - **/ - @ApiModelProperty(value = "") - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - **/ - @ApiModelProperty(value = "Order Status") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - **/ - @ApiModelProperty(value = "") - public Boolean isComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return ObjectUtils.equals(this.id, order.id) && - ObjectUtils.equals(this.petId, order.petId) && - ObjectUtils.equals(this.quantity, order.quantity) && - ObjectUtils.equals(this.shipDate, order.shipDate) && - ObjectUtils.equals(this.status, order.status) && - ObjectUtils.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(id, petId, quantity, shipDate, status, complete); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java deleted file mode 100644 index 0f84b926a5b..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterComposite.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; - -/** - * OuterComposite - */ - -public class OuterComposite { - @JsonProperty("my_number") - private BigDecimal myNumber = null; - - @JsonProperty("my_string") - private String myString = null; - - @JsonProperty("my_boolean") - private Boolean myBoolean = null; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - **/ - @ApiModelProperty(value = "") - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - **/ - @ApiModelProperty(value = "") - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - **/ - @ApiModelProperty(value = "") - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return ObjectUtils.equals(this.myNumber, outerComposite.myNumber) && - ObjectUtils.equals(this.myString, outerComposite.myString) && - ObjectUtils.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(myNumber, myString, myBoolean); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterEnum.java deleted file mode 100644 index f8a903d325a..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/OuterEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String text) { - for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java deleted file mode 100644 index be3b82347e4..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Pet.java +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import io.swagger.client.model.Category; -import io.swagger.client.model.Tag; -import java.util.ArrayList; -import java.util.List; - -/** - * Pet - */ - -public class Pet { - @JsonProperty("id") - private Long id = null; - - @JsonProperty("category") - private Category category = null; - - @JsonProperty("name") - private String name = null; - - @JsonProperty("photoUrls") - private List photoUrls = new ArrayList(); - - @JsonProperty("tags") - private List tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String text) { - for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { - return b; - } - } - return null; - } - } - - @JsonProperty("status") - private StatusEnum status = null; - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - **/ - @ApiModelProperty(value = "") - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(example = "doggie", required = true, value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(List photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - **/ - @ApiModelProperty(required = true, value = "") - public List getPhotoUrls() { - return photoUrls; - } - - public void setPhotoUrls(List photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - **/ - @ApiModelProperty(value = "") - public List getTags() { - return tags; - } - - public void setTags(List tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - **/ - @ApiModelProperty(value = "pet status in the store") - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return ObjectUtils.equals(this.id, pet.id) && - ObjectUtils.equals(this.category, pet.category) && - ObjectUtils.equals(this.name, pet.name) && - ObjectUtils.equals(this.photoUrls, pet.photoUrls) && - ObjectUtils.equals(this.tags, pet.tags) && - ObjectUtils.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(id, category, name, photoUrls, tags, status); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ReadOnlyFirst.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ReadOnlyFirst.java deleted file mode 100644 index 8aa0c00583e..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ReadOnlyFirst.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * ReadOnlyFirst - */ - -public class ReadOnlyFirst { - @JsonProperty("bar") - private String bar = null; - - @JsonProperty("baz") - private String baz = null; - - /** - * Get bar - * @return bar - **/ - @ApiModelProperty(value = "") - public String getBar() { - return bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - **/ - @ApiModelProperty(value = "") - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return ObjectUtils.equals(this.bar, readOnlyFirst.bar) && - ObjectUtils.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(bar, baz); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java deleted file mode 100644 index 6c750b2d75d..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/SpecialModelName.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * SpecialModelName - */ - -public class SpecialModelName { - @JsonProperty("$special[property.name]") - private Long specialPropertyName = null; - - public SpecialModelName specialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; - return this; - } - - /** - * Get specialPropertyName - * @return specialPropertyName - **/ - @ApiModelProperty(value = "") - public Long getSpecialPropertyName() { - return specialPropertyName; - } - - public void setSpecialPropertyName(Long specialPropertyName) { - this.specialPropertyName = specialPropertyName; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName specialModelName = (SpecialModelName) o; - return ObjectUtils.equals(this.specialPropertyName, specialModelName.specialPropertyName); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(specialPropertyName); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - - sb.append(" specialPropertyName: ").append(toIndentedString(specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Tag.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Tag.java deleted file mode 100644 index c1d2ba92ee2..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Tag.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * Tag - */ - -public class Tag { - @JsonProperty("id") - private Long id = null; - - @JsonProperty("name") - private String name = null; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - **/ - @ApiModelProperty(value = "") - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return ObjectUtils.equals(this.id, tag.id) && - ObjectUtils.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(id, name); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/User.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/User.java deleted file mode 100644 index 04bfc454d25..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/User.java +++ /dev/null @@ -1,251 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.model; - -import org.apache.commons.lang3.ObjectUtils; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; - -/** - * User - */ - -public class User { - @JsonProperty("id") - private Long id = null; - - @JsonProperty("username") - private String username = null; - - @JsonProperty("firstName") - private String firstName = null; - - @JsonProperty("lastName") - private String lastName = null; - - @JsonProperty("email") - private String email = null; - - @JsonProperty("password") - private String password = null; - - @JsonProperty("phone") - private String phone = null; - - @JsonProperty("userStatus") - private Integer userStatus = null; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - **/ - @ApiModelProperty(value = "") - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - **/ - @ApiModelProperty(value = "") - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - **/ - @ApiModelProperty(value = "") - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - **/ - @ApiModelProperty(value = "") - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - **/ - @ApiModelProperty(value = "") - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - **/ - @ApiModelProperty(value = "") - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - **/ - @ApiModelProperty(value = "") - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - **/ - @ApiModelProperty(value = "User Status") - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - - @Override - public boolean equals(java.lang.Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return ObjectUtils.equals(this.id, user.id) && - ObjectUtils.equals(this.username, user.username) && - ObjectUtils.equals(this.firstName, user.firstName) && - ObjectUtils.equals(this.lastName, user.lastName) && - ObjectUtils.equals(this.email, user.email) && - ObjectUtils.equals(this.password, user.password) && - ObjectUtils.equals(this.phone, user.phone) && - ObjectUtils.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return ObjectUtils.hashCodeMulti(id, username, firstName, lastName, email, password, phone, userStatus); - } - - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(java.lang.Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } - -} - diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java deleted file mode 100644 index a5339a392d2..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/AnotherFakeApiTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for AnotherFakeApi - */ -@Ignore -public class AnotherFakeApiTest { - - private final AnotherFakeApi api = new AnotherFakeApi(); - - - /** - * To test special tags - * - * To test special tags - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testSpecialTagsTest() throws ApiException { - Client body = null; - Client response = api.testSpecialTags(body); - - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java deleted file mode 100644 index 0e4979b2906..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeApiTest.java +++ /dev/null @@ -1,204 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import java.math.BigDecimal; -import io.swagger.client.model.Client; -import org.threeten.bp.LocalDate; -import org.threeten.bp.OffsetDateTime; -import io.swagger.client.model.OuterComposite; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FakeApi - */ -@Ignore -public class FakeApiTest { - - private final FakeApi api = new FakeApi(); - - - /** - * - * - * Test serialization of outer boolean types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterBooleanSerializeTest() throws ApiException { - Boolean body = null; - Boolean response = api.fakeOuterBooleanSerialize(body); - - // TODO: test validations - } - - /** - * - * - * Test serialization of object with outer number type - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterCompositeSerializeTest() throws ApiException { - OuterComposite body = null; - OuterComposite response = api.fakeOuterCompositeSerialize(body); - - // TODO: test validations - } - - /** - * - * - * Test serialization of outer number types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterNumberSerializeTest() throws ApiException { - BigDecimal body = null; - BigDecimal response = api.fakeOuterNumberSerialize(body); - - // TODO: test validations - } - - /** - * - * - * Test serialization of outer string types - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void fakeOuterStringSerializeTest() throws ApiException { - String body = null; - String response = api.fakeOuterStringSerialize(body); - - // TODO: test validations - } - - /** - * To test \"client\" model - * - * To test \"client\" model - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testClientModelTest() throws ApiException { - Client body = null; - Client response = api.testClientModel(body); - - // TODO: test validations - } - - /** - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testEndpointParametersTest() throws ApiException { - BigDecimal number = null; - Double _double = null; - String patternWithoutDelimiter = null; - byte[] _byte = null; - Integer integer = null; - Integer int32 = null; - Long int64 = null; - Float _float = null; - String string = null; - byte[] binary = null; - LocalDate date = null; - OffsetDateTime dateTime = null; - String password = null; - String paramCallback = null; - api.testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback); - - // TODO: test validations - } - - /** - * To test enum parameters - * - * To test enum parameters - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testEnumParametersTest() throws ApiException { - List enumFormStringArray = null; - String enumFormString = null; - List enumHeaderStringArray = null; - String enumHeaderString = null; - List enumQueryStringArray = null; - String enumQueryString = null; - Integer enumQueryInteger = null; - Double enumQueryDouble = null; - api.testEnumParameters(enumFormStringArray, enumFormString, enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble); - - // TODO: test validations - } - - /** - * test inline additionalProperties - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testInlineAdditionalPropertiesTest() throws ApiException { - Object param = null; - api.testInlineAdditionalProperties(param); - - // TODO: test validations - } - - /** - * test json serialization of form data - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testJsonFormDataTest() throws ApiException { - String param = null; - String param2 = null; - api.testJsonFormData(param, param2); - - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java deleted file mode 100644 index af5885aaddd..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.Client; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for FakeClassnameTags123Api - */ -@Ignore -public class FakeClassnameTags123ApiTest { - - private final FakeClassnameTags123Api api = new FakeClassnameTags123Api(); - - - /** - * To test class name in snake case - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void testClassnameTest() throws ApiException { - Client body = null; - Client response = api.testClassname(body); - - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java deleted file mode 100644 index 349a55d93dc..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/PetApiTest.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import java.io.File; -import io.swagger.client.model.ModelApiResponse; -import io.swagger.client.model.Pet; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for PetApi - */ -@Ignore -public class PetApiTest { - - private final PetApi api = new PetApi(); - - - /** - * Add a new pet to the store - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void addPetTest() throws ApiException { - Pet body = null; - api.addPet(body); - - // TODO: test validations - } - - /** - * Deletes a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deletePetTest() throws ApiException { - Long petId = null; - String apiKey = null; - api.deletePet(petId, apiKey); - - // TODO: test validations - } - - /** - * Finds Pets by status - * - * Multiple status values can be provided with comma separated strings - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void findPetsByStatusTest() throws ApiException { - List status = null; - List response = api.findPetsByStatus(status); - - // TODO: test validations - } - - /** - * Finds Pets by tags - * - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void findPetsByTagsTest() throws ApiException { - List tags = null; - List response = api.findPetsByTags(tags); - - // TODO: test validations - } - - /** - * Find pet by ID - * - * Returns a single pet - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getPetByIdTest() throws ApiException { - Long petId = null; - Pet response = api.getPetById(petId); - - // TODO: test validations - } - - /** - * Update an existing pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updatePetTest() throws ApiException { - Pet body = null; - api.updatePet(body); - - // TODO: test validations - } - - /** - * Updates a pet in the store with form data - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updatePetWithFormTest() throws ApiException { - Long petId = null; - String name = null; - String status = null; - api.updatePetWithForm(petId, name, status); - - // TODO: test validations - } - - /** - * uploads an image - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void uploadFileTest() throws ApiException { - Long petId = null; - String additionalMetadata = null; - File file = null; - ModelApiResponse response = api.uploadFile(petId, additionalMetadata, file); - - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java deleted file mode 100644 index bef0884a2da..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/StoreApiTest.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.Order; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for StoreApi - */ -@Ignore -public class StoreApiTest { - - private final StoreApi api = new StoreApi(); - - - /** - * Delete purchase order by ID - * - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deleteOrderTest() throws ApiException { - String orderId = null; - api.deleteOrder(orderId); - - // TODO: test validations - } - - /** - * Returns pet inventories by status - * - * Returns a map of status codes to quantities - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getInventoryTest() throws ApiException { - Map response = api.getInventory(); - - // TODO: test validations - } - - /** - * Find purchase order by ID - * - * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getOrderByIdTest() throws ApiException { - Long orderId = null; - Order response = api.getOrderById(orderId); - - // TODO: test validations - } - - /** - * Place an order for a pet - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void placeOrderTest() throws ApiException { - Order body = null; - Order response = api.placeOrder(body); - - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java deleted file mode 100644 index 4455b3920b9..00000000000 --- a/samples/client/petstore/java/jersey2-java6/src/test/java/io/swagger/client/api/UserApiTest.java +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Swagger Petstore - * 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 - * Contact: apiteam@swagger.io - * - * NOTE: This class is auto generated by the swagger code generator program. - * https://github.com/swagger-api/swagger-codegen.git - * Do not edit the class manually. - */ - - -package io.swagger.client.api; - -import io.swagger.client.ApiException; -import io.swagger.client.model.User; -import org.junit.Test; -import org.junit.Ignore; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * API tests for UserApi - */ -@Ignore -public class UserApiTest { - - private final UserApi api = new UserApi(); - - - /** - * Create user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUserTest() throws ApiException { - User body = null; - api.createUser(body); - - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUsersWithArrayInputTest() throws ApiException { - List body = null; - api.createUsersWithArrayInput(body); - - // TODO: test validations - } - - /** - * Creates list of users with given input array - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void createUsersWithListInputTest() throws ApiException { - List body = null; - api.createUsersWithListInput(body); - - // TODO: test validations - } - - /** - * Delete user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void deleteUserTest() throws ApiException { - String username = null; - api.deleteUser(username); - - // TODO: test validations - } - - /** - * Get user by user name - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void getUserByNameTest() throws ApiException { - String username = null; - User response = api.getUserByName(username); - - // TODO: test validations - } - - /** - * Logs user into the system - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void loginUserTest() throws ApiException { - String username = null; - String password = null; - String response = api.loginUser(username, password); - - // TODO: test validations - } - - /** - * Logs out current logged in user session - * - * - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void logoutUserTest() throws ApiException { - api.logoutUser(); - - // TODO: test validations - } - - /** - * Updated user - * - * This can only be done by the logged in user. - * - * @throws ApiException - * if the Api call fails - */ - @Test - public void updateUserTest() throws ApiException { - String username = null; - User body = null; - api.updateUser(username, body); - - // TODO: test validations - } - -} diff --git a/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/README.md b/samples/client/petstore/java/jersey2-java8/README.md index 8ceb02c6e3b..d8ecb56a9fe 100644 --- a/samples/client/petstore/java/jersey2-java8/README.md +++ b/samples/client/petstore/java/jersey2-java8/README.md @@ -1,24 +1,35 @@ # swagger-petstore-jersey2 +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-jersey2 - 1.0.0 - compile + io.swagger + swagger-petstore-jersey2 + 1.0.0 + compile ``` @@ -45,12 +56,14 @@ compile "io.swagger:swagger-petstore-jersey2:1.0.0" At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-jersey2-1.0.0.jar -* target/lib/*.jar +* `target/swagger-petstore-jersey2-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -95,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -132,21 +146,27 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Ints](docs/Ints.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelBoolean](docs/ModelBoolean.md) + - [ModelList](docs/ModelList.md) - [ModelReturn](docs/ModelReturn.md) - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) + - [Numbers](docs/Numbers.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) @@ -155,8 +175,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index e3c0a4c4d4b..8e72814ac27 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -93,8 +93,8 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" jersey_version = "2.29.1" junit_version = "4.12" } @@ -108,6 +108,6 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" compile "org.glassfish.jersey.inject:jersey-hk2:$jersey_version" - compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version", + compile "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jackson_version" testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey2-java8/build.sbt b/samples/client/petstore/java/jersey2-java8/build.sbt index b227bd887f2..08a2bb69d7e 100644 --- a/samples/client/petstore/java/jersey2-java8/build.sbt +++ b/samples/client/petstore/java/jersey2-java8/build.sbt @@ -14,10 +14,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.29.1", "org.glassfish.jersey.inject" % "jersey-hk2" % "2.29.1", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.29.1", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", - "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.10.1" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", + "com.fasterxml.jackson.datatype" % "jackson-datatype-jsr310" % "2.11.4" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore/java/jersey2-java8/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/jersey2-java8/docs/Fake_classname_tags123Api.md deleted file mode 100644 index 56f7c9ea1ff..00000000000 --- a/samples/client/petstore/java/jersey2-java8/docs/Fake_classname_tags123Api.md +++ /dev/null @@ -1,52 +0,0 @@ -# Fake_classname_tags123Api - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.Fake_classname_tags123Api; - - -Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling Fake_classname_tags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2-java8/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/jersey2-java8/docs/FakeclassnametagsApi.md deleted file mode 100644 index f8ec0768e1f..00000000000 --- a/samples/client/petstore/java/jersey2-java8/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2-java8/docs/Ints.md b/samples/client/petstore/java/jersey2-java8/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelBoolean.md b/samples/client/petstore/java/jersey2-java8/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/ModelList.md b/samples/client/petstore/java/jersey2-java8/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java8/docs/Numbers.md b/samples/client/petstore/java/jersey2-java8/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/jersey2-java8/pom.xml b/samples/client/petstore/java/jersey2-java8/pom.xml index 3e1b085045d..7a7bcf64151 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -256,10 +256,10 @@ UTF-8 - 1.5.18 + 1.5.24 2.29.1 - 2.10.1 + 2.11.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java index ba800f4230c..ecc171efc68 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/ApiClient.java @@ -24,6 +24,7 @@ import java.io.InputStream; import java.nio.file.Files; +import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; import java.util.Collection; @@ -291,7 +292,7 @@ public ApiClient setConnectTimeout(int connectionTimeout) { public int getReadTimeout() { return readTimeout; } - + /** * Set the read timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and @@ -617,9 +618,9 @@ public File prepareDownloadFile(Response response) throws IOException { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java index 6597c52b7b3..178e990375c 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java index 65abf528469..43700675c71 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java index 5f429686da4..760c8a23f92 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java index da8a23e3d75..0100fcd4c17 100644 --- a/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2-java8/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2/README.md b/samples/client/petstore/java/jersey2/README.md index 8ceb02c6e3b..d8ecb56a9fe 100644 --- a/samples/client/petstore/java/jersey2/README.md +++ b/samples/client/petstore/java/jersey2/README.md @@ -1,24 +1,35 @@ # swagger-petstore-jersey2 +Swagger Petstore +- API version: 1.0.0 + +This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + + +*Automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen)* + + ## Requirements -Building the API client library requires [Maven](https://maven.apache.org/) to be installed. +Building the API client library requires: +1. Java 1.7+ +2. Maven/Gradle ## Installation To install the API client library to your local Maven repository, simply execute: ```shell -mvn install +mvn clean install ``` To deploy it to a remote Maven repository instead, configure the settings of the repository and execute: ```shell -mvn deploy +mvn clean deploy ``` -Refer to the [official documentation](https://maven.apache.org/plugins/maven-deploy-plugin/usage.html) for more information. +Refer to the [OSSRH Guide](http://central.sonatype.org/pages/ossrh-guide.html) for more information. ### Maven users @@ -26,10 +37,10 @@ Add this dependency to your project's POM: ```xml - io.swagger - swagger-petstore-jersey2 - 1.0.0 - compile + io.swagger + swagger-petstore-jersey2 + 1.0.0 + compile ``` @@ -45,12 +56,14 @@ compile "io.swagger:swagger-petstore-jersey2:1.0.0" At first generate the JAR by executing: - mvn package +```shell +mvn clean package +``` Then manually install the following JARs: -* target/swagger-petstore-jersey2-1.0.0.jar -* target/lib/*.jar +* `target/swagger-petstore-jersey2-1.0.0.jar` +* `target/lib/*.jar` ## Getting Started @@ -95,6 +108,7 @@ Class | Method | HTTP request | Description *FakeApi* | [**fakeOuterCompositeSerialize**](docs/FakeApi.md#fakeOuterCompositeSerialize) | **POST** /fake/outer/composite | *FakeApi* | [**fakeOuterNumberSerialize**](docs/FakeApi.md#fakeOuterNumberSerialize) | **POST** /fake/outer/number | *FakeApi* | [**fakeOuterStringSerialize**](docs/FakeApi.md#fakeOuterStringSerialize) | **POST** /fake/outer/string | +*FakeApi* | [**testBodyWithQueryParams**](docs/FakeApi.md#testBodyWithQueryParams) | **PUT** /fake/body-with-query-params | *FakeApi* | [**testClientModel**](docs/FakeApi.md#testClientModel) | **PATCH** /fake | To test \"client\" model *FakeApi* | [**testEndpointParameters**](docs/FakeApi.md#testEndpointParameters) | **POST** /fake | Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 *FakeApi* | [**testEnumParameters**](docs/FakeApi.md#testEnumParameters) | **GET** /fake | To test enum parameters @@ -132,21 +146,27 @@ Class | Method | HTTP request | Description - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Ints](docs/Ints.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [Model200Response](docs/Model200Response.md) - [ModelApiResponse](docs/ModelApiResponse.md) + - [ModelBoolean](docs/ModelBoolean.md) + - [ModelList](docs/ModelList.md) - [ModelReturn](docs/ModelReturn.md) - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) + - [Numbers](docs/Numbers.md) - [Order](docs/Order.md) - [OuterComposite](docs/OuterComposite.md) - [OuterEnum](docs/OuterEnum.md) @@ -155,8 +175,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/java/jersey2/build.gradle b/samples/client/petstore/java/jersey2/build.gradle index 9bf97ddc448..d4ac8cccb40 100644 --- a/samples/client/petstore/java/jersey2/build.gradle +++ b/samples/client/petstore/java/jersey2/build.gradle @@ -93,8 +93,8 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" jersey_version = "2.29.1" junit_version = "4.12" } @@ -107,7 +107,7 @@ dependencies { compile "com.fasterxml.jackson.core:jackson-core:$jackson_version" compile "com.fasterxml.jackson.core:jackson-annotations:$jackson_version" compile "com.fasterxml.jackson.core:jackson-databind:$jackson_version" - compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version", + compile "com.github.joschi.jackson:jackson-datatype-threetenbp:$jackson_version" compile "com.brsanthu:migbase64:2.2" testCompile "junit:junit:$junit_version" } diff --git a/samples/client/petstore/java/jersey2/docs/ApiResponse.md b/samples/client/petstore/java/jersey2/docs/ApiResponse.md deleted file mode 100644 index 1c17767c2b7..00000000000 --- a/samples/client/petstore/java/jersey2/docs/ApiResponse.md +++ /dev/null @@ -1,12 +0,0 @@ - -# ApiResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **Integer** | | [optional] -**type** | **String** | | [optional] -**message** | **String** | | [optional] - - - diff --git a/samples/client/petstore/java/jersey2/docs/Fake_classname_tags123Api.md b/samples/client/petstore/java/jersey2/docs/Fake_classname_tags123Api.md deleted file mode 100644 index 56f7c9ea1ff..00000000000 --- a/samples/client/petstore/java/jersey2/docs/Fake_classname_tags123Api.md +++ /dev/null @@ -1,52 +0,0 @@ -# Fake_classname_tags123Api - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](Fake_classname_tags123Api.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.Fake_classname_tags123Api; - - -Fake_classname_tags123Api apiInstance = new Fake_classname_tags123Api(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling Fake_classname_tags123Api#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2/docs/FakeclassnametagsApi.md b/samples/client/petstore/java/jersey2/docs/FakeclassnametagsApi.md deleted file mode 100644 index f8ec0768e1f..00000000000 --- a/samples/client/petstore/java/jersey2/docs/FakeclassnametagsApi.md +++ /dev/null @@ -1,52 +0,0 @@ -# FakeclassnametagsApi - -All URIs are relative to *http://petstore.swagger.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**testClassname**](FakeclassnametagsApi.md#testClassname) | **PATCH** /fake_classname_test | To test class name in snake case - - - -# **testClassname** -> Client testClassname(body) - -To test class name in snake case - -### Example -```java -// Import classes: -//import io.swagger.client.ApiException; -//import io.swagger.client.api.FakeclassnametagsApi; - - -FakeclassnametagsApi apiInstance = new FakeclassnametagsApi(); -Client body = new Client(); // Client | client model -try { - Client result = apiInstance.testClassname(body); - System.out.println(result); -} catch (ApiException e) { - System.err.println("Exception when calling FakeclassnametagsApi#testClassname"); - e.printStackTrace(); -} -``` - -### Parameters - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **body** | [**Client**](Client.md)| client model | - -### Return type - -[**Client**](Client.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: application/json - - **Accept**: application/json - diff --git a/samples/client/petstore/java/jersey2/docs/InlineResponse200.md b/samples/client/petstore/java/jersey2/docs/InlineResponse200.md deleted file mode 100644 index 232cb0ed5c1..00000000000 --- a/samples/client/petstore/java/jersey2/docs/InlineResponse200.md +++ /dev/null @@ -1,13 +0,0 @@ -# InlineResponse200 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**photoUrls** | **List<String>** | | [optional] -**name** | **String** | | [optional] -**id** | **Long** | | -**category** | **Object** | | [optional] -**tags** | [**List<Tag>**](Tag.md) | | [optional] -**status** | **String** | pet status in the store | [optional] - - diff --git a/samples/client/petstore/java/jersey2/docs/Ints.md b/samples/client/petstore/java/jersey2/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/jersey2/docs/ModelBoolean.md b/samples/client/petstore/java/jersey2/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/jersey2/docs/ModelList.md b/samples/client/petstore/java/jersey2/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2/docs/Numbers.md b/samples/client/petstore/java/jersey2/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/jersey2/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/jersey2/pom.xml b/samples/client/petstore/java/jersey2/pom.xml index bf3b975ffcb..cdb6fbda482 100644 --- a/samples/client/petstore/java/jersey2/pom.xml +++ b/samples/client/petstore/java/jersey2/pom.xml @@ -262,10 +262,10 @@ UTF-8 - 1.5.18 + 1.5.24 2.29.1 2.6.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java index ba800f4230c..ecc171efc68 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/ApiClient.java @@ -24,6 +24,7 @@ import java.io.InputStream; import java.nio.file.Files; +import java.nio.file.Paths; import java.nio.file.StandardCopyOption; import org.glassfish.jersey.logging.LoggingFeature; import java.util.Collection; @@ -291,7 +292,7 @@ public ApiClient setConnectTimeout(int connectionTimeout) { public int getReadTimeout() { return readTimeout; } - + /** * Set the read timeout (in milliseconds). * A value of 0 means no timeout, otherwise values must be between 1 and @@ -617,9 +618,9 @@ public File prepareDownloadFile(Response response) throws IOException { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java index daefd52aed7..06ec271623f 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java index 18d50df62fb..a7ce02b7ac1 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java index dec431cf77e..6dd16b910dd 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java index 1c0816f7b08..d2ed608f202 100644 --- a/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java index 0e4979b2906..776b1dec2f3 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeApiTest.java @@ -19,6 +19,7 @@ import org.threeten.bp.LocalDate; import org.threeten.bp.OffsetDateTime; import io.swagger.client.model.OuterComposite; +import io.swagger.client.model.User; import org.junit.Test; import org.junit.Ignore; @@ -100,6 +101,23 @@ public void fakeOuterStringSerializeTest() throws ApiException { // TODO: test validations } + /** + * + * + * + * + * @throws ApiException + * if the Api call fails + */ + @Test + public void testBodyWithQueryParamsTest() throws ApiException { + User body = null; + String query = null; + api.testBodyWithQueryParams(body, query); + + // TODO: test validations + } + /** * To test \"client\" model * diff --git a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java index af5885aaddd..06147652aad 100644 --- a/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java +++ b/samples/client/petstore/java/jersey2/src/test/java/io/swagger/client/api/FakeClassnameTags123ApiTest.java @@ -35,7 +35,7 @@ public class FakeClassnameTags123ApiTest { /** * To test class name in snake case * - * + * To test class name in snake case * * @throws ApiException * if the Api call fails diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/.swagger-codegen/VERSION b/samples/client/petstore/java/okhttp-gson-parcelableModel/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt index 957ff482292..cd2a7a2ac2f 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/build.sbt @@ -13,8 +13,8 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "okhttp" % "2.7.5", "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", "com.google.code.gson" % "gson" % "2.8.1", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Ints.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelBoolean.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Numbers.md b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml index 364994983a0..93ba32a2d71 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/pom.xml @@ -237,13 +237,13 @@ 1.7 ${java.version} ${java.version} - 1.8.0 - 1.5.18 + 1.8.3 + 1.5.24 2.7.5 2.8.1 - 1.3.5 + 1.4.1 1.0.0 - 4.12 + 4.13.1 UTF-8 diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java index a82ca551679..741fc98962e 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/ApiClient.java @@ -28,6 +28,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.nio.file.Files; +import java.nio.file.Paths; import java.lang.reflect.Type; import java.net.URLConnection; import java.net.URLEncoder; @@ -811,9 +813,9 @@ public File prepareDownloadFile(Response response) throws IOException { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** @@ -963,7 +965,7 @@ public Call buildCall(String path, String method, List queryParams, List

queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java index 4f102f4f1e4..d01ed2daa62 100644 --- a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/EnumTest.java @@ -177,7 +177,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + int value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(String.valueOf(value)); } } @@ -227,7 +227,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + String value = jsonReader.nextString(); return EnumNumberEnum.fromValue(String.valueOf(value)); } } diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..7dcfb9dcd02 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,86 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; +import android.os.Parcelable; +import android.os.Parcel; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(Ints.Adapter.class) +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Ints enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Ints read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Ints.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..73aca766e6b --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,76 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; +import android.os.Parcelable; +import android.os.Parcel; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(ModelBoolean.Adapter.class) +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelBoolean enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelBoolean read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelBoolean.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..16c2ecf62e1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,119 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; +import android.os.Parcelable; +import android.os.Parcel; + +/** + * ModelList + */ + +public class ModelList implements Parcelable { + @SerializedName("123-list") + private String _123List = null; + + public ModelList() { + } + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + + + public void writeToParcel(Parcel out, int flags) { + out.writeValue(_123List); + } + + ModelList(Parcel in) { + _123List = (String)in.readValue(null); + } + + public int describeContents() { + return 0; + } + + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { + public ModelList createFromParcel(Parcel in) { + return new ModelList(in); + } + public ModelList[] newArray(int size) { + return new ModelList[size]; + } + }; +} + diff --git a/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..bffdca973bf --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson-parcelableModel/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,81 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.google.gson.annotations.SerializedName; +import android.os.Parcelable; +import android.os.Parcel; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * some number + */ +@JsonAdapter(Numbers.Adapter.class) +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Numbers enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Numbers read(final JsonReader jsonReader) throws IOException { + BigDecimal value = new BigDecimal(jsonReader.nextDouble()); + return Numbers.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/.swagger-codegen/VERSION b/samples/client/petstore/java/okhttp-gson/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/okhttp-gson/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/okhttp-gson/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/okhttp-gson/build.sbt b/samples/client/petstore/java/okhttp-gson/build.sbt index 957ff482292..cd2a7a2ac2f 100644 --- a/samples/client/petstore/java/okhttp-gson/build.sbt +++ b/samples/client/petstore/java/okhttp-gson/build.sbt @@ -13,8 +13,8 @@ lazy val root = (project in file(".")). "com.squareup.okhttp" % "okhttp" % "2.7.5", "com.squareup.okhttp" % "logging-interceptor" % "2.7.5", "com.google.code.gson" % "gson" % "2.8.1", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" ) diff --git a/samples/client/petstore/java/okhttp-gson/docs/Ints.md b/samples/client/petstore/java/okhttp-gson/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelBoolean.md b/samples/client/petstore/java/okhttp-gson/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/ModelList.md b/samples/client/petstore/java/okhttp-gson/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/okhttp-gson/docs/Numbers.md b/samples/client/petstore/java/okhttp-gson/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/okhttp-gson/pom.xml b/samples/client/petstore/java/okhttp-gson/pom.xml index 1fcb1aa43b2..0587f5818a5 100644 --- a/samples/client/petstore/java/okhttp-gson/pom.xml +++ b/samples/client/petstore/java/okhttp-gson/pom.xml @@ -230,13 +230,13 @@ 1.7 ${java.version} ${java.version} - 1.8.0 - 1.5.18 + 1.8.3 + 1.5.24 2.7.5 2.8.1 - 1.3.5 + 1.4.1 1.0.0 - 4.12 + 4.13.1 UTF-8 diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java index a82ca551679..741fc98962e 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/ApiClient.java @@ -28,6 +28,8 @@ import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.nio.file.Files; +import java.nio.file.Paths; import java.lang.reflect.Type; import java.net.URLConnection; import java.net.URLEncoder; @@ -811,9 +813,9 @@ public File prepareDownloadFile(Response response) throws IOException { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** @@ -963,7 +965,7 @@ public Call buildCall(String path, String method, List queryParams, List

queryParams, List collectionQueryParams, Object body, Map headerParams, Map formParams, String[] authNames, ProgressRequestBody.ProgressRequestListener progressRequestListener) throws ApiException { diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java index 7a1b9c32152..cb948f2ad54 100644 --- a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/EnumTest.java @@ -175,7 +175,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + int value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(String.valueOf(value)); } } @@ -225,7 +225,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + String value = jsonReader.nextString(); return EnumNumberEnum.fromValue(String.valueOf(value)); } } diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..b615fd3bc7f --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,84 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(Ints.Adapter.class) +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Ints enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Ints read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Ints.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..a579dfae766 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,74 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(ModelBoolean.Adapter.class) +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelBoolean enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelBoolean read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelBoolean.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..58381513570 --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ + +public class ModelList { + @SerializedName("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..47cadd1886d --- /dev/null +++ b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,79 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * some number + */ +@JsonAdapter(Numbers.Adapter.class) +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Numbers enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Numbers read(final JsonReader jsonReader) throws IOException { + BigDecimal value = new BigDecimal(jsonReader.nextDouble()); + return Numbers.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java index b47a146d737..d55b84868a5 100644 --- a/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/okhttp-gson/src/test/java/io/swagger/client/api/UserApiTest.java @@ -63,7 +63,7 @@ public void testLoginUser() throws Exception { api.createUser(user); String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + assertTrue(token.contains("logged in user session:")); } @Test diff --git a/samples/client/petstore/java/rest-assured/.swagger-codegen/VERSION b/samples/client/petstore/java/rest-assured/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/rest-assured/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/rest-assured/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/rest-assured/build.gradle b/samples/client/petstore/java/rest-assured/build.gradle index 45a01cf9789..fb5809920f4 100644 --- a/samples/client/petstore/java/rest-assured/build.gradle +++ b/samples/client/petstore/java/rest-assured/build.gradle @@ -99,7 +99,7 @@ ext { junit_version = "4.12" gson_version = "2.6.1" gson_fire_version = "1.8.2" - threetenbp_version = "1.3.5" + threetenbp_version = "1.4.1" okio_version = "1.13.0" } diff --git a/samples/client/petstore/java/rest-assured/build.sbt b/samples/client/petstore/java/rest-assured/build.sbt index 8147094612b..d0a4e112690 100644 --- a/samples/client/petstore/java/rest-assured/build.sbt +++ b/samples/client/petstore/java/rest-assured/build.sbt @@ -13,7 +13,7 @@ lazy val root = (project in file(".")). "io.rest-assured" % "scala-support" % "3.1.0", "com.google.code.gson" % "gson" % "2.6.1", "io.gsonfire" % "gson-fire" % "1.8.2" % "compile", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", "com.squareup.okio" % "okio" % "1.13.0" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.10" % "test" diff --git a/samples/client/petstore/java/rest-assured/docs/Ints.md b/samples/client/petstore/java/rest-assured/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/rest-assured/docs/ModelBoolean.md b/samples/client/petstore/java/rest-assured/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/rest-assured/docs/ModelList.md b/samples/client/petstore/java/rest-assured/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/rest-assured/docs/Numbers.md b/samples/client/petstore/java/rest-assured/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/rest-assured/pom.xml b/samples/client/petstore/java/rest-assured/pom.xml index b4e1a0b9b93..034dcfe9d61 100644 --- a/samples/client/petstore/java/rest-assured/pom.xml +++ b/samples/client/petstore/java/rest-assured/pom.xml @@ -244,8 +244,8 @@ 2.6.1 1.8.2 1.0.0 - 1.3.5 + 1.4.1 1.13.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java index 7a1b9c32152..cb948f2ad54 100644 --- a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/EnumTest.java @@ -175,7 +175,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + int value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(String.valueOf(value)); } } @@ -225,7 +225,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + String value = jsonReader.nextString(); return EnumNumberEnum.fromValue(String.valueOf(value)); } } diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..b615fd3bc7f --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,84 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(Ints.Adapter.class) +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Ints enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Ints read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Ints.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..a579dfae766 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,74 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(ModelBoolean.Adapter.class) +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelBoolean enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelBoolean read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelBoolean.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..58381513570 --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ + +public class ModelList { + @SerializedName("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..47cadd1886d --- /dev/null +++ b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,79 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * some number + */ +@JsonAdapter(Numbers.Adapter.class) +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Numbers enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Numbers read(final JsonReader jsonReader) throws IOException { + BigDecimal value = new BigDecimal(jsonReader.nextDouble()); + return Numbers.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION b/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resteasy/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resteasy/build.gradle b/samples/client/petstore/java/resteasy/build.gradle index 9edf2abc8d6..184525d1c3b 100644 --- a/samples/client/petstore/java/resteasy/build.gradle +++ b/samples/client/petstore/java/resteasy/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.8" - jackson_version = "2.10.1" + jackson_version = "2.11.4" threetenbp_version = "2.6.4" jersey_version = "2.22.2" resteasy_version = "3.1.3.Final" diff --git a/samples/client/petstore/java/resteasy/build.sbt b/samples/client/petstore/java/resteasy/build.sbt index df074ed7513..64f803d34dc 100644 --- a/samples/client/petstore/java/resteasy/build.sbt +++ b/samples/client/petstore/java/resteasy/build.sbt @@ -13,10 +13,10 @@ lazy val root = (project in file(".")). "org.glassfish.jersey.core" % "jersey-client" % "2.22.2", "org.glassfish.jersey.media" % "jersey-media-multipart" % "2.22.2", "org.glassfish.jersey.media" % "jersey-media-json-jackson" % "2.22.2", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1", - "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.10.1", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4", + "com.fasterxml.jackson.datatype" % "jackson-datatype-joda" % "2.11.4", "joda-time" % "joda-time" % "2.9.4", "com.brsanthu" % "migbase64" % "2.2", "junit" % "junit" % "4.12" % "test", diff --git a/samples/client/petstore/java/resteasy/docs/Ints.md b/samples/client/petstore/java/resteasy/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/resteasy/docs/ModelBoolean.md b/samples/client/petstore/java/resteasy/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/resteasy/docs/ModelList.md b/samples/client/petstore/java/resteasy/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resteasy/docs/Numbers.md b/samples/client/petstore/java/resteasy/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/resteasy/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/resteasy/pom.xml b/samples/client/petstore/java/resteasy/pom.xml index e0463febda4..8776779d2d1 100644 --- a/samples/client/petstore/java/resteasy/pom.xml +++ b/samples/client/petstore/java/resteasy/pom.xml @@ -208,12 +208,12 @@ UTF-8 - 1.5.18 + 1.5.24 3.1.3.Final - 2.10.1 + 2.11.4 2.6.4 - 2.9.9 + 2.10.5 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java index 438e49fb15d..f76571e01ba 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/ApiClient.java @@ -8,6 +8,7 @@ import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.nio.file.Files; +import java.nio.file.Paths; import java.text.DateFormat; import java.text.SimpleDateFormat; import java.util.ArrayList; @@ -447,7 +448,7 @@ public String escapeString(String str) { public Entity serialize(Object obj, Map formParams, String contentType) throws ApiException { Entity entity = null; if (contentType.startsWith("multipart/form-data")) { - MultipartFormDataOutput multipart = new MultipartFormDataOutput(); + MultipartFormDataOutput multipart = new MultipartFormDataOutput(); //MultiPart multiPart = new MultiPart(); for (Entry param: formParams.entrySet()) { if (param.getValue() instanceof File) { @@ -547,9 +548,9 @@ public File prepareDownloadFile(Response response) throws IOException { } if (tempFolderPath == null) - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); else - return File.createTempFile(prefix, suffix, new File(tempFolderPath)); + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java index daefd52aed7..06ec271623f 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java index 18d50df62fb..a7ce02b7ac1 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java index dec431cf77e..6dd16b910dd 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java index 1c0816f7b08..d2ed608f202 100644 --- a/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION b/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate-withXml/build.gradle b/samples/client/petstore/java/resttemplate-withXml/build.gradle index e96838255ec..413d5176d2f 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -35,7 +35,7 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -51,7 +51,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -63,12 +63,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -86,7 +86,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = 'swagger-pestore-resttemplate-withxml' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath @@ -94,10 +94,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" spring_web_version = "4.3.9.RELEASE" - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" junit_version = "4.12" jackson_threeten_version = "2.6.4" } diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Ints.md b/samples/client/petstore/java/resttemplate-withXml/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/List.md b/samples/client/petstore/java/resttemplate-withXml/docs/List.md new file mode 100644 index 00000000000..a96936fbf3f --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/List.md @@ -0,0 +1,10 @@ + +# List + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelBoolean.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/docs/Numbers.md b/samples/client/petstore/java/resttemplate-withXml/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/resttemplate-withXml/pom.xml b/samples/client/petstore/java/resttemplate-withXml/pom.xml index c51e2c12043..25f133e2e8d 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -258,9 +258,9 @@ UTF-8 1.5.17 4.3.9.RELEASE - 2.10.1 + 2.11.4 2.6.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java index a8f80a6e988..6f6b72e1eb6 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumArrays.java @@ -58,9 +58,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -98,9 +98,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java index 7bf51521a58..195352b5c63 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumClass.java @@ -49,9 +49,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java index 08d817e1952..d5fda240371 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/EnumTest.java @@ -59,9 +59,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -101,9 +101,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -141,9 +141,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -181,9 +181,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..4f04d6fff71 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,70 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java index b66f1b804db..6f37f9cb55e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/MapTest.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..4c4d71925a6 --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..c58b70d69aa --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,98 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +/** + * ModelList + */ + +@XmlRootElement(name = "ModelList") +@XmlAccessorType(XmlAccessType.FIELD) +@JacksonXmlRootElement(localName = "ModelList") +public class ModelList { + @JsonProperty("123-list") + @JacksonXmlProperty(localName = "123-list") + @XmlElement(name = "123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..8ddc7b4beec --- /dev/null +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,65 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.dataformat.xml.annotation.*; +import javax.xml.bind.annotation.*; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java index 9ca6b9ea95c..515d3823dfd 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Order.java @@ -79,9 +79,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java index 428fb42ddad..a9b0999634e 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/OuterEnum.java @@ -49,9 +49,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java index c6a818a8b35..bcc133ed3ad 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Pet.java @@ -52,7 +52,8 @@ public class Pet { @JsonProperty("photoUrls") // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrls") + @JacksonXmlElementWrapper(useWrapping = true, localName = "photoUrl") + @JacksonXmlProperty(localName = "photoUrls") // Is a container wrapped=true // items.name=photoUrls items.baseName=photoUrls items.xmlName= items.xmlNamespace= // items.example= items.type=String @@ -62,7 +63,8 @@ public class Pet { @JsonProperty("tags") // items.xmlName= - @JacksonXmlElementWrapper(useWrapping = true, localName = "tags") + @JacksonXmlElementWrapper(useWrapping = true, localName = "tag") + @JacksonXmlProperty(localName = "tags") // Is a container wrapped=true // items.name=tags items.baseName=tags items.xmlName= items.xmlNamespace= // items.example= items.type=Tag @@ -97,9 +99,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION b/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION index bba5a87afd0..8c7754221a4 100644 --- a/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.9-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/resttemplate/build.gradle b/samples/client/petstore/java/resttemplate/build.gradle index 24574c275c0..d361efd6be6 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -23,7 +23,7 @@ if(hasProperty('target') && target == 'android') { apply plugin: 'com.android.library' apply plugin: 'com.github.dcendents.android-maven' - + android { compileSdkVersion 23 buildToolsVersion '23.0.2' @@ -35,7 +35,7 @@ if(hasProperty('target') && target == 'android') { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } - + // Rename the aar correctly libraryVariants.all { variant -> variant.outputs.each { output -> @@ -51,7 +51,7 @@ if(hasProperty('target') && target == 'android') { provided 'javax.annotation:jsr250-api:1.0' } } - + afterEvaluate { android.libraryVariants.all { variant -> def task = project.tasks.create "jar${variant.name.capitalize()}", Jar @@ -63,12 +63,12 @@ if(hasProperty('target') && target == 'android') { artifacts.add('archives', task); } } - + task sourcesJar(type: Jar) { from android.sourceSets.main.java.srcDirs classifier = 'sources' } - + artifacts { archives sourcesJar } @@ -86,7 +86,7 @@ if(hasProperty('target') && target == 'android') { pom.artifactId = 'swagger-petstore-resttemplate' } } - + task execute(type:JavaExec) { main = System.getProperty('mainClass') classpath = sourceSets.main.runtimeClasspath @@ -94,10 +94,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" - jackson_version = "2.10.1" + swagger_annotations_version = "1.5.24" + jackson_version = "2.11.4" spring_web_version = "4.3.9.RELEASE" - jodatime_version = "2.9.9" + jodatime_version = "2.10.5" junit_version = "4.12" jackson_threeten_version = "2.6.4" } diff --git a/samples/client/petstore/java/resttemplate/docs/Ints.md b/samples/client/petstore/java/resttemplate/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/resttemplate/docs/ModelBoolean.md b/samples/client/petstore/java/resttemplate/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/resttemplate/docs/ModelList.md b/samples/client/petstore/java/resttemplate/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/resttemplate/docs/Numbers.md b/samples/client/petstore/java/resttemplate/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/resttemplate/pom.xml b/samples/client/petstore/java/resttemplate/pom.xml index 58196a10475..3e508cfeea6 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -250,9 +250,9 @@ UTF-8 1.5.17 4.3.9.RELEASE - 2.10.1 + 2.11.4 2.6.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java index daefd52aed7..06ec271623f 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java index 18d50df62fb..a7ce02b7ac1 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java index dec431cf77e..6dd16b910dd 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java index 1c0816f7b08..d2ed608f202 100644 --- a/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java index c7fb92d2552..908f6e82e07 100644 --- a/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/resttemplate/src/test/java/io/swagger/client/api/UserApiTest.java @@ -64,7 +64,7 @@ public void testLoginUser() throws Exception { api.createUser(user); String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + assertTrue(token.contains("logged in user session:")); } @Test diff --git a/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit/pom.xml b/samples/client/petstore/java/retrofit/pom.xml index f71111ea7f9..965cffca64c 100644 --- a/samples/client/petstore/java/retrofit/pom.xml +++ b/samples/client/petstore/java/retrofit/pom.xml @@ -234,12 +234,12 @@ UTF-8 - 1.5.18 + 1.5.24 1.9.0 2.7.5 - 2.9.9 + 2.10.5 1.0.1 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java index 7a1b9c32152..cb948f2ad54 100644 --- a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/EnumTest.java @@ -175,7 +175,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + int value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(String.valueOf(value)); } } @@ -225,7 +225,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + String value = jsonReader.nextString(); return EnumNumberEnum.fromValue(String.valueOf(value)); } } diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..b615fd3bc7f --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,84 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(Ints.Adapter.class) +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Ints enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Ints read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Ints.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..a579dfae766 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,74 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(ModelBoolean.Adapter.class) +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelBoolean enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelBoolean read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelBoolean.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..58381513570 --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ + +public class ModelList { + @SerializedName("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..47cadd1886d --- /dev/null +++ b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,79 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * some number + */ +@JsonAdapter(Numbers.Adapter.class) +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Numbers enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Numbers read(final JsonReader jsonReader) throws IOException { + BigDecimal value = new BigDecimal(jsonReader.nextDouble()); + return Numbers.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java index 84fae0e990f..45e9cd35190 100644 --- a/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit/src/test/java/io/swagger/client/api/UserApiTest.java @@ -61,7 +61,7 @@ public void testLoginUser() throws Exception { api.createUser(user); String token = api.loginUser(user.getUsername(), user.getPassword()); - assertTrue(token.startsWith("logged in user session:")); + assertTrue(token.contains("logged in user session:")); } @Test diff --git a/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2-play24/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 90dd0fa0176..a0aa888697a 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -88,19 +88,19 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath } } ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" - jackson_version = "2.10.1" + retrofit_version = "2.7.1" + jackson_version = "2.11.4" play_version = "2.4.11" - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" junit_version = "4.12" - json_fire_version = "1.8.0" + json_fire_version = "1.8.3" } dependencies { diff --git a/samples/client/petstore/java/retrofit2-play24/build.sbt b/samples/client/petstore/java/retrofit2-play24/build.sbt index 37c69c7cc9c..ef5a4312e27 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.sbt +++ b/samples/client/petstore/java/retrofit2-play24/build.sbt @@ -1,25 +1,25 @@ lazy val root = (project in file(".")). - settings( - organization := "io.swagger", - name := "swagger-java-client", - version := "1.0.0", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", - "com.typesafe.play" % "play-java-ws_2.11" % "2.4.11" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", - "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.17" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", - "junit" % "junit" % "4.12" % "test", - "com.novocode" % "junit-interface" % "0.11" % "test" - ) + settings( + organization := "io.swagger", + name := "swagger-java-client", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "com.squareup.retrofit2" % "retrofit" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.7.1" % "compile", + "com.typesafe.play" % "play-java-ws_2.11" % "2.4.11" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", + "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "junit" % "junit" % "4.12" % "test", + "com.novocode" % "junit-interface" % "0.11" % "test" ) + ) diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Ints.md b/samples/client/petstore/java/retrofit2-play24/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ModelBoolean.md b/samples/client/petstore/java/retrofit2-play24/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/ModelList.md b/samples/client/petstore/java/retrofit2-play24/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2-play24/docs/Numbers.md b/samples/client/petstore/java/retrofit2-play24/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index e03677f9467..d2340d18c87 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -115,7 +115,7 @@ - src/main/java + src/main/java @@ -128,7 +128,7 @@ - src/test/java + src/test/java @@ -225,37 +225,37 @@ ${gson-fire-version} - - - com.squareup.retrofit2 - converter-jackson - ${retrofit-version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.typesafe.play - play-java-ws_2.11 - ${play-version} - + + + com.squareup.retrofit2 + converter-jackson + ${retrofit-version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.typesafe.play + play-java-ws_2.11 + ${play-version} + @@ -271,12 +271,12 @@ 1.8 ${java.version} ${java.version} - 1.8.0 - 1.5.18 - 2.10.1 - 2.4.11 - 2.3.0 + 1.8.3 + 1.5.24 + 2.11.4 + 2.4.11 + 2.7.1 1.0.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallFactory.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallFactory.java index ab1fa035c87..5ecea4240b8 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallFactory.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/Play24CallFactory.java @@ -3,6 +3,7 @@ import okhttp3.*; import okio.Buffer; import okio.BufferedSource; +import okio.Timeout; import play.libs.F; import play.libs.ws.WSClient; import play.libs.ws.WSRequest; @@ -97,6 +98,10 @@ public Request request() { return request; } + public Timeout timeout() { + return null; + } + @Override public void enqueue(final okhttp3.Callback responseCallback) { final Call call = this; diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java index 3e83a66d712..0c89112b85f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumArrays.java @@ -55,9 +55,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -93,9 +93,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java index 3a95df2b49e..d3faa979cc1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumClass.java @@ -49,9 +49,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java index d0cfaa66374..52ef9b9e48f 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/EnumTest.java @@ -56,9 +56,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -96,9 +96,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -134,9 +134,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -172,9 +172,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..8deb9672ce4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,70 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java index 21f85f08021..f60d0540200 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/MapTest.java @@ -59,9 +59,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..509ed57fc87 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..968687257ae --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,93 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..82fdb565641 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,65 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java index 26dccbe5417..3b6ae07ef61 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Order.java @@ -68,9 +68,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java index 2f7b2171652..2e5703f7307 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/OuterEnum.java @@ -49,9 +49,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java index db153aadaa6..881f17aaef1 100644 --- a/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play24/src/main/java/io/swagger/client/model/Pet.java @@ -74,9 +74,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2-play25/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index e27eeb884fd..0118ff105fd 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -88,20 +88,20 @@ if(hasProperty('target') && target == 'android') { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath } } ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" - jackson_version = "2.10.1" + retrofit_version = "2.7.1" + jackson_version = "2.11.4" play_version = "2.5.14" - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" junit_version = "4.12" - threetenbp_version = "1.3.5" - json_fire_version = "1.8.0" + threetenbp_version = "1.4.1" + json_fire_version = "1.8.3" } dependencies { diff --git a/samples/client/petstore/java/retrofit2-play25/build.sbt b/samples/client/petstore/java/retrofit2-play25/build.sbt index b92ac33f1fe..f54cec1cad2 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -1,26 +1,26 @@ lazy val root = (project in file(".")). - settings( - organization := "io.swagger", - name := "swagger-java-client", - version := "1.0.0", - scalaVersion := "2.11.4", - scalacOptions ++= Seq("-feature"), - javacOptions in compile ++= Seq("-Xlint:deprecation"), - publishArtifact in (Compile, packageDoc) := false, - resolvers += Resolver.mavenLocal, - libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", - "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", - "com.fasterxml.jackson.core" % "jackson-core" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-annotations" % "2.10.1" % "compile", - "com.fasterxml.jackson.core" % "jackson-databind" % "2.10.1" % "compile", - "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.17" % "compile", - "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", - "junit" % "junit" % "4.12" % "test", - "com.novocode" % "junit-interface" % "0.11" % "test" - ) + settings( + organization := "io.swagger", + name := "swagger-java-client", + version := "1.0.0", + scalaVersion := "2.11.4", + scalacOptions ++= Seq("-feature"), + javacOptions in compile ++= Seq("-Xlint:deprecation"), + publishArtifact in (Compile, packageDoc) := false, + resolvers += Resolver.mavenLocal, + libraryDependencies ++= Seq( + "com.squareup.retrofit2" % "retrofit" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.7.1" % "compile", + "com.typesafe.play" % "play-java-ws_2.11" % "2.5.15" % "compile", + "com.fasterxml.jackson.core" % "jackson-core" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-annotations" % "2.11.4" % "compile", + "com.fasterxml.jackson.core" % "jackson-databind" % "2.11.4" % "compile", + "com.squareup.retrofit2" % "converter-jackson" % "2.3.0" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", + "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", + "junit" % "junit" % "4.12" % "test", + "com.novocode" % "junit-interface" % "0.11" % "test" ) + ) diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Ints.md b/samples/client/petstore/java/retrofit2-play25/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ModelBoolean.md b/samples/client/petstore/java/retrofit2-play25/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/ModelList.md b/samples/client/petstore/java/retrofit2-play25/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2-play25/docs/Numbers.md b/samples/client/petstore/java/retrofit2-play25/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/retrofit2-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index bab629d1f45..5832d53e629 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -115,7 +115,7 @@ - src/main/java + src/main/java @@ -128,7 +128,7 @@ - src/test/java + src/test/java @@ -224,43 +224,43 @@ gson-fire ${gson-fire-version} - - org.threeten - threetenbp - ${threetenbp-version} - + + org.threeten + threetenbp + ${threetenbp-version} + - - - com.squareup.retrofit2 - converter-jackson - ${retrofit-version} - - - com.fasterxml.jackson.core - jackson-core - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-annotations - ${jackson-version} - - - com.fasterxml.jackson.core - jackson-databind - ${jackson-version} - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.typesafe.play - play-java-ws_2.11 - ${play-version} - + + + com.squareup.retrofit2 + converter-jackson + ${retrofit-version} + + + com.fasterxml.jackson.core + jackson-core + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-annotations + ${jackson-version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.typesafe.play + play-java-ws_2.11 + ${play-version} + @@ -276,13 +276,13 @@ 1.8 ${java.version} ${java.version} - 1.8.0 - 1.5.18 - 2.10.1 - 2.5.15 - 2.3.0 - 1.3.5 + 1.8.3 + 1.5.24 + 2.11.4 + 2.5.15 + 2.7.1 + 1.4.1 1.0.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java index ba5434f53f2..8de782c5dd8 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/Play25CallFactory.java @@ -3,6 +3,7 @@ import okhttp3.*; import okio.Buffer; import okio.BufferedSource; +import okio.Timeout; import play.libs.ws.WSClient; import play.libs.ws.WSRequest; import play.libs.ws.WSResponse; @@ -32,7 +33,7 @@ public class Play25CallFactory implements okhttp3.Call.Factory { /** Extra query parameters to add to request */ private List extraQueryParams = new ArrayList<>(); - + /** Filters (interceptors) */ private List filters = new ArrayList<>(); @@ -108,6 +109,10 @@ public Request request() { return request; } + public Timeout timeout() { + return null; + } + @Override public void enqueue(final okhttp3.Callback responseCallback) { final Call call = this; @@ -189,7 +194,7 @@ public BufferedSource source() { } }); - + for (Map.Entry> entry : r.getAllHeaders().entrySet()) { for (String value : entry.getValue()) { builder.addHeader(entry.getKey(), value); diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java index 3e83a66d712..0c89112b85f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumArrays.java @@ -55,9 +55,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -93,9 +93,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java index 3a95df2b49e..d3faa979cc1 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumClass.java @@ -49,9 +49,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java index d0cfaa66374..52ef9b9e48f 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/EnumTest.java @@ -56,9 +56,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -96,9 +96,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -134,9 +134,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -172,9 +172,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..8deb9672ce4 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,70 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java index 21f85f08021..f60d0540200 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/MapTest.java @@ -59,9 +59,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..509ed57fc87 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..968687257ae --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,93 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..82fdb565641 --- /dev/null +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,65 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java index 985fecd2590..1353d58ac72 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Order.java @@ -68,9 +68,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java index 2f7b2171652..2e5703f7307 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/OuterEnum.java @@ -49,9 +49,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java index db153aadaa6..881f17aaef1 100644 --- a/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/retrofit2-play25/src/main/java/io/swagger/client/model/Pet.java @@ -74,9 +74,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2/build.gradle b/samples/client/petstore/java/retrofit2/build.gradle index bcbaf119988..2e8e60c9a3f 100644 --- a/samples/client/petstore/java/retrofit2/build.gradle +++ b/samples/client/petstore/java/retrofit2/build.gradle @@ -95,11 +95,11 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" - swagger_annotations_version = "1.5.17" + retrofit_version = "2.7.1" + swagger_annotations_version = "1.5.24" junit_version = "4.12" - threetenbp_version = "1.3.5" - json_fire_version = "1.8.0" + threetenbp_version = "1.4.1" + json_fire_version = "1.8.3" } dependencies { diff --git a/samples/client/petstore/java/retrofit2/build.sbt b/samples/client/petstore/java/retrofit2/build.sbt index 4513bfe6a5d..d2c7eb2c27a 100644 --- a/samples/client/petstore/java/retrofit2/build.sbt +++ b/samples/client/petstore/java/retrofit2/build.sbt @@ -9,13 +9,13 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.17" % "compile", + "com.squareup.retrofit2" % "retrofit" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.7.1" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) diff --git a/samples/client/petstore/java/retrofit2/docs/Ints.md b/samples/client/petstore/java/retrofit2/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelBoolean.md b/samples/client/petstore/java/retrofit2/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/retrofit2/docs/ModelList.md b/samples/client/petstore/java/retrofit2/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2/docs/Numbers.md b/samples/client/petstore/java/retrofit2/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/retrofit2/pom.xml b/samples/client/petstore/java/retrofit2/pom.xml index 8aeb47c55b5..55e676a2b76 100644 --- a/samples/client/petstore/java/retrofit2/pom.xml +++ b/samples/client/petstore/java/retrofit2/pom.xml @@ -245,11 +245,11 @@ 1.7 ${java.version} ${java.version} - 1.8.0 - 1.5.18 - 2.3.0 - 1.3.5 + 1.8.3 + 1.5.24 + 2.7.1 + 1.4.1 1.0.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java index 7a1b9c32152..cb948f2ad54 100644 --- a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/EnumTest.java @@ -175,7 +175,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + int value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(String.valueOf(value)); } } @@ -225,7 +225,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + String value = jsonReader.nextString(); return EnumNumberEnum.fromValue(String.valueOf(value)); } } diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..b615fd3bc7f --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,84 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(Ints.Adapter.class) +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Ints enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Ints read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Ints.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..a579dfae766 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,74 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(ModelBoolean.Adapter.class) +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelBoolean enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelBoolean read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelBoolean.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..58381513570 --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ + +public class ModelList { + @SerializedName("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..47cadd1886d --- /dev/null +++ b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,79 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * some number + */ +@JsonAdapter(Numbers.Adapter.class) +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Numbers enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Numbers read(final JsonReader jsonReader) throws IOException { + BigDecimal value = new BigDecimal(jsonReader.nextDouble()); + return Numbers.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java index 70fbb8fef98..a442b254d6e 100644 --- a/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java +++ b/samples/client/petstore/java/retrofit2/src/test/java/io/swagger/client/api/UserApiTest.java @@ -27,7 +27,7 @@ public void testCreateUser() throws Exception { api.createUser(user).execute(); User fetched = api.getUserByName(user.getUsername()).execute().body(); - assertEquals(user.getId(), fetched.getId()); + assertEquals(user.getUsername(), fetched.getUsername()); } @Test @@ -62,7 +62,7 @@ public void testLoginUser() throws Exception { api.createUser(user).execute(); String token = api.loginUser(user.getUsername(), user.getPassword()).execute().body(); - assertTrue(token.startsWith("logged in user session:")); + assertTrue(token.contains("logged in user session:")); } @Test diff --git a/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx/build.gradle b/samples/client/petstore/java/retrofit2rx/build.gradle index 43f0fcbe3e3..7eb143ad1e8 100644 --- a/samples/client/petstore/java/retrofit2rx/build.gradle +++ b/samples/client/petstore/java/retrofit2rx/build.gradle @@ -95,12 +95,12 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" - swagger_annotations_version = "1.5.17" + retrofit_version = "2.7.1" + swagger_annotations_version = "1.5.24" junit_version = "4.12" rx_java_version = "1.3.0" - threetenbp_version = "1.3.5" - json_fire_version = "1.8.0" + threetenbp_version = "1.4.1" + json_fire_version = "1.8.3" } dependencies { diff --git a/samples/client/petstore/java/retrofit2rx/build.sbt b/samples/client/petstore/java/retrofit2rx/build.sbt index b0c73c5aeaf..bd7c59ea292 100644 --- a/samples/client/petstore/java/retrofit2rx/build.sbt +++ b/samples/client/petstore/java/retrofit2rx/build.sbt @@ -9,15 +9,15 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "retrofit" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.7.1" % "compile", "com.squareup.retrofit2" % "adapter-rxjava" % "2.3.0" % "compile", "io.reactivex" % "rxjava" % "1.3.0" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.17" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) diff --git a/samples/client/petstore/java/retrofit2rx/docs/Ints.md b/samples/client/petstore/java/retrofit2rx/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ModelBoolean.md b/samples/client/petstore/java/retrofit2rx/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/ModelList.md b/samples/client/petstore/java/retrofit2rx/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx/docs/Numbers.md b/samples/client/petstore/java/retrofit2rx/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/retrofit2rx/pom.xml b/samples/client/petstore/java/retrofit2rx/pom.xml index 92c39cffb45..c846b627923 100644 --- a/samples/client/petstore/java/retrofit2rx/pom.xml +++ b/samples/client/petstore/java/retrofit2rx/pom.xml @@ -255,12 +255,12 @@ 1.7 ${java.version} ${java.version} - 1.8.0 - 1.5.18 - 2.3.0 + 1.8.3 + 1.5.24 + 2.7.1 1.3.0 - 1.3.5 + 1.4.1 1.0.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java index 7a1b9c32152..cb948f2ad54 100644 --- a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/EnumTest.java @@ -175,7 +175,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + int value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(String.valueOf(value)); } } @@ -225,7 +225,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + String value = jsonReader.nextString(); return EnumNumberEnum.fromValue(String.valueOf(value)); } } diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..b615fd3bc7f --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,84 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(Ints.Adapter.class) +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Ints enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Ints read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Ints.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..a579dfae766 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,74 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(ModelBoolean.Adapter.class) +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelBoolean enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelBoolean read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelBoolean.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..58381513570 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ + +public class ModelList { + @SerializedName("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..47cadd1886d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,79 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * some number + */ +@JsonAdapter(Numbers.Adapter.class) +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Numbers enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Numbers read(final JsonReader jsonReader) throws IOException { + BigDecimal value = new BigDecimal(jsonReader.nextDouble()); + return Numbers.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java index 330504b6bd8..971c32a599c 100644 --- a/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java +++ b/samples/client/petstore/java/retrofit2rx/src/test/java/io/swagger/client/api/PetApiTest.java @@ -7,6 +7,7 @@ import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; +import java.nio.file.Files; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -192,7 +193,7 @@ public void onError(Throwable e) { @Test public void testUploadFile() throws Exception { - File file = File.createTempFile("test", "hello.txt"); + File file = Files.createTempFile("test", "hello.txt").toFile(); BufferedWriter writer = new BufferedWriter(new FileWriter(file)); writer.write("Hello world!"); diff --git a/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/retrofit2rx2/build.gradle b/samples/client/petstore/java/retrofit2rx2/build.gradle index 2e0e6d3aa2c..8292c9be899 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.gradle +++ b/samples/client/petstore/java/retrofit2rx2/build.gradle @@ -95,12 +95,12 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" - swagger_annotations_version = "1.5.17" + retrofit_version = "2.7.1" + swagger_annotations_version = "1.5.24" junit_version = "4.12" rx_java_version = "2.1.1" - threetenbp_version = "1.3.5" - json_fire_version = "1.8.0" + threetenbp_version = "1.4.1" + json_fire_version = "1.8.3" } dependencies { diff --git a/samples/client/petstore/java/retrofit2rx2/build.sbt b/samples/client/petstore/java/retrofit2rx2/build.sbt index 7cd73d96695..c50287e9d7b 100644 --- a/samples/client/petstore/java/retrofit2rx2/build.sbt +++ b/samples/client/petstore/java/retrofit2rx2/build.sbt @@ -9,15 +9,15 @@ lazy val root = (project in file(".")). publishArtifact in (Compile, packageDoc) := false, resolvers += Resolver.mavenLocal, libraryDependencies ++= Seq( - "com.squareup.retrofit2" % "retrofit" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-scalars" % "2.3.0" % "compile", - "com.squareup.retrofit2" % "converter-gson" % "2.3.0" % "compile", + "com.squareup.retrofit2" % "retrofit" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-scalars" % "2.7.1" % "compile", + "com.squareup.retrofit2" % "converter-gson" % "2.7.1" % "compile", "com.squareup.retrofit2" % "adapter-rxjava2" % "2.3.0" % "compile", "io.reactivex.rxjava2" % "rxjava" % "2.1.1" % "compile", - "io.swagger" % "swagger-annotations" % "1.5.17" % "compile", + "io.swagger" % "swagger-annotations" % "1.5.24" % "compile", "org.apache.oltu.oauth2" % "org.apache.oltu.oauth2.client" % "1.0.1" % "compile", - "org.threeten" % "threetenbp" % "1.3.5" % "compile", - "io.gsonfire" % "gson-fire" % "1.8.0" % "compile", + "org.threeten" % "threetenbp" % "1.4.1" % "compile", + "io.gsonfire" % "gson-fire" % "1.8.3" % "compile", "junit" % "junit" % "4.12" % "test", "com.novocode" % "junit-interface" % "0.11" % "test" ) diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Ints.md b/samples/client/petstore/java/retrofit2rx2/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelBoolean.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md b/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/retrofit2rx2/docs/Numbers.md b/samples/client/petstore/java/retrofit2rx2/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/retrofit2rx2/pom.xml b/samples/client/petstore/java/retrofit2rx2/pom.xml index 6b2cc2ac838..e95486dc188 100644 --- a/samples/client/petstore/java/retrofit2rx2/pom.xml +++ b/samples/client/petstore/java/retrofit2rx2/pom.xml @@ -255,12 +255,12 @@ 1.7 ${java.version} ${java.version} - 1.8.0 - 1.5.18 - 2.3.0 + 1.8.3 + 1.5.24 + 2.7.1 2.1.1 - 1.3.5 + 1.4.1 1.0.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java index 7a1b9c32152..cb948f2ad54 100644 --- a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/EnumTest.java @@ -175,7 +175,7 @@ public void write(final JsonWriter jsonWriter, final EnumIntegerEnum enumeration @Override public EnumIntegerEnum read(final JsonReader jsonReader) throws IOException { - Integer value = jsonReader.nextInt(); + int value = jsonReader.nextInt(); return EnumIntegerEnum.fromValue(String.valueOf(value)); } } @@ -225,7 +225,7 @@ public void write(final JsonWriter jsonWriter, final EnumNumberEnum enumeration) @Override public EnumNumberEnum read(final JsonReader jsonReader) throws IOException { - Double value = jsonReader.nextDouble(); + String value = jsonReader.nextString(); return EnumNumberEnum.fromValue(String.valueOf(value)); } } diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..b615fd3bc7f --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,84 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(Ints.Adapter.class) +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Ints enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Ints read(final JsonReader jsonReader) throws IOException { + Integer value = jsonReader.nextInt(); + return Ints.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..a579dfae766 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,74 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * True or False indicator + */ +@JsonAdapter(ModelBoolean.Adapter.class) +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final ModelBoolean enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public ModelBoolean read(final JsonReader jsonReader) throws IOException { + String value = jsonReader.nextString(); + return ModelBoolean.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..58381513570 --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,94 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +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 io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.IOException; + +/** + * ModelList + */ + +public class ModelList { + @SerializedName("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..47cadd1886d --- /dev/null +++ b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,79 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.google.gson.annotations.SerializedName; + +import java.io.IOException; +import com.google.gson.TypeAdapter; +import com.google.gson.annotations.JsonAdapter; +import com.google.gson.stream.JsonReader; +import com.google.gson.stream.JsonWriter; + +/** + * some number + */ +@JsonAdapter(Numbers.Adapter.class) +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + + public static class Adapter extends TypeAdapter { + @Override + public void write(final JsonWriter jsonWriter, final Numbers enumeration) throws IOException { + jsonWriter.value(enumeration.getValue()); + } + + @Override + public Numbers read(final JsonReader jsonReader) throws IOException { + BigDecimal value = new BigDecimal(jsonReader.nextDouble()); + return Numbers.fromValue(String.valueOf(value)); + } + } +} + diff --git a/samples/client/petstore/java/vertx/.swagger-codegen/VERSION b/samples/client/petstore/java/vertx/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/client/petstore/java/vertx/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/vertx/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/vertx/build.gradle b/samples/client/petstore/java/vertx/build.gradle index ed809937e3f..8574c3092af 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -21,14 +21,14 @@ install { } task execute(type:JavaExec) { - main = System.getProperty('mainClass') - classpath = sourceSets.main.runtimeClasspath + main = System.getProperty('mainClass') + classpath = sourceSets.main.runtimeClasspath } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" threetenbp_version = "2.6.4" - jackson_version = "2.10.1" + jackson_version = "2.11.4" vertx_version = "3.4.2" junit_version = "4.12" } diff --git a/samples/client/petstore/java/vertx/docs/Ints.md b/samples/client/petstore/java/vertx/docs/Ints.md new file mode 100644 index 00000000000..28b508b44f0 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/Ints.md @@ -0,0 +1,22 @@ + +# Ints + +## Enum + + +* `NUMBER_0` (value: `0`) + +* `NUMBER_1` (value: `1`) + +* `NUMBER_2` (value: `2`) + +* `NUMBER_3` (value: `3`) + +* `NUMBER_4` (value: `4`) + +* `NUMBER_5` (value: `5`) + +* `NUMBER_6` (value: `6`) + + + diff --git a/samples/client/petstore/java/vertx/docs/ModelBoolean.md b/samples/client/petstore/java/vertx/docs/ModelBoolean.md new file mode 100644 index 00000000000..10ac48b4bbd --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/vertx/docs/ModelList.md b/samples/client/petstore/java/vertx/docs/ModelList.md new file mode 100644 index 00000000000..708124350f8 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/vertx/docs/Numbers.md b/samples/client/petstore/java/vertx/docs/Numbers.md new file mode 100644 index 00000000000..e2db29364b1 --- /dev/null +++ b/samples/client/petstore/java/vertx/docs/Numbers.md @@ -0,0 +1,16 @@ + +# Numbers + +## Enum + + +* `NUMBER_7` (value: `new BigDecimal(7)`) + +* `NUMBER_8` (value: `new BigDecimal(8)`) + +* `NUMBER_9` (value: `new BigDecimal(9)`) + +* `NUMBER_10` (value: `new BigDecimal(10)`) + + + diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index 0567f5e6cb5..a23c65665bb 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -115,7 +115,7 @@ - src/main/java + src/main/java @@ -128,7 +128,7 @@ - src/test/java + src/test/java @@ -140,7 +140,7 @@ 3.6.1 - 1.8 + 1.8 1.8 @@ -232,16 +232,16 @@ jackson-databind ${jackson-version} - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - ${jackson-version} - - - com.github.joschi.jackson - jackson-datatype-threetenbp - ${threetenbp-version} - + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson-version} + + + com.github.joschi.jackson + jackson-datatype-threetenbp + ${threetenbp-version} + @@ -261,9 +261,9 @@ UTF-8 3.4.2 - 1.5.18 + 1.5.24 2.6.4 - 2.10.1 - 4.12 + 2.11.4 + 4.13.1 diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/ApiClient.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/ApiClient.java index ec67ac4cc36..01dd3a035b0 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/ApiClient.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/ApiClient.java @@ -554,7 +554,7 @@ protected Handler>> buildResponseHandler(Ty handleFileDownload(httpResponse, handler); return; } else { - resultContent = Json.decodeValue(httpResponse.body(), returnType); + resultContent = (T) Json.decodeValue(httpResponse.body(), returnType); } result = Future.succeededFuture(resultContent); } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java index 6597c52b7b3..178e990375c 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumArrays.java @@ -53,9 +53,9 @@ public String toString() { } @JsonCreator - public static JustSymbolEnum fromValue(String text) { + public static JustSymbolEnum fromValue(String value) { for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -91,9 +91,9 @@ public String toString() { } @JsonCreator - public static ArrayEnumEnum fromValue(String text) { + public static ArrayEnumEnum fromValue(String value) { for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java index 09fd0a2ebdc..9aac1103506 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumClass.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static EnumClass fromValue(String text) { + public static EnumClass fromValue(String value) { for (EnumClass b : EnumClass.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java index 2bb7dd17d43..d107f87e68e 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/EnumTest.java @@ -54,9 +54,9 @@ public String toString() { } @JsonCreator - public static EnumStringEnum fromValue(String text) { + public static EnumStringEnum fromValue(String value) { for (EnumStringEnum b : EnumStringEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -94,9 +94,9 @@ public String toString() { } @JsonCreator - public static EnumStringRequiredEnum fromValue(String text) { + public static EnumStringRequiredEnum fromValue(String value) { for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -132,9 +132,9 @@ public String toString() { } @JsonCreator - public static EnumIntegerEnum fromValue(String text) { + public static EnumIntegerEnum fromValue(Integer value) { for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } @@ -170,9 +170,9 @@ public String toString() { } @JsonCreator - public static EnumNumberEnum fromValue(String text) { + public static EnumNumberEnum fromValue(Double value) { for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 00000000000..af82b718ab3 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Ints.java @@ -0,0 +1,68 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @JsonValue + public Integer getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(Integer value) { + for (Ints b : Ints.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java index 65abf528469..43700675c71 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/MapTest.java @@ -57,9 +57,9 @@ public String toString() { } @JsonCreator - public static InnerEnum fromValue(String text) { + public static InnerEnum fromValue(String value) { for (InnerEnum b : InnerEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelBoolean.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 00000000000..6bd93faec96 --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -0,0 +1,58 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @JsonValue + public Boolean getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(Boolean value) { + for (ModelBoolean b : ModelBoolean.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelList.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 00000000000..4e10dc7e3cc --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 00000000000..2dd6441b67b --- /dev/null +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Numbers.java @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import java.util.Objects; +import java.util.Arrays; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @JsonValue + public BigDecimal getValue() { + return value; + } + + @Override + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(BigDecimal value) { + for (Numbers b : Numbers.values()) { + if (b.value.equals(value)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java index dec431cf77e..6dd16b910dd 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Order.java @@ -66,9 +66,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java index 108accb2987..26871986c39 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/OuterEnum.java @@ -47,9 +47,9 @@ public String toString() { } @JsonCreator - public static OuterEnum fromValue(String text) { + public static OuterEnum fromValue(String value) { for (OuterEnum b : OuterEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java index da8a23e3d75..0100fcd4c17 100644 --- a/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java +++ b/samples/client/petstore/java/vertx/src/main/java/io/swagger/client/model/Pet.java @@ -72,9 +72,9 @@ public String toString() { } @JsonCreator - public static StatusEnum fromValue(String text) { + public static StatusEnum fromValue(String value) { for (StatusEnum b : StatusEnum.values()) { - if (String.valueOf(b.value).equals(text)) { + if (b.value.equals(value)) { return b; } } diff --git a/samples/client/petstore/javascript-es6/.swagger-codegen/VERSION b/samples/client/petstore/javascript-es6/.swagger-codegen/VERSION index 6cecc1a68f3..8c7754221a4 100644 --- a/samples/client/petstore/javascript-es6/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript-es6/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.6-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-es6/README.md b/samples/client/petstore/javascript-es6/README.md index f344feaa82b..e89a3c224ce 100644 --- a/samples/client/petstore/javascript-es6/README.md +++ b/samples/client/petstore/javascript-es6/README.md @@ -136,21 +136,26 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [SwaggerPetstore.ArrayTest](docs/ArrayTest.md) - [SwaggerPetstore.Capitalization](docs/Capitalization.md) + - [SwaggerPetstore.Cat](docs/Cat.md) - [SwaggerPetstore.Category](docs/Category.md) - [SwaggerPetstore.ClassModel](docs/ClassModel.md) - [SwaggerPetstore.Client](docs/Client.md) + - [SwaggerPetstore.Dog](docs/Dog.md) - [SwaggerPetstore.EnumArrays](docs/EnumArrays.md) - [SwaggerPetstore.EnumClass](docs/EnumClass.md) - [SwaggerPetstore.EnumTest](docs/EnumTest.md) - [SwaggerPetstore.FormatTest](docs/FormatTest.md) - [SwaggerPetstore.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [SwaggerPetstore.Ints](docs/Ints.md) - [SwaggerPetstore.List](docs/List.md) - [SwaggerPetstore.MapTest](docs/MapTest.md) - [SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [SwaggerPetstore.Model200Response](docs/Model200Response.md) + - [SwaggerPetstore.ModelBoolean](docs/ModelBoolean.md) - [SwaggerPetstore.ModelReturn](docs/ModelReturn.md) - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.NumberOnly](docs/NumberOnly.md) + - [SwaggerPetstore.Numbers](docs/Numbers.md) - [SwaggerPetstore.Order](docs/Order.md) - [SwaggerPetstore.OuterBoolean](docs/OuterBoolean.md) - [SwaggerPetstore.OuterComposite](docs/OuterComposite.md) @@ -162,8 +167,6 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) - [SwaggerPetstore.Tag](docs/Tag.md) - [SwaggerPetstore.User](docs/User.md) - - [SwaggerPetstore.Cat](docs/Cat.md) - - [SwaggerPetstore.Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/javascript-es6/docs/Ints.md b/samples/client/petstore/javascript-es6/docs/Ints.md new file mode 100644 index 00000000000..4a4e8c4f370 --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/Ints.md @@ -0,0 +1,20 @@ +# SwaggerPetstore.Ints + +## Enum + + +* `_0` (value: `0`) + +* `_1` (value: `1`) + +* `_2` (value: `2`) + +* `_3` (value: `3`) + +* `_4` (value: `4`) + +* `_5` (value: `5`) + +* `_6` (value: `6`) + + diff --git a/samples/client/petstore/javascript-es6/docs/ModelBoolean.md b/samples/client/petstore/javascript-es6/docs/ModelBoolean.md new file mode 100644 index 00000000000..726dd7e9892 --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/ModelBoolean.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.ModelBoolean + +## Enum + + +* `_true` (value: `true`) + +* `_false` (value: `false`) + + diff --git a/samples/client/petstore/javascript-es6/docs/Numbers.md b/samples/client/petstore/javascript-es6/docs/Numbers.md new file mode 100644 index 00000000000..93fd4901f06 --- /dev/null +++ b/samples/client/petstore/javascript-es6/docs/Numbers.md @@ -0,0 +1,14 @@ +# SwaggerPetstore.Numbers + +## Enum + + +* `_7` (value: `7`) + +* `_8` (value: `8`) + +* `_9` (value: `9`) + +* `_10` (value: `10`) + + diff --git a/samples/client/petstore/javascript-es6/src/ApiClient.js b/samples/client/petstore/javascript-es6/src/ApiClient.js index 4ba645d4e58..932d4702c0d 100644 --- a/samples/client/petstore/javascript-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-es6/src/ApiClient.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js index e8df590c214..d819ec91e9b 100644 --- a/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/AnotherFakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-es6/src/api/FakeApi.js index c218f7119f5..87aaa4c40a0 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js index 5147076eba6..60683973570 100644 --- a/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-es6/src/api/FakeClassnameTags123Api.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/api/PetApi.js b/samples/client/petstore/javascript-es6/src/api/PetApi.js index 5086a05f21a..2aaf692fde7 100644 --- a/samples/client/petstore/javascript-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-es6/src/api/PetApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-es6/src/api/StoreApi.js index 03a1c979d4d..826634db690 100644 --- a/samples/client/petstore/javascript-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-es6/src/api/StoreApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/api/UserApi.js b/samples/client/petstore/javascript-es6/src/api/UserApi.js index 3764c08d252..55cf8487567 100644 --- a/samples/client/petstore/javascript-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-es6/src/api/UserApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/index.js b/samples/client/petstore/javascript-es6/src/index.js index 13e7010860d..acfb2cd0589 100644 --- a/samples/client/petstore/javascript-es6/src/index.js +++ b/samples/client/petstore/javascript-es6/src/index.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -23,21 +23,26 @@ import {ArrayOfArrayOfNumberOnly} from './model/ArrayOfArrayOfNumberOnly'; import {ArrayOfNumberOnly} from './model/ArrayOfNumberOnly'; import {ArrayTest} from './model/ArrayTest'; import {Capitalization} from './model/Capitalization'; +import {Cat} from './model/Cat'; import {Category} from './model/Category'; import {ClassModel} from './model/ClassModel'; import {Client} from './model/Client'; +import {Dog} from './model/Dog'; import {EnumArrays} from './model/EnumArrays'; import {EnumClass} from './model/EnumClass'; import {EnumTest} from './model/EnumTest'; import {FormatTest} from './model/FormatTest'; import {HasOnlyReadOnly} from './model/HasOnlyReadOnly'; +import {Ints} from './model/Ints'; import {List} from './model/List'; import {MapTest} from './model/MapTest'; import {MixedPropertiesAndAdditionalPropertiesClass} from './model/MixedPropertiesAndAdditionalPropertiesClass'; import {Model200Response} from './model/Model200Response'; +import {ModelBoolean} from './model/ModelBoolean'; import {ModelReturn} from './model/ModelReturn'; import {Name} from './model/Name'; import {NumberOnly} from './model/NumberOnly'; +import {Numbers} from './model/Numbers'; import {Order} from './model/Order'; import {OuterBoolean} from './model/OuterBoolean'; import {OuterComposite} from './model/OuterComposite'; @@ -49,8 +54,6 @@ import {ReadOnlyFirst} from './model/ReadOnlyFirst'; import {SpecialModelName} from './model/SpecialModelName'; import {Tag} from './model/Tag'; import {User} from './model/User'; -import {Cat} from './model/Cat'; -import {Dog} from './model/Dog'; import {AnotherFakeApi} from './api/AnotherFakeApi'; import {FakeApi} from './api/FakeApi'; import {FakeClassnameTags123Api} from './api/FakeClassnameTags123Api'; @@ -145,6 +148,12 @@ export { */ Capitalization, + /** + * The Cat model constructor. + * @property {module:model/Cat} + */ + Cat, + /** * The Category model constructor. * @property {module:model/Category} @@ -163,6 +172,12 @@ export { */ Client, + /** + * The Dog model constructor. + * @property {module:model/Dog} + */ + Dog, + /** * The EnumArrays model constructor. * @property {module:model/EnumArrays} @@ -193,6 +208,12 @@ export { */ HasOnlyReadOnly, + /** + * The Ints model constructor. + * @property {module:model/Ints} + */ + Ints, + /** * The List model constructor. * @property {module:model/List} @@ -217,6 +238,12 @@ export { */ Model200Response, + /** + * The ModelBoolean model constructor. + * @property {module:model/ModelBoolean} + */ + ModelBoolean, + /** * The ModelReturn model constructor. * @property {module:model/ModelReturn} @@ -235,6 +262,12 @@ export { */ NumberOnly, + /** + * The Numbers model constructor. + * @property {module:model/Numbers} + */ + Numbers, + /** * The Order model constructor. * @property {module:model/Order} @@ -301,18 +334,6 @@ export { */ User, - /** - * The Cat model constructor. - * @property {module:model/Cat} - */ - Cat, - - /** - * The Dog model constructor. - * @property {module:model/Dog} - */ - Dog, - /** * The AnotherFakeApi service constructor. * @property {module:api/AnotherFakeApi} diff --git a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js index e50bab6a854..ed5640380a3 100644 --- a/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/AdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Animal.js b/samples/client/petstore/javascript-es6/src/model/Animal.js index 7a7b870833a..2a618a6cb53 100644 --- a/samples/client/petstore/javascript-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-es6/src/model/Animal.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js index 79ba3491683..4e2f7ea9862 100644 --- a/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-es6/src/model/AnimalFarm.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js index d0a79855665..0b3ca39910d 100644 --- a/samples/client/petstore/javascript-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-es6/src/model/ApiResponse.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js index 9448a69cd1c..6501d321fa1 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js index 84f908bbc46..0a143e1c413 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js index d68627f5314..02ad0e296ce 100644 --- a/samples/client/petstore/javascript-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-es6/src/model/ArrayTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-es6/src/model/Capitalization.js index 7e4f561236f..d75f297252f 100644 --- a/samples/client/petstore/javascript-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-es6/src/model/Capitalization.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Cat.js b/samples/client/petstore/javascript-es6/src/model/Cat.js index b581d5e00bf..391b11b5e0e 100644 --- a/samples/client/petstore/javascript-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-es6/src/model/Cat.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Category.js b/samples/client/petstore/javascript-es6/src/model/Category.js index 835ce21ae5e..fcef92eb6ef 100644 --- a/samples/client/petstore/javascript-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-es6/src/model/Category.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-es6/src/model/ClassModel.js index a68fb434c50..09e8ec37f3f 100644 --- a/samples/client/petstore/javascript-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-es6/src/model/ClassModel.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Client.js b/samples/client/petstore/javascript-es6/src/model/Client.js index 52b0d5f0c5d..97d9faa40dd 100644 --- a/samples/client/petstore/javascript-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-es6/src/model/Client.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Dog.js b/samples/client/petstore/javascript-es6/src/model/Dog.js index a90ac7793e2..21960528377 100644 --- a/samples/client/petstore/javascript-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-es6/src/model/Dog.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js index 4264aee98b1..7516904e7b7 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumArrays.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-es6/src/model/EnumClass.js index 1d85dd4a938..dd28774737f 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-es6/src/model/EnumTest.js index 5e007107880..00a79562c9d 100644 --- a/samples/client/petstore/javascript-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-es6/src/model/EnumTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-es6/src/model/FormatTest.js index d1e7b5eb1cf..5bfda057a23 100644 --- a/samples/client/petstore/javascript-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-es6/src/model/FormatTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js index 791d233a4f0..c23239d7860 100644 --- a/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/HasOnlyReadOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Ints.js b/samples/client/petstore/javascript-es6/src/model/Ints.js new file mode 100644 index 00000000000..7cacc17b6bd --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/Ints.js @@ -0,0 +1,77 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +import {ApiClient} from '../ApiClient'; + +/** + * Enum class Ints. + * @enum {Number} + * @readonly + */ +const Ints = { + /** + * value: 0 + * @const + */ + _0: 0, + + /** + * value: 1 + * @const + */ + _1: 1, + + /** + * value: 2 + * @const + */ + _2: 2, + + /** + * value: 3 + * @const + */ + _3: 3, + + /** + * value: 4 + * @const + */ + _4: 4, + + /** + * value: 5 + * @const + */ + _5: 5, + + /** + * value: 6 + * @const + */ + _6: 6, + + /** + * Returns a Ints enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Ints} The enum Ints value. + */ + constructFromObject: function(object) { + return object; + } +}; + +export {Ints}; diff --git a/samples/client/petstore/javascript-es6/src/model/List.js b/samples/client/petstore/javascript-es6/src/model/List.js index d76c2aa0bb8..52934bc5de5 100644 --- a/samples/client/petstore/javascript-es6/src/model/List.js +++ b/samples/client/petstore/javascript-es6/src/model/List.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/MapTest.js b/samples/client/petstore/javascript-es6/src/model/MapTest.js index 8b960570966..cea2ab34bfe 100644 --- a/samples/client/petstore/javascript-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-es6/src/model/MapTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 973037c11b5..9989a325116 100644 --- a/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-es6/src/model/Model200Response.js index 59683a26bc3..15ffc4ac9cd 100644 --- a/samples/client/petstore/javascript-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-es6/src/model/Model200Response.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/ModelBoolean.js b/samples/client/petstore/javascript-es6/src/model/ModelBoolean.js new file mode 100644 index 00000000000..2081ddf8acd --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/ModelBoolean.js @@ -0,0 +1,47 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +import {ApiClient} from '../ApiClient'; + +/** + * Enum class ModelBoolean. + * @enum {Boolean} + * @readonly + */ +const ModelBoolean = { + /** + * value: true + * @const + */ + _true: true, + + /** + * value: false + * @const + */ + _false: false, + + /** + * Returns a ModelBoolean enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/ModelBoolean} The enum ModelBoolean value. + */ + constructFromObject: function(object) { + return object; + } +}; + +export {ModelBoolean}; diff --git a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js index 148ba14772c..44ca381d35f 100644 --- a/samples/client/petstore/javascript-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-es6/src/model/ModelReturn.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Name.js b/samples/client/petstore/javascript-es6/src/model/Name.js index 06d1b0a61c8..12032449df8 100644 --- a/samples/client/petstore/javascript-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-es6/src/model/Name.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js index 52c0b0611f3..024585071f5 100644 --- a/samples/client/petstore/javascript-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-es6/src/model/NumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Numbers.js b/samples/client/petstore/javascript-es6/src/model/Numbers.js new file mode 100644 index 00000000000..51f1d041548 --- /dev/null +++ b/samples/client/petstore/javascript-es6/src/model/Numbers.js @@ -0,0 +1,59 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +import {ApiClient} from '../ApiClient'; + +/** + * Enum class Numbers. + * @enum {Number} + * @readonly + */ +const Numbers = { + /** + * value: 7 + * @const + */ + _7: 7, + + /** + * value: 8 + * @const + */ + _8: 8, + + /** + * value: 9 + * @const + */ + _9: 9, + + /** + * value: 10 + * @const + */ + _10: 10, + + /** + * Returns a Numbers enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Numbers} The enum Numbers value. + */ + constructFromObject: function(object) { + return object; + } +}; + +export {Numbers}; diff --git a/samples/client/petstore/javascript-es6/src/model/Order.js b/samples/client/petstore/javascript-es6/src/model/Order.js index 208c85820d5..2e87f9d2bfe 100644 --- a/samples/client/petstore/javascript-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-es6/src/model/Order.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js index 99bf4cec615..3b44210d1d3 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterBoolean.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js index 76884b8a2a6..a2ccca9d1df 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterComposite.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js index 0d1ce5c2528..8e7a43c763d 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterEnum.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-es6/src/model/OuterNumber.js index c5c4e82bdb6..e4f426cf543 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterNumber.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterNumber.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/OuterString.js b/samples/client/petstore/javascript-es6/src/model/OuterString.js index 4b9ae20b9c2..e69620d77be 100644 --- a/samples/client/petstore/javascript-es6/src/model/OuterString.js +++ b/samples/client/petstore/javascript-es6/src/model/OuterString.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Pet.js b/samples/client/petstore/javascript-es6/src/model/Pet.js index 3be93d5372d..a6c6bd83e9b 100644 --- a/samples/client/petstore/javascript-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-es6/src/model/Pet.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js index a8ef7b7ca36..fc4482c77af 100644 --- a/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-es6/src/model/ReadOnlyFirst.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js index 875d2ce13a2..a7943b45f99 100644 --- a/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-es6/src/model/SpecialModelName.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/Tag.js b/samples/client/petstore/javascript-es6/src/model/Tag.js index 7000111c391..943b79af3ea 100644 --- a/samples/client/petstore/javascript-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-es6/src/model/Tag.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/src/model/User.js b/samples/client/petstore/javascript-es6/src/model/User.js index 8bff47d2c82..302b552db5a 100644 --- a/samples/client/petstore/javascript-es6/src/model/User.js +++ b/samples/client/petstore/javascript-es6/src/model/User.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-es6/test/model/Ints.spec.js b/samples/client/petstore/javascript-es6/test/model/Ints.spec.js new file mode 100644 index 00000000000..5acd21643bb --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/Ints.spec.js @@ -0,0 +1,82 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Ints', function() { + beforeEach(function() { + instance = SwaggerPetstore.Ints; + }); + + it('should create an instance of Ints', function() { + // TODO: update the code to test Ints + expect(instance).to.be.a('object'); + }); + + it('should have the property _0', function() { + expect(instance).to.have.property('_0'); + expect(instance._0).to.be(0); + }); + + it('should have the property _1', function() { + expect(instance).to.have.property('_1'); + expect(instance._1).to.be(1); + }); + + it('should have the property _2', function() { + expect(instance).to.have.property('_2'); + expect(instance._2).to.be(2); + }); + + it('should have the property _3', function() { + expect(instance).to.have.property('_3'); + expect(instance._3).to.be(3); + }); + + it('should have the property _4', function() { + expect(instance).to.have.property('_4'); + expect(instance._4).to.be(4); + }); + + it('should have the property _5', function() { + expect(instance).to.have.property('_5'); + expect(instance._5).to.be(5); + }); + + it('should have the property _6', function() { + expect(instance).to.have.property('_6'); + expect(instance._6).to.be(6); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/model/ModelBoolean.spec.js b/samples/client/petstore/javascript-es6/test/model/ModelBoolean.spec.js new file mode 100644 index 00000000000..43707f907e0 --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/ModelBoolean.spec.js @@ -0,0 +1,57 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('ModelBoolean', function() { + beforeEach(function() { + instance = SwaggerPetstore.ModelBoolean; + }); + + it('should create an instance of ModelBoolean', function() { + // TODO: update the code to test ModelBoolean + expect(instance).to.be.a('object'); + }); + + it('should have the property _true', function() { + expect(instance).to.have.property('_true'); + expect(instance._true).to.be(true); + }); + + it('should have the property _false', function() { + expect(instance).to.have.property('_false'); + expect(instance._false).to.be(false); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-es6/test/model/Numbers.spec.js b/samples/client/petstore/javascript-es6/test/model/Numbers.spec.js new file mode 100644 index 00000000000..1f396917eea --- /dev/null +++ b/samples/client/petstore/javascript-es6/test/model/Numbers.spec.js @@ -0,0 +1,67 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Numbers', function() { + beforeEach(function() { + instance = SwaggerPetstore.Numbers; + }); + + it('should create an instance of Numbers', function() { + // TODO: update the code to test Numbers + expect(instance).to.be.a('object'); + }); + + it('should have the property _7', function() { + expect(instance).to.have.property('_7'); + expect(instance._7).to.be(7); + }); + + it('should have the property _8', function() { + expect(instance).to.have.property('_8'); + expect(instance._8).to.be(8); + }); + + it('should have the property _9', function() { + expect(instance).to.have.property('_9'); + expect(instance._9).to.be(9); + }); + + it('should have the property _10', function() { + expect(instance).to.have.property('_10'); + expect(instance._10).to.be(10); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/.swagger-codegen/VERSION b/samples/client/petstore/javascript-promise-es6/.swagger-codegen/VERSION index 6cecc1a68f3..8c7754221a4 100644 --- a/samples/client/petstore/javascript-promise-es6/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript-promise-es6/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.6-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise-es6/README.md b/samples/client/petstore/javascript-promise-es6/README.md index 01d4fd9ff53..bbbac56e7d6 100644 --- a/samples/client/petstore/javascript-promise-es6/README.md +++ b/samples/client/petstore/javascript-promise-es6/README.md @@ -133,21 +133,26 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [SwaggerPetstore.ArrayTest](docs/ArrayTest.md) - [SwaggerPetstore.Capitalization](docs/Capitalization.md) + - [SwaggerPetstore.Cat](docs/Cat.md) - [SwaggerPetstore.Category](docs/Category.md) - [SwaggerPetstore.ClassModel](docs/ClassModel.md) - [SwaggerPetstore.Client](docs/Client.md) + - [SwaggerPetstore.Dog](docs/Dog.md) - [SwaggerPetstore.EnumArrays](docs/EnumArrays.md) - [SwaggerPetstore.EnumClass](docs/EnumClass.md) - [SwaggerPetstore.EnumTest](docs/EnumTest.md) - [SwaggerPetstore.FormatTest](docs/FormatTest.md) - [SwaggerPetstore.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [SwaggerPetstore.Ints](docs/Ints.md) - [SwaggerPetstore.List](docs/List.md) - [SwaggerPetstore.MapTest](docs/MapTest.md) - [SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [SwaggerPetstore.Model200Response](docs/Model200Response.md) + - [SwaggerPetstore.ModelBoolean](docs/ModelBoolean.md) - [SwaggerPetstore.ModelReturn](docs/ModelReturn.md) - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.NumberOnly](docs/NumberOnly.md) + - [SwaggerPetstore.Numbers](docs/Numbers.md) - [SwaggerPetstore.Order](docs/Order.md) - [SwaggerPetstore.OuterBoolean](docs/OuterBoolean.md) - [SwaggerPetstore.OuterComposite](docs/OuterComposite.md) @@ -159,8 +164,6 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) - [SwaggerPetstore.Tag](docs/Tag.md) - [SwaggerPetstore.User](docs/User.md) - - [SwaggerPetstore.Cat](docs/Cat.md) - - [SwaggerPetstore.Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/javascript-promise-es6/docs/Ints.md b/samples/client/petstore/javascript-promise-es6/docs/Ints.md new file mode 100644 index 00000000000..4a4e8c4f370 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/Ints.md @@ -0,0 +1,20 @@ +# SwaggerPetstore.Ints + +## Enum + + +* `_0` (value: `0`) + +* `_1` (value: `1`) + +* `_2` (value: `2`) + +* `_3` (value: `3`) + +* `_4` (value: `4`) + +* `_5` (value: `5`) + +* `_6` (value: `6`) + + diff --git a/samples/client/petstore/javascript-promise-es6/docs/ModelBoolean.md b/samples/client/petstore/javascript-promise-es6/docs/ModelBoolean.md new file mode 100644 index 00000000000..726dd7e9892 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/ModelBoolean.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.ModelBoolean + +## Enum + + +* `_true` (value: `true`) + +* `_false` (value: `false`) + + diff --git a/samples/client/petstore/javascript-promise-es6/docs/Numbers.md b/samples/client/petstore/javascript-promise-es6/docs/Numbers.md new file mode 100644 index 00000000000..93fd4901f06 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/docs/Numbers.md @@ -0,0 +1,14 @@ +# SwaggerPetstore.Numbers + +## Enum + + +* `_7` (value: `7`) + +* `_8` (value: `8`) + +* `_9` (value: `9`) + +* `_10` (value: `10`) + + diff --git a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js index 19c88f4b4a5..9bd5dd05fd2 100644 --- a/samples/client/petstore/javascript-promise-es6/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise-es6/src/ApiClient.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js index 47a5fff970c..89835a7a3ef 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/AnotherFakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js index cd09075b122..af94bd96d21 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js index 83e167de060..a991abd7e29 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/FakeClassnameTags123Api.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js index b253094d423..a4197665c11 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/PetApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js index b7508407ae8..2fcde80e7d9 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/StoreApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js index 43547ba3866..6900e7c8c47 100644 --- a/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise-es6/src/api/UserApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/index.js b/samples/client/petstore/javascript-promise-es6/src/index.js index 13e7010860d..acfb2cd0589 100644 --- a/samples/client/petstore/javascript-promise-es6/src/index.js +++ b/samples/client/petstore/javascript-promise-es6/src/index.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -23,21 +23,26 @@ import {ArrayOfArrayOfNumberOnly} from './model/ArrayOfArrayOfNumberOnly'; import {ArrayOfNumberOnly} from './model/ArrayOfNumberOnly'; import {ArrayTest} from './model/ArrayTest'; import {Capitalization} from './model/Capitalization'; +import {Cat} from './model/Cat'; import {Category} from './model/Category'; import {ClassModel} from './model/ClassModel'; import {Client} from './model/Client'; +import {Dog} from './model/Dog'; import {EnumArrays} from './model/EnumArrays'; import {EnumClass} from './model/EnumClass'; import {EnumTest} from './model/EnumTest'; import {FormatTest} from './model/FormatTest'; import {HasOnlyReadOnly} from './model/HasOnlyReadOnly'; +import {Ints} from './model/Ints'; import {List} from './model/List'; import {MapTest} from './model/MapTest'; import {MixedPropertiesAndAdditionalPropertiesClass} from './model/MixedPropertiesAndAdditionalPropertiesClass'; import {Model200Response} from './model/Model200Response'; +import {ModelBoolean} from './model/ModelBoolean'; import {ModelReturn} from './model/ModelReturn'; import {Name} from './model/Name'; import {NumberOnly} from './model/NumberOnly'; +import {Numbers} from './model/Numbers'; import {Order} from './model/Order'; import {OuterBoolean} from './model/OuterBoolean'; import {OuterComposite} from './model/OuterComposite'; @@ -49,8 +54,6 @@ import {ReadOnlyFirst} from './model/ReadOnlyFirst'; import {SpecialModelName} from './model/SpecialModelName'; import {Tag} from './model/Tag'; import {User} from './model/User'; -import {Cat} from './model/Cat'; -import {Dog} from './model/Dog'; import {AnotherFakeApi} from './api/AnotherFakeApi'; import {FakeApi} from './api/FakeApi'; import {FakeClassnameTags123Api} from './api/FakeClassnameTags123Api'; @@ -145,6 +148,12 @@ export { */ Capitalization, + /** + * The Cat model constructor. + * @property {module:model/Cat} + */ + Cat, + /** * The Category model constructor. * @property {module:model/Category} @@ -163,6 +172,12 @@ export { */ Client, + /** + * The Dog model constructor. + * @property {module:model/Dog} + */ + Dog, + /** * The EnumArrays model constructor. * @property {module:model/EnumArrays} @@ -193,6 +208,12 @@ export { */ HasOnlyReadOnly, + /** + * The Ints model constructor. + * @property {module:model/Ints} + */ + Ints, + /** * The List model constructor. * @property {module:model/List} @@ -217,6 +238,12 @@ export { */ Model200Response, + /** + * The ModelBoolean model constructor. + * @property {module:model/ModelBoolean} + */ + ModelBoolean, + /** * The ModelReturn model constructor. * @property {module:model/ModelReturn} @@ -235,6 +262,12 @@ export { */ NumberOnly, + /** + * The Numbers model constructor. + * @property {module:model/Numbers} + */ + Numbers, + /** * The Order model constructor. * @property {module:model/Order} @@ -301,18 +334,6 @@ export { */ User, - /** - * The Cat model constructor. - * @property {module:model/Cat} - */ - Cat, - - /** - * The Dog model constructor. - * @property {module:model/Dog} - */ - Dog, - /** * The AnotherFakeApi service constructor. * @property {module:api/AnotherFakeApi} diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js index e50bab6a854..ed5640380a3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js index 7a7b870833a..2a618a6cb53 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Animal.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js index 79ba3491683..4e2f7ea9862 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/AnimalFarm.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js index d0a79855665..0b3ca39910d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ApiResponse.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js index 9448a69cd1c..6501d321fa1 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js index 84f908bbc46..0a143e1c413 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js index d68627f5314..02ad0e296ce 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ArrayTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js index 7e4f561236f..d75f297252f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Capitalization.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js index b581d5e00bf..391b11b5e0e 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Cat.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Category.js b/samples/client/petstore/javascript-promise-es6/src/model/Category.js index 835ce21ae5e..fcef92eb6ef 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Category.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Category.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js index a68fb434c50..09e8ec37f3f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ClassModel.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Client.js b/samples/client/petstore/javascript-promise-es6/src/model/Client.js index 52b0d5f0c5d..97d9faa40dd 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Client.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Client.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js index a90ac7793e2..21960528377 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Dog.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js index 4264aee98b1..7516904e7b7 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumArrays.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js index 1d85dd4a938..dd28774737f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js index 5e007107880..00a79562c9d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/EnumTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js index d1e7b5eb1cf..5bfda057a23 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/FormatTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js index 791d233a4f0..c23239d7860 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/HasOnlyReadOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Ints.js b/samples/client/petstore/javascript-promise-es6/src/model/Ints.js new file mode 100644 index 00000000000..7cacc17b6bd --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/Ints.js @@ -0,0 +1,77 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +import {ApiClient} from '../ApiClient'; + +/** + * Enum class Ints. + * @enum {Number} + * @readonly + */ +const Ints = { + /** + * value: 0 + * @const + */ + _0: 0, + + /** + * value: 1 + * @const + */ + _1: 1, + + /** + * value: 2 + * @const + */ + _2: 2, + + /** + * value: 3 + * @const + */ + _3: 3, + + /** + * value: 4 + * @const + */ + _4: 4, + + /** + * value: 5 + * @const + */ + _5: 5, + + /** + * value: 6 + * @const + */ + _6: 6, + + /** + * Returns a Ints enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Ints} The enum Ints value. + */ + constructFromObject: function(object) { + return object; + } +}; + +export {Ints}; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/List.js b/samples/client/petstore/javascript-promise-es6/src/model/List.js index d76c2aa0bb8..52934bc5de5 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/List.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/List.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js index 8b960570966..cea2ab34bfe 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MapTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 973037c11b5..9989a325116 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js index 59683a26bc3..15ffc4ac9cd 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Model200Response.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ModelBoolean.js b/samples/client/petstore/javascript-promise-es6/src/model/ModelBoolean.js new file mode 100644 index 00000000000..2081ddf8acd --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/ModelBoolean.js @@ -0,0 +1,47 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +import {ApiClient} from '../ApiClient'; + +/** + * Enum class ModelBoolean. + * @enum {Boolean} + * @readonly + */ +const ModelBoolean = { + /** + * value: true + * @const + */ + _true: true, + + /** + * value: false + * @const + */ + _false: false, + + /** + * Returns a ModelBoolean enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/ModelBoolean} The enum ModelBoolean value. + */ + constructFromObject: function(object) { + return object; + } +}; + +export {ModelBoolean}; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js index 148ba14772c..44ca381d35f 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ModelReturn.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Name.js b/samples/client/petstore/javascript-promise-es6/src/model/Name.js index 06d1b0a61c8..12032449df8 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Name.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Name.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js index 52c0b0611f3..024585071f5 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/NumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Numbers.js b/samples/client/petstore/javascript-promise-es6/src/model/Numbers.js new file mode 100644 index 00000000000..51f1d041548 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/src/model/Numbers.js @@ -0,0 +1,59 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +import {ApiClient} from '../ApiClient'; + +/** + * Enum class Numbers. + * @enum {Number} + * @readonly + */ +const Numbers = { + /** + * value: 7 + * @const + */ + _7: 7, + + /** + * value: 8 + * @const + */ + _8: 8, + + /** + * value: 9 + * @const + */ + _9: 9, + + /** + * value: 10 + * @const + */ + _10: 10, + + /** + * Returns a Numbers enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Numbers} The enum Numbers value. + */ + constructFromObject: function(object) { + return object; + } +}; + +export {Numbers}; diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Order.js b/samples/client/petstore/javascript-promise-es6/src/model/Order.js index 208c85820d5..2e87f9d2bfe 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Order.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Order.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js index 99bf4cec615..3b44210d1d3 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterBoolean.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js index 76884b8a2a6..a2ccca9d1df 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterComposite.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js index 0d1ce5c2528..8e7a43c763d 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterEnum.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js index c5c4e82bdb6..e4f426cf543 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterNumber.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js b/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js index 4b9ae20b9c2..e69620d77be 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/OuterString.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js index 3be93d5372d..a6c6bd83e9b 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Pet.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js index a8ef7b7ca36..fc4482c77af 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/ReadOnlyFirst.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js index 875d2ce13a2..a7943b45f99 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/SpecialModelName.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js index 7000111c391..943b79af3ea 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/Tag.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/src/model/User.js b/samples/client/petstore/javascript-promise-es6/src/model/User.js index 8bff47d2c82..302b552db5a 100644 --- a/samples/client/petstore/javascript-promise-es6/src/model/User.js +++ b/samples/client/petstore/javascript-promise-es6/src/model/User.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise-es6/test/model/Ints.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/Ints.spec.js new file mode 100644 index 00000000000..5acd21643bb --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/Ints.spec.js @@ -0,0 +1,82 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Ints', function() { + beforeEach(function() { + instance = SwaggerPetstore.Ints; + }); + + it('should create an instance of Ints', function() { + // TODO: update the code to test Ints + expect(instance).to.be.a('object'); + }); + + it('should have the property _0', function() { + expect(instance).to.have.property('_0'); + expect(instance._0).to.be(0); + }); + + it('should have the property _1', function() { + expect(instance).to.have.property('_1'); + expect(instance._1).to.be(1); + }); + + it('should have the property _2', function() { + expect(instance).to.have.property('_2'); + expect(instance._2).to.be(2); + }); + + it('should have the property _3', function() { + expect(instance).to.have.property('_3'); + expect(instance._3).to.be(3); + }); + + it('should have the property _4', function() { + expect(instance).to.have.property('_4'); + expect(instance._4).to.be(4); + }); + + it('should have the property _5', function() { + expect(instance).to.have.property('_5'); + expect(instance._5).to.be(5); + }); + + it('should have the property _6', function() { + expect(instance).to.have.property('_6'); + expect(instance._6).to.be(6); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/test/model/ModelBoolean.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/ModelBoolean.spec.js new file mode 100644 index 00000000000..43707f907e0 --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/ModelBoolean.spec.js @@ -0,0 +1,57 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('ModelBoolean', function() { + beforeEach(function() { + instance = SwaggerPetstore.ModelBoolean; + }); + + it('should create an instance of ModelBoolean', function() { + // TODO: update the code to test ModelBoolean + expect(instance).to.be.a('object'); + }); + + it('should have the property _true', function() { + expect(instance).to.have.property('_true'); + expect(instance._true).to.be(true); + }); + + it('should have the property _false', function() { + expect(instance).to.have.property('_false'); + expect(instance._false).to.be(false); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise-es6/test/model/Numbers.spec.js b/samples/client/petstore/javascript-promise-es6/test/model/Numbers.spec.js new file mode 100644 index 00000000000..1f396917eea --- /dev/null +++ b/samples/client/petstore/javascript-promise-es6/test/model/Numbers.spec.js @@ -0,0 +1,67 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Numbers', function() { + beforeEach(function() { + instance = SwaggerPetstore.Numbers; + }); + + it('should create an instance of Numbers', function() { + // TODO: update the code to test Numbers + expect(instance).to.be.a('object'); + }); + + it('should have the property _7', function() { + expect(instance).to.have.property('_7'); + expect(instance._7).to.be(7); + }); + + it('should have the property _8', function() { + expect(instance).to.have.property('_8'); + expect(instance._8).to.be(8); + }); + + it('should have the property _9', function() { + expect(instance).to.have.property('_9'); + expect(instance._9).to.be(9); + }); + + it('should have the property _10', function() { + expect(instance).to.have.property('_10'); + expect(instance._10).to.be(10); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise/.swagger-codegen/VERSION b/samples/client/petstore/javascript-promise/.swagger-codegen/VERSION index 6cecc1a68f3..8c7754221a4 100644 --- a/samples/client/petstore/javascript-promise/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript-promise/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.6-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript-promise/README.md b/samples/client/petstore/javascript-promise/README.md index a2f90c36046..069130d9724 100644 --- a/samples/client/petstore/javascript-promise/README.md +++ b/samples/client/petstore/javascript-promise/README.md @@ -158,21 +158,26 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [SwaggerPetstore.ArrayTest](docs/ArrayTest.md) - [SwaggerPetstore.Capitalization](docs/Capitalization.md) + - [SwaggerPetstore.Cat](docs/Cat.md) - [SwaggerPetstore.Category](docs/Category.md) - [SwaggerPetstore.ClassModel](docs/ClassModel.md) - [SwaggerPetstore.Client](docs/Client.md) + - [SwaggerPetstore.Dog](docs/Dog.md) - [SwaggerPetstore.EnumArrays](docs/EnumArrays.md) - [SwaggerPetstore.EnumClass](docs/EnumClass.md) - [SwaggerPetstore.EnumTest](docs/EnumTest.md) - [SwaggerPetstore.FormatTest](docs/FormatTest.md) - [SwaggerPetstore.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [SwaggerPetstore.Ints](docs/Ints.md) - [SwaggerPetstore.List](docs/List.md) - [SwaggerPetstore.MapTest](docs/MapTest.md) - [SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [SwaggerPetstore.Model200Response](docs/Model200Response.md) + - [SwaggerPetstore.ModelBoolean](docs/ModelBoolean.md) - [SwaggerPetstore.ModelReturn](docs/ModelReturn.md) - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.NumberOnly](docs/NumberOnly.md) + - [SwaggerPetstore.Numbers](docs/Numbers.md) - [SwaggerPetstore.Order](docs/Order.md) - [SwaggerPetstore.OuterBoolean](docs/OuterBoolean.md) - [SwaggerPetstore.OuterComposite](docs/OuterComposite.md) @@ -184,8 +189,6 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) - [SwaggerPetstore.Tag](docs/Tag.md) - [SwaggerPetstore.User](docs/User.md) - - [SwaggerPetstore.Cat](docs/Cat.md) - - [SwaggerPetstore.Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/javascript-promise/docs/Ints.md b/samples/client/petstore/javascript-promise/docs/Ints.md new file mode 100644 index 00000000000..4a4e8c4f370 --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/Ints.md @@ -0,0 +1,20 @@ +# SwaggerPetstore.Ints + +## Enum + + +* `_0` (value: `0`) + +* `_1` (value: `1`) + +* `_2` (value: `2`) + +* `_3` (value: `3`) + +* `_4` (value: `4`) + +* `_5` (value: `5`) + +* `_6` (value: `6`) + + diff --git a/samples/client/petstore/javascript-promise/docs/ModelBoolean.md b/samples/client/petstore/javascript-promise/docs/ModelBoolean.md new file mode 100644 index 00000000000..726dd7e9892 --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/ModelBoolean.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.ModelBoolean + +## Enum + + +* `_true` (value: `true`) + +* `_false` (value: `false`) + + diff --git a/samples/client/petstore/javascript-promise/docs/Numbers.md b/samples/client/petstore/javascript-promise/docs/Numbers.md new file mode 100644 index 00000000000..93fd4901f06 --- /dev/null +++ b/samples/client/petstore/javascript-promise/docs/Numbers.md @@ -0,0 +1,14 @@ +# SwaggerPetstore.Numbers + +## Enum + + +* `_7` (value: `7`) + +* `_8` (value: `8`) + +* `_9` (value: `9`) + +* `_10` (value: `10`) + + diff --git a/samples/client/petstore/javascript-promise/src/ApiClient.js b/samples/client/petstore/javascript-promise/src/ApiClient.js index 56ff623d99c..b8a460a05fa 100644 --- a/samples/client/petstore/javascript-promise/src/ApiClient.js +++ b/samples/client/petstore/javascript-promise/src/ApiClient.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js index ab363bb6bda..1a6124b88d7 100644 --- a/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/AnotherFakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeApi.js b/samples/client/petstore/javascript-promise/src/api/FakeApi.js index 2ab42c00edf..6787bd5395e 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeApi.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js index 0c209d3c2f7..8eab80e6989 100644 --- a/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript-promise/src/api/FakeClassnameTags123Api.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/PetApi.js b/samples/client/petstore/javascript-promise/src/api/PetApi.js index 4d3a57aebbc..955dcc4ea2a 100644 --- a/samples/client/petstore/javascript-promise/src/api/PetApi.js +++ b/samples/client/petstore/javascript-promise/src/api/PetApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/StoreApi.js b/samples/client/petstore/javascript-promise/src/api/StoreApi.js index d9ed668937e..0ed0516c2bd 100644 --- a/samples/client/petstore/javascript-promise/src/api/StoreApi.js +++ b/samples/client/petstore/javascript-promise/src/api/StoreApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/api/UserApi.js b/samples/client/petstore/javascript-promise/src/api/UserApi.js index 87eb3a6b972..59a67926e04 100644 --- a/samples/client/petstore/javascript-promise/src/api/UserApi.js +++ b/samples/client/petstore/javascript-promise/src/api/UserApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/index.js b/samples/client/petstore/javascript-promise/src/index.js index c2c51271854..797f4c56d52 100644 --- a/samples/client/petstore/javascript-promise/src/index.js +++ b/samples/client/petstore/javascript-promise/src/index.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/Ints', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelBoolean', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Numbers', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/Ints'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelBoolean'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Numbers'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, Ints, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelBoolean, ModelReturn, Name, NumberOnly, Numbers, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -102,6 +102,11 @@ * @property {module:model/Capitalization} */ Capitalization: Capitalization, + /** + * The Cat model constructor. + * @property {module:model/Cat} + */ + Cat: Cat, /** * The Category model constructor. * @property {module:model/Category} @@ -117,6 +122,11 @@ * @property {module:model/Client} */ Client: Client, + /** + * The Dog model constructor. + * @property {module:model/Dog} + */ + Dog: Dog, /** * The EnumArrays model constructor. * @property {module:model/EnumArrays} @@ -142,6 +152,11 @@ * @property {module:model/HasOnlyReadOnly} */ HasOnlyReadOnly: HasOnlyReadOnly, + /** + * The Ints model constructor. + * @property {module:model/Ints} + */ + Ints: Ints, /** * The List model constructor. * @property {module:model/List} @@ -162,6 +177,11 @@ * @property {module:model/Model200Response} */ Model200Response: Model200Response, + /** + * The ModelBoolean model constructor. + * @property {module:model/ModelBoolean} + */ + ModelBoolean: ModelBoolean, /** * The ModelReturn model constructor. * @property {module:model/ModelReturn} @@ -177,6 +197,11 @@ * @property {module:model/NumberOnly} */ NumberOnly: NumberOnly, + /** + * The Numbers model constructor. + * @property {module:model/Numbers} + */ + Numbers: Numbers, /** * The Order model constructor. * @property {module:model/Order} @@ -232,16 +257,6 @@ * @property {module:model/User} */ User: User, - /** - * The Cat model constructor. - * @property {module:model/Cat} - */ - Cat: Cat, - /** - * The Dog model constructor. - * @property {module:model/Dog} - */ - Dog: Dog, /** * The AnotherFakeApi service constructor. * @property {module:api/AnotherFakeApi} diff --git a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js index b4556bbea80..7cd76ec3ee3 100644 --- a/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/AdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.mapOfMapProperty = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Animal.js b/samples/client/petstore/javascript-promise/src/model/Animal.js index 476b94f5703..47edcd1c604 100644 --- a/samples/client/petstore/javascript-promise/src/model/Animal.js +++ b/samples/client/petstore/javascript-promise/src/model/Animal.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -76,6 +76,7 @@ */ exports.prototype.color = 'red'; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js b/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js index 4d931c445aa..ff9628066b4 100644 --- a/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -62,6 +62,7 @@ } Object.setPrototypeOf(exports.prototype, new Array()); + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js index 5498ff0dbf6..da0c22dcc92 100644 --- a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.message = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js index cc7b6d1115d..f608f4d9b93 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.arrayArrayNumber = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js index aa87b50174e..3a7c8977bf8 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.arrayNumber = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js index a4c824dde13..7c949698795 100644 --- a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.arrayArrayOfModel = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Capitalization.js b/samples/client/petstore/javascript-promise/src/model/Capitalization.js index e57f49c4d12..72b9089712e 100644 --- a/samples/client/petstore/javascript-promise/src/model/Capitalization.js +++ b/samples/client/petstore/javascript-promise/src/model/Capitalization.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -102,6 +102,7 @@ */ exports.prototype.ATT_NAME = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Cat.js b/samples/client/petstore/javascript-promise/src/model/Cat.js index 91dd1dd31e7..b42e39b8ed5 100644 --- a/samples/client/petstore/javascript-promise/src/model/Cat.js +++ b/samples/client/petstore/javascript-promise/src/model/Cat.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -72,6 +72,7 @@ */ exports.prototype.declawed = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Category.js b/samples/client/petstore/javascript-promise/src/model/Category.js index 44af7aff4af..1cc589f2349 100644 --- a/samples/client/petstore/javascript-promise/src/model/Category.js +++ b/samples/client/petstore/javascript-promise/src/model/Category.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.name = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/ClassModel.js b/samples/client/petstore/javascript-promise/src/model/ClassModel.js index f8637b603b7..aabc4fb96ac 100644 --- a/samples/client/petstore/javascript-promise/src/model/ClassModel.js +++ b/samples/client/petstore/javascript-promise/src/model/ClassModel.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -67,6 +67,7 @@ */ exports.prototype._class = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Client.js b/samples/client/petstore/javascript-promise/src/model/Client.js index ac162078cfe..a44516d1f7b 100644 --- a/samples/client/petstore/javascript-promise/src/model/Client.js +++ b/samples/client/petstore/javascript-promise/src/model/Client.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.client = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Dog.js b/samples/client/petstore/javascript-promise/src/model/Dog.js index b0d92d8007d..f2104536924 100644 --- a/samples/client/petstore/javascript-promise/src/model/Dog.js +++ b/samples/client/petstore/javascript-promise/src/model/Dog.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -72,6 +72,7 @@ */ exports.prototype.breed = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js index 89b926cc0ed..fecb50ad076 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -74,6 +74,7 @@ exports.prototype.arrayEnum = undefined; + /** * Allowed values for the justSymbol property. * @enum {String} diff --git a/samples/client/petstore/javascript-promise/src/model/EnumClass.js b/samples/client/petstore/javascript-promise/src/model/EnumClass.js index 3ca437dab09..174f3cca5c3 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumClass.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumTest.js b/samples/client/petstore/javascript-promise/src/model/EnumTest.js index 34769c17890..c661b56fbe6 100644 --- a/samples/client/petstore/javascript-promise/src/model/EnumTest.js +++ b/samples/client/petstore/javascript-promise/src/model/EnumTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -97,6 +97,7 @@ exports.prototype.outerEnum = undefined; + /** * Allowed values for the enumString property. * @enum {String} diff --git a/samples/client/petstore/javascript-promise/src/model/FormatTest.js b/samples/client/petstore/javascript-promise/src/model/FormatTest.js index 626843b704c..777863572c3 100644 --- a/samples/client/petstore/javascript-promise/src/model/FormatTest.js +++ b/samples/client/petstore/javascript-promise/src/model/FormatTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -158,6 +158,7 @@ */ exports.prototype.password = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js index dc9c99c0131..30c458c51b2 100644 --- a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.foo = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Ints.js b/samples/client/petstore/javascript-promise/src/model/Ints.js new file mode 100644 index 00000000000..a23423ad3f6 --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/Ints.js @@ -0,0 +1,93 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.Ints = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + /** + * Enum class Ints. + * @enum {Number} + * @readonly + */ + var exports = { + /** + * value: 0 + * @const + */ + _0: 0, + + /** + * value: 1 + * @const + */ + _1: 1, + + /** + * value: 2 + * @const + */ + _2: 2, + + /** + * value: 3 + * @const + */ + _3: 3, + + /** + * value: 4 + * @const + */ + _4: 4, + + /** + * value: 5 + * @const + */ + _5: 5, + + /** + * value: 6 + * @const + */ + _6: 6 + }; + + /** + * Returns a Ints enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Ints} The enum Ints value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); diff --git a/samples/client/petstore/javascript-promise/src/model/List.js b/samples/client/petstore/javascript-promise/src/model/List.js index 4a69e433884..6d15660cee8 100644 --- a/samples/client/petstore/javascript-promise/src/model/List.js +++ b/samples/client/petstore/javascript-promise/src/model/List.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype._123List = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/MapTest.js b/samples/client/petstore/javascript-promise/src/model/MapTest.js index ddf6ec6913f..4734b8cd3e4 100644 --- a/samples/client/petstore/javascript-promise/src/model/MapTest.js +++ b/samples/client/petstore/javascript-promise/src/model/MapTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -74,6 +74,7 @@ exports.prototype.mapOfEnumString = undefined; + /** * Allowed values for the inner property. * @enum {String} diff --git a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 5c7381e3e25..a4ddcf03f9d 100644 --- a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.map = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Model200Response.js b/samples/client/petstore/javascript-promise/src/model/Model200Response.js index 5198ae0a2c4..1094ae9d7a1 100644 --- a/samples/client/petstore/javascript-promise/src/model/Model200Response.js +++ b/samples/client/petstore/javascript-promise/src/model/Model200Response.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -74,6 +74,7 @@ */ exports.prototype._class = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/ModelBoolean.js b/samples/client/petstore/javascript-promise/src/model/ModelBoolean.js new file mode 100644 index 00000000000..827fbc85cce --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/ModelBoolean.js @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.ModelBoolean = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + /** + * Enum class ModelBoolean. + * @enum {Boolean} + * @readonly + */ + var exports = { + /** + * value: true + * @const + */ + _true: true, + + /** + * value: false + * @const + */ + _false: false + }; + + /** + * Returns a ModelBoolean enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/ModelBoolean} The enum ModelBoolean value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); diff --git a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js index a3b7baf8855..c26c3145000 100644 --- a/samples/client/petstore/javascript-promise/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript-promise/src/model/ModelReturn.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -67,6 +67,7 @@ */ exports.prototype._return = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Name.js b/samples/client/petstore/javascript-promise/src/model/Name.js index 6f0a72cd41b..3170f1c80f6 100644 --- a/samples/client/petstore/javascript-promise/src/model/Name.js +++ b/samples/client/petstore/javascript-promise/src/model/Name.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -90,6 +90,7 @@ */ exports.prototype._123Number = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js index ecad15c65f7..28d68ff6f2c 100644 --- a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.justNumber = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Numbers.js b/samples/client/petstore/javascript-promise/src/model/Numbers.js new file mode 100644 index 00000000000..391a530440c --- /dev/null +++ b/samples/client/petstore/javascript-promise/src/model/Numbers.js @@ -0,0 +1,75 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.Numbers = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + /** + * Enum class Numbers. + * @enum {Number} + * @readonly + */ + var exports = { + /** + * value: 7 + * @const + */ + _7: 7, + + /** + * value: 8 + * @const + */ + _8: 8, + + /** + * value: 9 + * @const + */ + _9: 9, + + /** + * value: 10 + * @const + */ + _10: 10 + }; + + /** + * Returns a Numbers enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Numbers} The enum Numbers value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); diff --git a/samples/client/petstore/javascript-promise/src/model/Order.js b/samples/client/petstore/javascript-promise/src/model/Order.js index 647183b7b79..e3b06043704 100644 --- a/samples/client/petstore/javascript-promise/src/model/Order.js +++ b/samples/client/petstore/javascript-promise/src/model/Order.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -104,6 +104,7 @@ exports.prototype.complete = false; + /** * Allowed values for the status property. * @enum {String} diff --git a/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js b/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js index e216877e573..71044fda92c 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -56,6 +56,7 @@ return data; } + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js index 2d83d642b09..b739c499ec7 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.myBoolean = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js index 5e59925dcea..cde7d38fb18 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterNumber.js b/samples/client/petstore/javascript-promise/src/model/OuterNumber.js index 593efea443f..e026ebd45bc 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterNumber.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterNumber.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -56,6 +56,7 @@ return data; } + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/OuterString.js b/samples/client/petstore/javascript-promise/src/model/OuterString.js index 97dc19f5292..998f1e5f609 100644 --- a/samples/client/petstore/javascript-promise/src/model/OuterString.js +++ b/samples/client/petstore/javascript-promise/src/model/OuterString.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -56,6 +56,7 @@ return data; } + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Pet.js b/samples/client/petstore/javascript-promise/src/model/Pet.js index b90c95af245..c8d044920b6 100644 --- a/samples/client/petstore/javascript-promise/src/model/Pet.js +++ b/samples/client/petstore/javascript-promise/src/model/Pet.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -107,6 +107,7 @@ exports.prototype.status = undefined; + /** * Allowed values for the status property. * @enum {String} diff --git a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js index 4f7d7915cea..64fecfb278d 100644 --- a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.baz = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js index c064f24336d..a2395cd50f4 100644 --- a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.specialPropertyName = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/Tag.js b/samples/client/petstore/javascript-promise/src/model/Tag.js index 9deb39464f5..e83f765379c 100644 --- a/samples/client/petstore/javascript-promise/src/model/Tag.js +++ b/samples/client/petstore/javascript-promise/src/model/Tag.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.name = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js index 873c8518689..b93a100b03f 100644 --- a/samples/client/petstore/javascript-promise/src/model/User.js +++ b/samples/client/petstore/javascript-promise/src/model/User.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -116,6 +116,7 @@ */ exports.prototype.userStatus = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript-promise/test/model/Ints.spec.js b/samples/client/petstore/javascript-promise/test/model/Ints.spec.js new file mode 100644 index 00000000000..5acd21643bb --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/Ints.spec.js @@ -0,0 +1,82 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Ints', function() { + beforeEach(function() { + instance = SwaggerPetstore.Ints; + }); + + it('should create an instance of Ints', function() { + // TODO: update the code to test Ints + expect(instance).to.be.a('object'); + }); + + it('should have the property _0', function() { + expect(instance).to.have.property('_0'); + expect(instance._0).to.be(0); + }); + + it('should have the property _1', function() { + expect(instance).to.have.property('_1'); + expect(instance._1).to.be(1); + }); + + it('should have the property _2', function() { + expect(instance).to.have.property('_2'); + expect(instance._2).to.be(2); + }); + + it('should have the property _3', function() { + expect(instance).to.have.property('_3'); + expect(instance._3).to.be(3); + }); + + it('should have the property _4', function() { + expect(instance).to.have.property('_4'); + expect(instance._4).to.be(4); + }); + + it('should have the property _5', function() { + expect(instance).to.have.property('_5'); + expect(instance._5).to.be(5); + }); + + it('should have the property _6', function() { + expect(instance).to.have.property('_6'); + expect(instance._6).to.be(6); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise/test/model/ModelBoolean.spec.js b/samples/client/petstore/javascript-promise/test/model/ModelBoolean.spec.js new file mode 100644 index 00000000000..43707f907e0 --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/ModelBoolean.spec.js @@ -0,0 +1,57 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('ModelBoolean', function() { + beforeEach(function() { + instance = SwaggerPetstore.ModelBoolean; + }); + + it('should create an instance of ModelBoolean', function() { + // TODO: update the code to test ModelBoolean + expect(instance).to.be.a('object'); + }); + + it('should have the property _true', function() { + expect(instance).to.have.property('_true'); + expect(instance._true).to.be(true); + }); + + it('should have the property _false', function() { + expect(instance).to.have.property('_false'); + expect(instance._false).to.be(false); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript-promise/test/model/Numbers.spec.js b/samples/client/petstore/javascript-promise/test/model/Numbers.spec.js new file mode 100644 index 00000000000..1f396917eea --- /dev/null +++ b/samples/client/petstore/javascript-promise/test/model/Numbers.spec.js @@ -0,0 +1,67 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Numbers', function() { + beforeEach(function() { + instance = SwaggerPetstore.Numbers; + }); + + it('should create an instance of Numbers', function() { + // TODO: update the code to test Numbers + expect(instance).to.be.a('object'); + }); + + it('should have the property _7', function() { + expect(instance).to.have.property('_7'); + expect(instance._7).to.be(7); + }); + + it('should have the property _8', function() { + expect(instance).to.have.property('_8'); + expect(instance._8).to.be(8); + }); + + it('should have the property _9', function() { + expect(instance).to.have.property('_9'); + expect(instance._9).to.be(9); + }); + + it('should have the property _10', function() { + expect(instance).to.have.property('_10'); + expect(instance._10).to.be(10); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript/.swagger-codegen/VERSION b/samples/client/petstore/javascript/.swagger-codegen/VERSION index 6cecc1a68f3..8c7754221a4 100644 --- a/samples/client/petstore/javascript/.swagger-codegen/VERSION +++ b/samples/client/petstore/javascript/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.6-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 3172081042d..01f47f7e709 100644 --- a/samples/client/petstore/javascript/README.md +++ b/samples/client/petstore/javascript/README.md @@ -161,21 +161,26 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [SwaggerPetstore.ArrayTest](docs/ArrayTest.md) - [SwaggerPetstore.Capitalization](docs/Capitalization.md) + - [SwaggerPetstore.Cat](docs/Cat.md) - [SwaggerPetstore.Category](docs/Category.md) - [SwaggerPetstore.ClassModel](docs/ClassModel.md) - [SwaggerPetstore.Client](docs/Client.md) + - [SwaggerPetstore.Dog](docs/Dog.md) - [SwaggerPetstore.EnumArrays](docs/EnumArrays.md) - [SwaggerPetstore.EnumClass](docs/EnumClass.md) - [SwaggerPetstore.EnumTest](docs/EnumTest.md) - [SwaggerPetstore.FormatTest](docs/FormatTest.md) - [SwaggerPetstore.HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [SwaggerPetstore.Ints](docs/Ints.md) - [SwaggerPetstore.List](docs/List.md) - [SwaggerPetstore.MapTest](docs/MapTest.md) - [SwaggerPetstore.MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) - [SwaggerPetstore.Model200Response](docs/Model200Response.md) + - [SwaggerPetstore.ModelBoolean](docs/ModelBoolean.md) - [SwaggerPetstore.ModelReturn](docs/ModelReturn.md) - [SwaggerPetstore.Name](docs/Name.md) - [SwaggerPetstore.NumberOnly](docs/NumberOnly.md) + - [SwaggerPetstore.Numbers](docs/Numbers.md) - [SwaggerPetstore.Order](docs/Order.md) - [SwaggerPetstore.OuterBoolean](docs/OuterBoolean.md) - [SwaggerPetstore.OuterComposite](docs/OuterComposite.md) @@ -187,8 +192,6 @@ Class | Method | HTTP request | Description - [SwaggerPetstore.SpecialModelName](docs/SpecialModelName.md) - [SwaggerPetstore.Tag](docs/Tag.md) - [SwaggerPetstore.User](docs/User.md) - - [SwaggerPetstore.Cat](docs/Cat.md) - - [SwaggerPetstore.Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/javascript/docs/Ints.md b/samples/client/petstore/javascript/docs/Ints.md new file mode 100644 index 00000000000..4a4e8c4f370 --- /dev/null +++ b/samples/client/petstore/javascript/docs/Ints.md @@ -0,0 +1,20 @@ +# SwaggerPetstore.Ints + +## Enum + + +* `_0` (value: `0`) + +* `_1` (value: `1`) + +* `_2` (value: `2`) + +* `_3` (value: `3`) + +* `_4` (value: `4`) + +* `_5` (value: `5`) + +* `_6` (value: `6`) + + diff --git a/samples/client/petstore/javascript/docs/ModelBoolean.md b/samples/client/petstore/javascript/docs/ModelBoolean.md new file mode 100644 index 00000000000..726dd7e9892 --- /dev/null +++ b/samples/client/petstore/javascript/docs/ModelBoolean.md @@ -0,0 +1,10 @@ +# SwaggerPetstore.ModelBoolean + +## Enum + + +* `_true` (value: `true`) + +* `_false` (value: `false`) + + diff --git a/samples/client/petstore/javascript/docs/Numbers.md b/samples/client/petstore/javascript/docs/Numbers.md new file mode 100644 index 00000000000..93fd4901f06 --- /dev/null +++ b/samples/client/petstore/javascript/docs/Numbers.md @@ -0,0 +1,14 @@ +# SwaggerPetstore.Numbers + +## Enum + + +* `_7` (value: `7`) + +* `_8` (value: `8`) + +* `_9` (value: `9`) + +* `_10` (value: `10`) + + diff --git a/samples/client/petstore/javascript/src/ApiClient.js b/samples/client/petstore/javascript/src/ApiClient.js index 77aa6675d16..4ee20bbab12 100644 --- a/samples/client/petstore/javascript/src/ApiClient.js +++ b/samples/client/petstore/javascript/src/ApiClient.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js index de058cd12cd..53ddab30c86 100644 --- a/samples/client/petstore/javascript/src/api/AnotherFakeApi.js +++ b/samples/client/petstore/javascript/src/api/AnotherFakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeApi.js b/samples/client/petstore/javascript/src/api/FakeApi.js index 83e93cd1771..f238a44c736 100644 --- a/samples/client/petstore/javascript/src/api/FakeApi.js +++ b/samples/client/petstore/javascript/src/api/FakeApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js index f03c34cac52..3269fecd91e 100644 --- a/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js +++ b/samples/client/petstore/javascript/src/api/FakeClassnameTags123Api.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/PetApi.js b/samples/client/petstore/javascript/src/api/PetApi.js index c8cf8b73436..91065fb9f2b 100644 --- a/samples/client/petstore/javascript/src/api/PetApi.js +++ b/samples/client/petstore/javascript/src/api/PetApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/StoreApi.js b/samples/client/petstore/javascript/src/api/StoreApi.js index 9ca63e17b1b..6ff3486e5f6 100644 --- a/samples/client/petstore/javascript/src/api/StoreApi.js +++ b/samples/client/petstore/javascript/src/api/StoreApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/api/UserApi.js b/samples/client/petstore/javascript/src/api/UserApi.js index 5636e4906b6..32dcc1165a6 100644 --- a/samples/client/petstore/javascript/src/api/UserApi.js +++ b/samples/client/petstore/javascript/src/api/UserApi.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/index.js b/samples/client/petstore/javascript/src/index.js index c2c51271854..797f4c56d52 100644 --- a/samples/client/petstore/javascript/src/index.js +++ b/samples/client/petstore/javascript/src/index.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -17,12 +17,12 @@ (function(factory) { if (typeof define === 'function' && define.amd) { // AMD. Register as an anonymous module. - define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Category', 'model/ClassModel', 'model/Client', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'model/Cat', 'model/Dog', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); + define(['ApiClient', 'model/AdditionalPropertiesClass', 'model/Animal', 'model/AnimalFarm', 'model/ApiResponse', 'model/ArrayOfArrayOfNumberOnly', 'model/ArrayOfNumberOnly', 'model/ArrayTest', 'model/Capitalization', 'model/Cat', 'model/Category', 'model/ClassModel', 'model/Client', 'model/Dog', 'model/EnumArrays', 'model/EnumClass', 'model/EnumTest', 'model/FormatTest', 'model/HasOnlyReadOnly', 'model/Ints', 'model/List', 'model/MapTest', 'model/MixedPropertiesAndAdditionalPropertiesClass', 'model/Model200Response', 'model/ModelBoolean', 'model/ModelReturn', 'model/Name', 'model/NumberOnly', 'model/Numbers', 'model/Order', 'model/OuterBoolean', 'model/OuterComposite', 'model/OuterEnum', 'model/OuterNumber', 'model/OuterString', 'model/Pet', 'model/ReadOnlyFirst', 'model/SpecialModelName', 'model/Tag', 'model/User', 'api/AnotherFakeApi', 'api/FakeApi', 'api/FakeClassnameTags123Api', 'api/PetApi', 'api/StoreApi', 'api/UserApi'], factory); } else if (typeof module === 'object' && module.exports) { // CommonJS-like environments that support module.exports, like Node. - module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./model/Cat'), require('./model/Dog'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); + module.exports = factory(require('./ApiClient'), require('./model/AdditionalPropertiesClass'), require('./model/Animal'), require('./model/AnimalFarm'), require('./model/ApiResponse'), require('./model/ArrayOfArrayOfNumberOnly'), require('./model/ArrayOfNumberOnly'), require('./model/ArrayTest'), require('./model/Capitalization'), require('./model/Cat'), require('./model/Category'), require('./model/ClassModel'), require('./model/Client'), require('./model/Dog'), require('./model/EnumArrays'), require('./model/EnumClass'), require('./model/EnumTest'), require('./model/FormatTest'), require('./model/HasOnlyReadOnly'), require('./model/Ints'), require('./model/List'), require('./model/MapTest'), require('./model/MixedPropertiesAndAdditionalPropertiesClass'), require('./model/Model200Response'), require('./model/ModelBoolean'), require('./model/ModelReturn'), require('./model/Name'), require('./model/NumberOnly'), require('./model/Numbers'), require('./model/Order'), require('./model/OuterBoolean'), require('./model/OuterComposite'), require('./model/OuterEnum'), require('./model/OuterNumber'), require('./model/OuterString'), require('./model/Pet'), require('./model/ReadOnlyFirst'), require('./model/SpecialModelName'), require('./model/Tag'), require('./model/User'), require('./api/AnotherFakeApi'), require('./api/FakeApi'), require('./api/FakeClassnameTags123Api'), require('./api/PetApi'), require('./api/StoreApi'), require('./api/UserApi')); } -}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Category, ClassModel, Client, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelReturn, Name, NumberOnly, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, Cat, Dog, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { +}(function(ApiClient, AdditionalPropertiesClass, Animal, AnimalFarm, ApiResponse, ArrayOfArrayOfNumberOnly, ArrayOfNumberOnly, ArrayTest, Capitalization, Cat, Category, ClassModel, Client, Dog, EnumArrays, EnumClass, EnumTest, FormatTest, HasOnlyReadOnly, Ints, List, MapTest, MixedPropertiesAndAdditionalPropertiesClass, Model200Response, ModelBoolean, ModelReturn, Name, NumberOnly, Numbers, Order, OuterBoolean, OuterComposite, OuterEnum, OuterNumber, OuterString, Pet, ReadOnlyFirst, SpecialModelName, Tag, User, AnotherFakeApi, FakeApi, FakeClassnameTags123Api, PetApi, StoreApi, UserApi) { 'use strict'; /** @@ -102,6 +102,11 @@ * @property {module:model/Capitalization} */ Capitalization: Capitalization, + /** + * The Cat model constructor. + * @property {module:model/Cat} + */ + Cat: Cat, /** * The Category model constructor. * @property {module:model/Category} @@ -117,6 +122,11 @@ * @property {module:model/Client} */ Client: Client, + /** + * The Dog model constructor. + * @property {module:model/Dog} + */ + Dog: Dog, /** * The EnumArrays model constructor. * @property {module:model/EnumArrays} @@ -142,6 +152,11 @@ * @property {module:model/HasOnlyReadOnly} */ HasOnlyReadOnly: HasOnlyReadOnly, + /** + * The Ints model constructor. + * @property {module:model/Ints} + */ + Ints: Ints, /** * The List model constructor. * @property {module:model/List} @@ -162,6 +177,11 @@ * @property {module:model/Model200Response} */ Model200Response: Model200Response, + /** + * The ModelBoolean model constructor. + * @property {module:model/ModelBoolean} + */ + ModelBoolean: ModelBoolean, /** * The ModelReturn model constructor. * @property {module:model/ModelReturn} @@ -177,6 +197,11 @@ * @property {module:model/NumberOnly} */ NumberOnly: NumberOnly, + /** + * The Numbers model constructor. + * @property {module:model/Numbers} + */ + Numbers: Numbers, /** * The Order model constructor. * @property {module:model/Order} @@ -232,16 +257,6 @@ * @property {module:model/User} */ User: User, - /** - * The Cat model constructor. - * @property {module:model/Cat} - */ - Cat: Cat, - /** - * The Dog model constructor. - * @property {module:model/Dog} - */ - Dog: Dog, /** * The AnotherFakeApi service constructor. * @property {module:api/AnotherFakeApi} diff --git a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js index b4556bbea80..7cd76ec3ee3 100644 --- a/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/AdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.mapOfMapProperty = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index 476b94f5703..47edcd1c604 100644 --- a/samples/client/petstore/javascript/src/model/Animal.js +++ b/samples/client/petstore/javascript/src/model/Animal.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -76,6 +76,7 @@ */ exports.prototype.color = 'red'; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/AnimalFarm.js b/samples/client/petstore/javascript/src/model/AnimalFarm.js index 4d931c445aa..ff9628066b4 100644 --- a/samples/client/petstore/javascript/src/model/AnimalFarm.js +++ b/samples/client/petstore/javascript/src/model/AnimalFarm.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -62,6 +62,7 @@ } Object.setPrototypeOf(exports.prototype, new Array()); + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/ApiResponse.js b/samples/client/petstore/javascript/src/model/ApiResponse.js index 5498ff0dbf6..da0c22dcc92 100644 --- a/samples/client/petstore/javascript/src/model/ApiResponse.js +++ b/samples/client/petstore/javascript/src/model/ApiResponse.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.message = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js index cc7b6d1115d..f608f4d9b93 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.arrayArrayNumber = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js index aa87b50174e..3a7c8977bf8 100644 --- a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js +++ b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.arrayNumber = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/ArrayTest.js b/samples/client/petstore/javascript/src/model/ArrayTest.js index a4c824dde13..7c949698795 100644 --- a/samples/client/petstore/javascript/src/model/ArrayTest.js +++ b/samples/client/petstore/javascript/src/model/ArrayTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.arrayArrayOfModel = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Capitalization.js b/samples/client/petstore/javascript/src/model/Capitalization.js index e57f49c4d12..72b9089712e 100644 --- a/samples/client/petstore/javascript/src/model/Capitalization.js +++ b/samples/client/petstore/javascript/src/model/Capitalization.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -102,6 +102,7 @@ */ exports.prototype.ATT_NAME = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Cat.js b/samples/client/petstore/javascript/src/model/Cat.js index 91dd1dd31e7..b42e39b8ed5 100644 --- a/samples/client/petstore/javascript/src/model/Cat.js +++ b/samples/client/petstore/javascript/src/model/Cat.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -72,6 +72,7 @@ */ exports.prototype.declawed = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js index 44af7aff4af..1cc589f2349 100644 --- a/samples/client/petstore/javascript/src/model/Category.js +++ b/samples/client/petstore/javascript/src/model/Category.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.name = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/ClassModel.js b/samples/client/petstore/javascript/src/model/ClassModel.js index f8637b603b7..aabc4fb96ac 100644 --- a/samples/client/petstore/javascript/src/model/ClassModel.js +++ b/samples/client/petstore/javascript/src/model/ClassModel.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -67,6 +67,7 @@ */ exports.prototype._class = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Client.js b/samples/client/petstore/javascript/src/model/Client.js index ac162078cfe..a44516d1f7b 100644 --- a/samples/client/petstore/javascript/src/model/Client.js +++ b/samples/client/petstore/javascript/src/model/Client.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.client = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Dog.js b/samples/client/petstore/javascript/src/model/Dog.js index b0d92d8007d..f2104536924 100644 --- a/samples/client/petstore/javascript/src/model/Dog.js +++ b/samples/client/petstore/javascript/src/model/Dog.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -72,6 +72,7 @@ */ exports.prototype.breed = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/EnumArrays.js b/samples/client/petstore/javascript/src/model/EnumArrays.js index 89b926cc0ed..fecb50ad076 100644 --- a/samples/client/petstore/javascript/src/model/EnumArrays.js +++ b/samples/client/petstore/javascript/src/model/EnumArrays.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -74,6 +74,7 @@ exports.prototype.arrayEnum = undefined; + /** * Allowed values for the justSymbol property. * @enum {String} diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js index 3ca437dab09..174f3cca5c3 100644 --- a/samples/client/petstore/javascript/src/model/EnumClass.js +++ b/samples/client/petstore/javascript/src/model/EnumClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumTest.js b/samples/client/petstore/javascript/src/model/EnumTest.js index 34769c17890..c661b56fbe6 100644 --- a/samples/client/petstore/javascript/src/model/EnumTest.js +++ b/samples/client/petstore/javascript/src/model/EnumTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -97,6 +97,7 @@ exports.prototype.outerEnum = undefined; + /** * Allowed values for the enumString property. * @enum {String} diff --git a/samples/client/petstore/javascript/src/model/FormatTest.js b/samples/client/petstore/javascript/src/model/FormatTest.js index 626843b704c..777863572c3 100644 --- a/samples/client/petstore/javascript/src/model/FormatTest.js +++ b/samples/client/petstore/javascript/src/model/FormatTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -158,6 +158,7 @@ */ exports.prototype.password = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js index dc9c99c0131..30c458c51b2 100644 --- a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js +++ b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.foo = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Ints.js b/samples/client/petstore/javascript/src/model/Ints.js new file mode 100644 index 00000000000..a23423ad3f6 --- /dev/null +++ b/samples/client/petstore/javascript/src/model/Ints.js @@ -0,0 +1,93 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.Ints = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + /** + * Enum class Ints. + * @enum {Number} + * @readonly + */ + var exports = { + /** + * value: 0 + * @const + */ + _0: 0, + + /** + * value: 1 + * @const + */ + _1: 1, + + /** + * value: 2 + * @const + */ + _2: 2, + + /** + * value: 3 + * @const + */ + _3: 3, + + /** + * value: 4 + * @const + */ + _4: 4, + + /** + * value: 5 + * @const + */ + _5: 5, + + /** + * value: 6 + * @const + */ + _6: 6 + }; + + /** + * Returns a Ints enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Ints} The enum Ints value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/model/List.js b/samples/client/petstore/javascript/src/model/List.js index 4a69e433884..6d15660cee8 100644 --- a/samples/client/petstore/javascript/src/model/List.js +++ b/samples/client/petstore/javascript/src/model/List.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype._123List = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/MapTest.js b/samples/client/petstore/javascript/src/model/MapTest.js index ddf6ec6913f..4734b8cd3e4 100644 --- a/samples/client/petstore/javascript/src/model/MapTest.js +++ b/samples/client/petstore/javascript/src/model/MapTest.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -74,6 +74,7 @@ exports.prototype.mapOfEnumString = undefined; + /** * Allowed values for the inner property. * @enum {String} diff --git a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 5c7381e3e25..a4ddcf03f9d 100644 --- a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js +++ b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.map = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js index 5198ae0a2c4..1094ae9d7a1 100644 --- a/samples/client/petstore/javascript/src/model/Model200Response.js +++ b/samples/client/petstore/javascript/src/model/Model200Response.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -74,6 +74,7 @@ */ exports.prototype._class = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/ModelBoolean.js b/samples/client/petstore/javascript/src/model/ModelBoolean.js new file mode 100644 index 00000000000..827fbc85cce --- /dev/null +++ b/samples/client/petstore/javascript/src/model/ModelBoolean.js @@ -0,0 +1,63 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.ModelBoolean = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + /** + * Enum class ModelBoolean. + * @enum {Boolean} + * @readonly + */ + var exports = { + /** + * value: true + * @const + */ + _true: true, + + /** + * value: false + * @const + */ + _false: false + }; + + /** + * Returns a ModelBoolean enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/ModelBoolean} The enum ModelBoolean value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/model/ModelReturn.js b/samples/client/petstore/javascript/src/model/ModelReturn.js index a3b7baf8855..c26c3145000 100644 --- a/samples/client/petstore/javascript/src/model/ModelReturn.js +++ b/samples/client/petstore/javascript/src/model/ModelReturn.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -67,6 +67,7 @@ */ exports.prototype._return = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index 6f0a72cd41b..3170f1c80f6 100644 --- a/samples/client/petstore/javascript/src/model/Name.js +++ b/samples/client/petstore/javascript/src/model/Name.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -90,6 +90,7 @@ */ exports.prototype._123Number = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/NumberOnly.js b/samples/client/petstore/javascript/src/model/NumberOnly.js index ecad15c65f7..28d68ff6f2c 100644 --- a/samples/client/petstore/javascript/src/model/NumberOnly.js +++ b/samples/client/petstore/javascript/src/model/NumberOnly.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.justNumber = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Numbers.js b/samples/client/petstore/javascript/src/model/Numbers.js new file mode 100644 index 00000000000..391a530440c --- /dev/null +++ b/samples/client/petstore/javascript/src/model/Numbers.js @@ -0,0 +1,75 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.19-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Register as an anonymous module. + define(['ApiClient'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + module.exports = factory(require('../ApiClient')); + } else { + // Browser globals (root is window) + if (!root.SwaggerPetstore) { + root.SwaggerPetstore = {}; + } + root.SwaggerPetstore.Numbers = factory(root.SwaggerPetstore.ApiClient); + } +}(this, function(ApiClient) { + 'use strict'; + + /** + * Enum class Numbers. + * @enum {Number} + * @readonly + */ + var exports = { + /** + * value: 7 + * @const + */ + _7: 7, + + /** + * value: 8 + * @const + */ + _8: 8, + + /** + * value: 9 + * @const + */ + _9: 9, + + /** + * value: 10 + * @const + */ + _10: 10 + }; + + /** + * Returns a Numbers enum value from a JavaScript object name. + * @param {Object} data The plain JavaScript object containing the name of the enum value. + * @return {module:model/Numbers} The enum Numbers value. + */ + exports.constructFromObject = function(object) { + return object; + } + + return exports; +})); diff --git a/samples/client/petstore/javascript/src/model/Order.js b/samples/client/petstore/javascript/src/model/Order.js index 647183b7b79..e3b06043704 100644 --- a/samples/client/petstore/javascript/src/model/Order.js +++ b/samples/client/petstore/javascript/src/model/Order.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -104,6 +104,7 @@ exports.prototype.complete = false; + /** * Allowed values for the status property. * @enum {String} diff --git a/samples/client/petstore/javascript/src/model/OuterBoolean.js b/samples/client/petstore/javascript/src/model/OuterBoolean.js index e216877e573..71044fda92c 100644 --- a/samples/client/petstore/javascript/src/model/OuterBoolean.js +++ b/samples/client/petstore/javascript/src/model/OuterBoolean.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -56,6 +56,7 @@ return data; } + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/OuterComposite.js b/samples/client/petstore/javascript/src/model/OuterComposite.js index 2d83d642b09..b739c499ec7 100644 --- a/samples/client/petstore/javascript/src/model/OuterComposite.js +++ b/samples/client/petstore/javascript/src/model/OuterComposite.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -80,6 +80,7 @@ */ exports.prototype.myBoolean = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/OuterEnum.js b/samples/client/petstore/javascript/src/model/OuterEnum.js index 5e59925dcea..cde7d38fb18 100644 --- a/samples/client/petstore/javascript/src/model/OuterEnum.js +++ b/samples/client/petstore/javascript/src/model/OuterEnum.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterNumber.js b/samples/client/petstore/javascript/src/model/OuterNumber.js index 593efea443f..e026ebd45bc 100644 --- a/samples/client/petstore/javascript/src/model/OuterNumber.js +++ b/samples/client/petstore/javascript/src/model/OuterNumber.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -56,6 +56,7 @@ return data; } + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/OuterString.js b/samples/client/petstore/javascript/src/model/OuterString.js index 97dc19f5292..998f1e5f609 100644 --- a/samples/client/petstore/javascript/src/model/OuterString.js +++ b/samples/client/petstore/javascript/src/model/OuterString.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -56,6 +56,7 @@ return data; } + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index b90c95af245..c8d044920b6 100644 --- a/samples/client/petstore/javascript/src/model/Pet.js +++ b/samples/client/petstore/javascript/src/model/Pet.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -107,6 +107,7 @@ exports.prototype.status = undefined; + /** * Allowed values for the status property. * @enum {String} diff --git a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js index 4f7d7915cea..64fecfb278d 100644 --- a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js +++ b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.baz = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js index c064f24336d..a2395cd50f4 100644 --- a/samples/client/petstore/javascript/src/model/SpecialModelName.js +++ b/samples/client/petstore/javascript/src/model/SpecialModelName.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -66,6 +66,7 @@ */ exports.prototype.specialPropertyName = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js index 9deb39464f5..e83f765379c 100644 --- a/samples/client/petstore/javascript/src/model/Tag.js +++ b/samples/client/petstore/javascript/src/model/Tag.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -73,6 +73,7 @@ */ exports.prototype.name = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index 873c8518689..b93a100b03f 100644 --- a/samples/client/petstore/javascript/src/model/User.js +++ b/samples/client/petstore/javascript/src/model/User.js @@ -8,7 +8,7 @@ * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * - * Swagger Codegen version: 2.4.6-SNAPSHOT + * Swagger Codegen version: 2.4.19-SNAPSHOT * * Do not edit the class manually. * @@ -116,6 +116,7 @@ */ exports.prototype.userStatus = undefined; + return exports; })); diff --git a/samples/client/petstore/javascript/test/model/Ints.spec.js b/samples/client/petstore/javascript/test/model/Ints.spec.js new file mode 100644 index 00000000000..5acd21643bb --- /dev/null +++ b/samples/client/petstore/javascript/test/model/Ints.spec.js @@ -0,0 +1,82 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Ints', function() { + beforeEach(function() { + instance = SwaggerPetstore.Ints; + }); + + it('should create an instance of Ints', function() { + // TODO: update the code to test Ints + expect(instance).to.be.a('object'); + }); + + it('should have the property _0', function() { + expect(instance).to.have.property('_0'); + expect(instance._0).to.be(0); + }); + + it('should have the property _1', function() { + expect(instance).to.have.property('_1'); + expect(instance._1).to.be(1); + }); + + it('should have the property _2', function() { + expect(instance).to.have.property('_2'); + expect(instance._2).to.be(2); + }); + + it('should have the property _3', function() { + expect(instance).to.have.property('_3'); + expect(instance._3).to.be(3); + }); + + it('should have the property _4', function() { + expect(instance).to.have.property('_4'); + expect(instance._4).to.be(4); + }); + + it('should have the property _5', function() { + expect(instance).to.have.property('_5'); + expect(instance._5).to.be(5); + }); + + it('should have the property _6', function() { + expect(instance).to.have.property('_6'); + expect(instance._6).to.be(6); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript/test/model/ModelBoolean.spec.js b/samples/client/petstore/javascript/test/model/ModelBoolean.spec.js new file mode 100644 index 00000000000..43707f907e0 --- /dev/null +++ b/samples/client/petstore/javascript/test/model/ModelBoolean.spec.js @@ -0,0 +1,57 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('ModelBoolean', function() { + beforeEach(function() { + instance = SwaggerPetstore.ModelBoolean; + }); + + it('should create an instance of ModelBoolean', function() { + // TODO: update the code to test ModelBoolean + expect(instance).to.be.a('object'); + }); + + it('should have the property _true', function() { + expect(instance).to.have.property('_true'); + expect(instance._true).to.be(true); + }); + + it('should have the property _false', function() { + expect(instance).to.have.property('_false'); + expect(instance._false).to.be(false); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/javascript/test/model/Numbers.spec.js b/samples/client/petstore/javascript/test/model/Numbers.spec.js new file mode 100644 index 00000000000..1f396917eea --- /dev/null +++ b/samples/client/petstore/javascript/test/model/Numbers.spec.js @@ -0,0 +1,67 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.4.18-SNAPSHOT + * + * Do not edit the class manually. + * + */ + +(function(root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. + define(['expect.js', '../../src/index'], factory); + } else if (typeof module === 'object' && module.exports) { + // CommonJS-like environments that support module.exports, like Node. + factory(require('expect.js'), require('../../src/index')); + } else { + // Browser globals (root is window) + factory(root.expect, root.SwaggerPetstore); + } +}(this, function(expect, SwaggerPetstore) { + 'use strict'; + + var instance; + + describe('(package)', function() { + describe('Numbers', function() { + beforeEach(function() { + instance = SwaggerPetstore.Numbers; + }); + + it('should create an instance of Numbers', function() { + // TODO: update the code to test Numbers + expect(instance).to.be.a('object'); + }); + + it('should have the property _7', function() { + expect(instance).to.have.property('_7'); + expect(instance._7).to.be(7); + }); + + it('should have the property _8', function() { + expect(instance).to.have.property('_8'); + expect(instance._8).to.be(8); + }); + + it('should have the property _9', function() { + expect(instance).to.have.property('_9'); + expect(instance._9).to.be(9); + }); + + it('should have the property _10', function() { + expect(instance).to.have.property('_10'); + expect(instance._10).to.be(10); + }); + + }); + }); + +})); diff --git a/samples/client/petstore/jaxrs-cxf-client/.swagger-codegen/VERSION b/samples/client/petstore/jaxrs-cxf-client/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/client/petstore/jaxrs-cxf-client/.swagger-codegen/VERSION +++ b/samples/client/petstore/jaxrs-cxf-client/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/jaxrs-cxf-client/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index 85652a39c96..9ee89a973c3 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/pom.xml @@ -1,174 +1,174 @@ - 4.0.0 - io.swagger - jaxrs-cxf-petstore-client - jar - jaxrs-cxf-petstore-client - This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - 1.0.0 - - src/main/java - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - - - - - - io.swagger - swagger-jaxrs - compile - ${swagger-core-version} - - - ch.qos.logback - logback-classic - ${logback-version} - compile - - - ch.qos.logback - logback-core - ${logback-version} - compile - - - junit - junit - ${junit-version} - test - - - - org.apache.cxf - cxf-rt-rs-client - ${cxf-version} - test - + 4.0.0 + io.swagger + jaxrs-cxf-petstore-client + jar + jaxrs-cxf-petstore-client + This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + 1.0.0 + + src/main/java + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + + + + + + io.swagger + swagger-jaxrs + compile + ${swagger-core-version} + + + ch.qos.logback + logback-classic + ${logback-version} + compile + + + ch.qos.logback + logback-core + ${logback-version} + compile + + + junit + junit + ${junit-version} + test + + + + org.apache.cxf + cxf-rt-rs-client + ${cxf-version} + test + - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-rs-service-description - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-ws-policy - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-wsdl - ${cxf-version} - compile - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-jaxrs-version} - compile - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.7 - ${java.version} - ${java.version} - 1.5.18 - 9.2.9.v20150224 - 4.12 - 1.1.7 - 2.5 - 3.2.1 - 2.10.1 - UTF-8 - + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-ws-policy + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-wsdl + ${cxf-version} + compile + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.7 + ${java.version} + ${java.version} + 1.5.24 + 9.3.27.v20190418 + 4.13.1 + 1.1.7 + 2.5 + 3.2.1 + 2.11.4 + UTF-8 + diff --git a/samples/client/petstore/jaxrs-cxf/pom.xml b/samples/client/petstore/jaxrs-cxf/pom.xml index 73d0c914e38..5bdfb1eeea2 100644 --- a/samples/client/petstore/jaxrs-cxf/pom.xml +++ b/samples/client/petstore/jaxrs-cxf/pom.xml @@ -162,9 +162,9 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.2.9.v20150224 - 4.12 + 4.13.1 1.1.7 2.5 3.2.1 diff --git a/samples/client/petstore/kotlin-string/.swagger-codegen/VERSION b/samples/client/petstore/kotlin-string/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/kotlin-string/.swagger-codegen/VERSION +++ b/samples/client/petstore/kotlin-string/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-string/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-string/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt index 6cd69a896f5..6013f87cdf2 100644 --- a/samples/client/petstore/kotlin-string/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-string/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt @@ -3,6 +3,7 @@ package io.swagger.client.infrastructure import okhttp3.* import java.io.File import java.io.IOException +import java.nio.file.Files; import java.util.regex.Pattern open class ApiClient(val baseUrl: String) { @@ -64,15 +65,15 @@ open class ApiClient(val baseUrl: String) { inline protected fun responseBody(response: Response, mediaType: String = JsonMediaType): T? { if(response.body() == null) return null - + if(T::class.java == java.io.File::class.java){ return downloadFileFromResponse(response) as T } else if(T::class == kotlin.Unit::class) { return kotlin.Unit as T } - + var contentType = response.headers().get("Content-Type") - + if(contentType == null) { contentType = JsonMediaType } @@ -85,7 +86,7 @@ open class ApiClient(val baseUrl: String) { TODO("Fill in more types!") } } - + fun isJsonMime(mime: String?): Boolean { val jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$" return mime != null && (mime.matches(jsonMime.toRegex()) || mime == "*/*") @@ -162,7 +163,7 @@ open class ApiClient(val baseUrl: String) { ) } } - + @Throws(IOException::class) fun downloadFileFromResponse(response: Response): File { val file = prepareDownloadFile(response) @@ -206,6 +207,6 @@ open class ApiClient(val baseUrl: String) { prefix = "download-" } - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/kotlin-threetenbp/.swagger-codegen/VERSION b/samples/client/petstore/kotlin-threetenbp/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/kotlin-threetenbp/.swagger-codegen/VERSION +++ b/samples/client/petstore/kotlin-threetenbp/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt index 6cd69a896f5..6013f87cdf2 100644 --- a/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin-threetenbp/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt @@ -3,6 +3,7 @@ package io.swagger.client.infrastructure import okhttp3.* import java.io.File import java.io.IOException +import java.nio.file.Files; import java.util.regex.Pattern open class ApiClient(val baseUrl: String) { @@ -64,15 +65,15 @@ open class ApiClient(val baseUrl: String) { inline protected fun responseBody(response: Response, mediaType: String = JsonMediaType): T? { if(response.body() == null) return null - + if(T::class.java == java.io.File::class.java){ return downloadFileFromResponse(response) as T } else if(T::class == kotlin.Unit::class) { return kotlin.Unit as T } - + var contentType = response.headers().get("Content-Type") - + if(contentType == null) { contentType = JsonMediaType } @@ -85,7 +86,7 @@ open class ApiClient(val baseUrl: String) { TODO("Fill in more types!") } } - + fun isJsonMime(mime: String?): Boolean { val jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$" return mime != null && (mime.matches(jsonMime.toRegex()) || mime == "*/*") @@ -162,7 +163,7 @@ open class ApiClient(val baseUrl: String) { ) } } - + @Throws(IOException::class) fun downloadFileFromResponse(response: Response): File { val file = prepareDownloadFile(response) @@ -206,6 +207,6 @@ open class ApiClient(val baseUrl: String) { prefix = "download-" } - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/kotlin/.swagger-codegen/VERSION b/samples/client/petstore/kotlin/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/kotlin/.swagger-codegen/VERSION +++ b/samples/client/petstore/kotlin/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt index 6cd69a896f5..6013f87cdf2 100644 --- a/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt +++ b/samples/client/petstore/kotlin/src/main/kotlin/io/swagger/client/infrastructure/ApiClient.kt @@ -3,6 +3,7 @@ package io.swagger.client.infrastructure import okhttp3.* import java.io.File import java.io.IOException +import java.nio.file.Files; import java.util.regex.Pattern open class ApiClient(val baseUrl: String) { @@ -64,15 +65,15 @@ open class ApiClient(val baseUrl: String) { inline protected fun responseBody(response: Response, mediaType: String = JsonMediaType): T? { if(response.body() == null) return null - + if(T::class.java == java.io.File::class.java){ return downloadFileFromResponse(response) as T } else if(T::class == kotlin.Unit::class) { return kotlin.Unit as T } - + var contentType = response.headers().get("Content-Type") - + if(contentType == null) { contentType = JsonMediaType } @@ -85,7 +86,7 @@ open class ApiClient(val baseUrl: String) { TODO("Fill in more types!") } } - + fun isJsonMime(mime: String?): Boolean { val jsonMime = "(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$" return mime != null && (mime.matches(jsonMime.toRegex()) || mime == "*/*") @@ -162,7 +163,7 @@ open class ApiClient(val baseUrl: String) { ) } } - + @Throws(IOException::class) fun downloadFileFromResponse(response: Response): File { val file = prepareDownloadFile(response) @@ -206,6 +207,6 @@ open class ApiClient(val baseUrl: String) { prefix = "download-" } - return File.createTempFile(prefix, suffix); + return Files.createTempFile(prefix, suffix).toFile(); } -} \ No newline at end of file +} diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php index 58d0f4d970d..c54892b41b3 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/AnotherFakeApi.php @@ -319,7 +319,7 @@ protected function testSpecialTagsRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -335,7 +335,7 @@ protected function testSpecialTagsRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/DefaultApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/DefaultApi.php index a24fd708e39..9874144940e 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/DefaultApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/DefaultApi.php @@ -293,7 +293,7 @@ protected function testBodyWithQueryParamsRequest($body, $query) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -309,7 +309,7 @@ protected function testBodyWithQueryParamsRequest($body, $query) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php index dcc7225f116..db1172f6ccc 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeApi.php @@ -309,7 +309,7 @@ protected function fakeOuterBooleanSerializeRequest($body = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -325,7 +325,7 @@ protected function fakeOuterBooleanSerializeRequest($body = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -556,7 +556,7 @@ protected function fakeOuterCompositeSerializeRequest($body = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -572,7 +572,7 @@ protected function fakeOuterCompositeSerializeRequest($body = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -803,7 +803,7 @@ protected function fakeOuterNumberSerializeRequest($body = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -819,7 +819,7 @@ protected function fakeOuterNumberSerializeRequest($body = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1050,7 +1050,7 @@ protected function fakeOuterStringSerializeRequest($body = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1066,7 +1066,7 @@ protected function fakeOuterStringSerializeRequest($body = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1281,7 +1281,7 @@ protected function testBodyWithQueryParamsRequest($body, $query) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1297,7 +1297,7 @@ protected function testBodyWithQueryParamsRequest($body, $query) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1538,7 +1538,7 @@ protected function testClientModelRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1554,7 +1554,7 @@ protected function testClientModelRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1941,7 +1941,7 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1961,7 +1961,7 @@ protected function testEndpointParametersRequest($number, $double, $pattern_with $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2229,7 +2229,7 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2245,7 +2245,7 @@ protected function testEnumParametersRequest($enum_form_string_array = null, $en $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2449,7 +2449,7 @@ protected function testInlineAdditionalPropertiesRequest($param) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2465,7 +2465,7 @@ protected function testInlineAdditionalPropertiesRequest($param) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2685,7 +2685,7 @@ protected function testJsonFormDataRequest($param, $param2) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2701,7 +2701,7 @@ protected function testJsonFormDataRequest($param, $param2) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php index 799906cf9a6..2b9ce933a6f 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/FakeClassnameTags123Api.php @@ -319,7 +319,7 @@ protected function testClassnameRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -340,7 +340,7 @@ protected function testClassnameRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php index dd25d6ae6f7..fe003146923 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/Fake_classname_tags123Api.php @@ -308,7 +308,7 @@ protected function testClassnameRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -329,7 +329,7 @@ protected function testClassnameRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PATCH', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php index 7d6ae64a6a4..85df4c18fa1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/PetApi.php @@ -289,7 +289,7 @@ protected function addPetRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -309,7 +309,7 @@ protected function addPetRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -534,7 +534,7 @@ protected function deletePetRequest($pet_id, $api_key = null) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -554,7 +554,7 @@ protected function deletePetRequest($pet_id, $api_key = null) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -806,7 +806,7 @@ protected function findPetsByStatusRequest($status) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -826,7 +826,7 @@ protected function findPetsByStatusRequest($status) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1078,7 +1078,7 @@ protected function findPetsByTagsRequest($tags) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1098,7 +1098,7 @@ protected function findPetsByTagsRequest($tags) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1351,7 +1351,7 @@ protected function getPetByIdRequest($pet_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1372,7 +1372,7 @@ protected function getPetByIdRequest($pet_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1583,7 +1583,7 @@ protected function updatePetRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1603,7 +1603,7 @@ protected function updatePetRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1837,7 +1837,7 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1857,7 +1857,7 @@ protected function updatePetWithFormRequest($pet_id, $name = null, $status = nul $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -2129,7 +2129,7 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -2149,7 +2149,7 @@ protected function uploadFileRequest($pet_id, $additional_metadata = null, $file $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php index 36ab1ab432f..a65dd45a52c 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/StoreApi.php @@ -294,7 +294,7 @@ protected function deleteOrderRequest($order_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -310,7 +310,7 @@ protected function deleteOrderRequest($order_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -544,7 +544,7 @@ protected function getInventoryRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -565,7 +565,7 @@ protected function getInventoryRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -825,7 +825,7 @@ protected function getOrderByIdRequest($order_id) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -841,7 +841,7 @@ protected function getOrderByIdRequest($order_id) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1089,7 +1089,7 @@ protected function placeOrderRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1105,7 +1105,7 @@ protected function placeOrderRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php index 20c90ea83c6..edf55946bae 100644 --- a/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php +++ b/samples/client/petstore/php/SwaggerClient-php/lib/Api/UserApi.php @@ -289,7 +289,7 @@ protected function createUserRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -305,7 +305,7 @@ protected function createUserRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -516,7 +516,7 @@ protected function createUsersWithArrayInputRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -532,7 +532,7 @@ protected function createUsersWithArrayInputRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -743,7 +743,7 @@ protected function createUsersWithListInputRequest($body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -759,7 +759,7 @@ protected function createUsersWithListInputRequest($body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'POST', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -975,7 +975,7 @@ protected function deleteUserRequest($username) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -991,7 +991,7 @@ protected function deleteUserRequest($username) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'DELETE', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1244,7 +1244,7 @@ protected function getUserByNameRequest($username) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1260,7 +1260,7 @@ protected function getUserByNameRequest($username) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1524,7 +1524,7 @@ protected function loginUserRequest($username, $password) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1540,7 +1540,7 @@ protected function loginUserRequest($username, $password) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1737,7 +1737,7 @@ protected function logoutUserRequest() } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1753,7 +1753,7 @@ protected function logoutUserRequest() $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'GET', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), @@ -1983,7 +1983,7 @@ protected function updateUserRequest($username, $body) } else { // for HTTP post (form) - $httpBody = \GuzzleHttp\Psr7\build_query($formParams); + $httpBody = \GuzzleHttp\Psr7\Query::build($formParams); } } @@ -1999,7 +1999,7 @@ protected function updateUserRequest($username, $body) $headers ); - $query = \GuzzleHttp\Psr7\build_query($queryParams); + $query = \GuzzleHttp\Psr7\Query::build($queryParams); return new Request( 'PUT', $this->config->getHost() . $resourcePath . ($query ? "?{$query}" : ''), diff --git a/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php b/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php index 7d6dfcfc1f4..fdaf42467e1 100644 --- a/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php +++ b/samples/client/petstore/php/SwaggerClient-php/tests/UserApiTest.php @@ -24,7 +24,7 @@ public function testLoginUser() $this->assertInternalType('string', $response); $this->assertRegExp( - '/^logged in user session/', + '/logged in user session/', $response, "response string starts with 'logged in user session'" ); diff --git a/samples/client/petstore/python/.swagger-codegen/VERSION b/samples/client/petstore/python/.swagger-codegen/VERSION index e3c58351672..1bdaf4866d9 100644 --- a/samples/client/petstore/python/.swagger-codegen/VERSION +++ b/samples/client/petstore/python/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.9-SNAPSHOT +2.4.20-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index cab8b4c968d..9ba2099777f 100644 --- a/samples/client/petstore/python/README.md +++ b/samples/client/petstore/python/README.md @@ -113,15 +113,19 @@ Class | Method | HTTP request | Description - [ArrayOfArrayOfNumberOnly](docs/ArrayOfArrayOfNumberOnly.md) - [ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [ArrayTest](docs/ArrayTest.md) + - [Boolean](docs/Boolean.md) - [Capitalization](docs/Capitalization.md) + - [Cat](docs/Cat.md) - [Category](docs/Category.md) - [ClassModel](docs/ClassModel.md) - [Client](docs/Client.md) + - [Dog](docs/Dog.md) - [EnumArrays](docs/EnumArrays.md) - [EnumClass](docs/EnumClass.md) - [EnumTest](docs/EnumTest.md) - [FormatTest](docs/FormatTest.md) - [HasOnlyReadOnly](docs/HasOnlyReadOnly.md) + - [Ints](docs/Ints.md) - [List](docs/List.md) - [MapTest](docs/MapTest.md) - [MixedPropertiesAndAdditionalPropertiesClass](docs/MixedPropertiesAndAdditionalPropertiesClass.md) @@ -129,6 +133,7 @@ Class | Method | HTTP request | Description - [ModelReturn](docs/ModelReturn.md) - [Name](docs/Name.md) - [NumberOnly](docs/NumberOnly.md) + - [Numbers](docs/Numbers.md) - [Order](docs/Order.md) - [OuterBoolean](docs/OuterBoolean.md) - [OuterComposite](docs/OuterComposite.md) @@ -140,8 +145,6 @@ Class | Method | HTTP request | Description - [SpecialModelName](docs/SpecialModelName.md) - [Tag](docs/Tag.md) - [User](docs/User.md) - - [Cat](docs/Cat.md) - - [Dog](docs/Dog.md) ## Documentation For Authorization diff --git a/samples/client/petstore/python/docs/Boolean.md b/samples/client/petstore/python/docs/Boolean.md new file mode 100644 index 00000000000..d0b536f8086 --- /dev/null +++ b/samples/client/petstore/python/docs/Boolean.md @@ -0,0 +1,9 @@ +# Boolean + +## 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/python/docs/InlineResponse200.md b/samples/client/petstore/python/docs/InlineResponse200.md deleted file mode 100644 index ec171d3a5d2..00000000000 --- a/samples/client/petstore/python/docs/InlineResponse200.md +++ /dev/null @@ -1,15 +0,0 @@ -# InlineResponse200 - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**tags** | [**list[Tag]**](Tag.md) | | [optional] -**id** | **int** | | -**category** | **object** | | [optional] -**status** | **str** | pet status in the store | [optional] -**name** | **str** | | [optional] -**photo_urls** | **list[str]** | | [optional] - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/samples/client/petstore/python/docs/Ints.md b/samples/client/petstore/python/docs/Ints.md new file mode 100644 index 00000000000..78218e2a730 --- /dev/null +++ b/samples/client/petstore/python/docs/Ints.md @@ -0,0 +1,9 @@ +# Ints + +## 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/python/docs/Numbers.md b/samples/client/petstore/python/docs/Numbers.md new file mode 100644 index 00000000000..33da59af68c --- /dev/null +++ b/samples/client/petstore/python/docs/Numbers.md @@ -0,0 +1,9 @@ +# Numbers + +## 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/python/petstore_api/__init__.py b/samples/client/petstore/python/petstore_api/__init__.py index 8bf367cc5b8..21f67e5eb60 100644 --- a/samples/client/petstore/python/petstore_api/__init__.py +++ b/samples/client/petstore/python/petstore_api/__init__.py @@ -34,15 +34,19 @@ from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.boolean import Boolean from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat from petstore_api.models.category import Category from petstore_api.models.class_model import ClassModel from petstore_api.models.client import Client +from petstore_api.models.dog import Dog from petstore_api.models.enum_arrays import EnumArrays from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_test import EnumTest from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.ints import Ints from petstore_api.models.list import List from petstore_api.models.map_test import MapTest from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass @@ -50,6 +54,7 @@ from petstore_api.models.model_return import ModelReturn from petstore_api.models.name import Name from petstore_api.models.number_only import NumberOnly +from petstore_api.models.numbers import Numbers from petstore_api.models.order import Order from petstore_api.models.outer_boolean import OuterBoolean from petstore_api.models.outer_composite import OuterComposite @@ -61,5 +66,3 @@ from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.tag import Tag from petstore_api.models.user import User -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog diff --git a/samples/client/petstore/python/petstore_api/api/another_fake_api.py b/samples/client/petstore/python/petstore_api/api/another_fake_api.py index 955369935ea..18b0712a29a 100644 --- a/samples/client/petstore/python/petstore_api/api/another_fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/another_fake_api.py @@ -87,8 +87,8 @@ def test_special_tags_with_http_info(self, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `test_special_tags`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/fake_api.py b/samples/client/petstore/python/petstore_api/api/fake_api.py index a3be46de1e0..410c068e48e 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_api.py @@ -435,12 +435,12 @@ def test_body_with_query_params_with_http_info(self, body, query, **kwargs): # params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `test_body_with_query_params`") # noqa: E501 # verify the required parameter 'query' is set - if ('query' not in params or - params['query'] is None): + if self.api_client.client_side_validation and ('query' not in params or + params['query'] is None): # noqa: E501 raise ValueError("Missing the required parameter `query` when calling `test_body_with_query_params`") # noqa: E501 collection_formats = {} @@ -536,8 +536,8 @@ def test_client_model_with_http_info(self, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `test_client_model`") # noqa: E501 collection_formats = {} @@ -661,49 +661,49 @@ def test_endpoint_parameters_with_http_info(self, number, double, pattern_withou params[key] = val del params['kwargs'] # verify the required parameter 'number' is set - if ('number' not in params or - params['number'] is None): + if self.api_client.client_side_validation and ('number' not in params or + params['number'] is None): # noqa: E501 raise ValueError("Missing the required parameter `number` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'double' is set - if ('double' not in params or - params['double'] is None): + if self.api_client.client_side_validation and ('double' not in params or + params['double'] is None): # noqa: E501 raise ValueError("Missing the required parameter `double` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'pattern_without_delimiter' is set - if ('pattern_without_delimiter' not in params or - params['pattern_without_delimiter'] is None): + if self.api_client.client_side_validation and ('pattern_without_delimiter' not in params or + params['pattern_without_delimiter'] is None): # noqa: E501 raise ValueError("Missing the required parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`") # noqa: E501 # verify the required parameter 'byte' is set - if ('byte' not in params or - params['byte'] is None): + if self.api_client.client_side_validation and ('byte' not in params or + params['byte'] is None): # noqa: E501 raise ValueError("Missing the required parameter `byte` when calling `test_endpoint_parameters`") # noqa: E501 - if 'number' in params and params['number'] > 543.2: # noqa: E501 + if self.api_client.client_side_validation and ('number' in params and params['number'] > 543.2): # noqa: E501 raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value less than or equal to `543.2`") # noqa: E501 - if 'number' in params and params['number'] < 32.1: # noqa: E501 + if self.api_client.client_side_validation and ('number' in params and params['number'] < 32.1): # noqa: E501 raise ValueError("Invalid value for parameter `number` when calling `test_endpoint_parameters`, must be a value greater than or equal to `32.1`") # noqa: E501 - if 'double' in params and params['double'] > 123.4: # noqa: E501 + if self.api_client.client_side_validation and ('double' in params and params['double'] > 123.4): # noqa: E501 raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value less than or equal to `123.4`") # noqa: E501 - if 'double' in params and params['double'] < 67.8: # noqa: E501 + if self.api_client.client_side_validation and ('double' in params and params['double'] < 67.8): # noqa: E501 raise ValueError("Invalid value for parameter `double` when calling `test_endpoint_parameters`, must be a value greater than or equal to `67.8`") # noqa: E501 - if 'pattern_without_delimiter' in params and not re.search(r'^[A-Z].*', params['pattern_without_delimiter']): # noqa: E501 + if self.api_client.client_side_validation and ('pattern_without_delimiter' in params and not re.search(r'^[A-Z].*', params['pattern_without_delimiter'])): # noqa: E501 raise ValueError("Invalid value for parameter `pattern_without_delimiter` when calling `test_endpoint_parameters`, must conform to the pattern `/^[A-Z].*/`") # noqa: E501 - if 'integer' in params and params['integer'] > 100: # noqa: E501 + if self.api_client.client_side_validation and ('integer' in params and params['integer'] > 100): # noqa: E501 raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value less than or equal to `100`") # noqa: E501 - if 'integer' in params and params['integer'] < 10: # noqa: E501 + if self.api_client.client_side_validation and ('integer' in params and params['integer'] < 10): # noqa: E501 raise ValueError("Invalid value for parameter `integer` when calling `test_endpoint_parameters`, must be a value greater than or equal to `10`") # noqa: E501 - if 'int32' in params and params['int32'] > 200: # noqa: E501 + if self.api_client.client_side_validation and ('int32' in params and params['int32'] > 200): # noqa: E501 raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value less than or equal to `200`") # noqa: E501 - if 'int32' in params and params['int32'] < 20: # noqa: E501 + if self.api_client.client_side_validation and ('int32' in params and params['int32'] < 20): # noqa: E501 raise ValueError("Invalid value for parameter `int32` when calling `test_endpoint_parameters`, must be a value greater than or equal to `20`") # noqa: E501 - if '_float' in params and params['_float'] > 987.6: # noqa: E501 + if self.api_client.client_side_validation and ('_float' in params and params['_float'] > 987.6): # noqa: E501 raise ValueError("Invalid value for parameter `_float` when calling `test_endpoint_parameters`, must be a value less than or equal to `987.6`") # noqa: E501 - if 'string' in params and not re.search(r'[a-z]', params['string'], flags=re.IGNORECASE): # noqa: E501 + if self.api_client.client_side_validation and ('string' in params and not re.search(r'[a-z]', params['string'], flags=re.IGNORECASE)): # noqa: E501 raise ValueError("Invalid value for parameter `string` when calling `test_endpoint_parameters`, must conform to the pattern `/[a-z]/i`") # noqa: E501 - if ('password' in params and - len(params['password']) > 64): + if self.api_client.client_side_validation and ('password' in params and + len(params['password']) > 64): raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be less than or equal to `64`") # noqa: E501 - if ('password' in params and - len(params['password']) < 10): + if self.api_client.client_side_validation and ('password' in params and + len(params['password']) < 10): raise ValueError("Invalid value for parameter `password` when calling `test_endpoint_parameters`, length must be greater than or equal to `10`") # noqa: E501 collection_formats = {} @@ -952,8 +952,8 @@ def test_inline_additional_properties_with_http_info(self, param, **kwargs): # params[key] = val del params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in params or - params['param'] is None): + if self.api_client.client_side_validation and ('param' not in params or + params['param'] is None): # noqa: E501 raise ValueError("Missing the required parameter `param` when calling `test_inline_additional_properties`") # noqa: E501 collection_formats = {} @@ -1049,12 +1049,12 @@ def test_json_form_data_with_http_info(self, param, param2, **kwargs): # noqa: params[key] = val del params['kwargs'] # verify the required parameter 'param' is set - if ('param' not in params or - params['param'] is None): + if self.api_client.client_side_validation and ('param' not in params or + params['param'] is None): # noqa: E501 raise ValueError("Missing the required parameter `param` when calling `test_json_form_data`") # noqa: E501 # verify the required parameter 'param2' is set - if ('param2' not in params or - params['param2'] is None): + if self.api_client.client_side_validation and ('param2' not in params or + params['param2'] is None): # noqa: E501 raise ValueError("Missing the required parameter `param2` when calling `test_json_form_data`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py index 8aa93d8dc32..ff91aefa1d9 100644 --- a/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py +++ b/samples/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py @@ -87,8 +87,8 @@ def test_classname_with_http_info(self, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `test_classname`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/pet_api.py b/samples/client/petstore/python/petstore_api/api/pet_api.py index bf71e96eab6..4528bd31794 100644 --- a/samples/client/petstore/python/petstore_api/api/pet_api.py +++ b/samples/client/petstore/python/petstore_api/api/pet_api.py @@ -87,8 +87,8 @@ def add_pet_with_http_info(self, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `add_pet`") # noqa: E501 collection_formats = {} @@ -188,8 +188,8 @@ def delete_pet_with_http_info(self, pet_id, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params or - params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in params or + params['pet_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `pet_id` when calling `delete_pet`") # noqa: E501 collection_formats = {} @@ -285,8 +285,8 @@ def find_pets_by_status_with_http_info(self, status, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'status' is set - if ('status' not in params or - params['status'] is None): + if self.api_client.client_side_validation and ('status' not in params or + params['status'] is None): # noqa: E501 raise ValueError("Missing the required parameter `status` when calling `find_pets_by_status`") # noqa: E501 collection_formats = {} @@ -381,8 +381,8 @@ def find_pets_by_tags_with_http_info(self, tags, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'tags' is set - if ('tags' not in params or - params['tags'] is None): + if self.api_client.client_side_validation and ('tags' not in params or + params['tags'] is None): # noqa: E501 raise ValueError("Missing the required parameter `tags` when calling `find_pets_by_tags`") # noqa: E501 collection_formats = {} @@ -477,8 +477,8 @@ def get_pet_by_id_with_http_info(self, pet_id, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params or - params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in params or + params['pet_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `pet_id` when calling `get_pet_by_id`") # noqa: E501 collection_formats = {} @@ -572,8 +572,8 @@ def update_pet_with_http_info(self, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `update_pet`") # noqa: E501 collection_formats = {} @@ -675,8 +675,8 @@ def update_pet_with_form_with_http_info(self, pet_id, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params or - params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in params or + params['pet_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `pet_id` when calling `update_pet_with_form`") # noqa: E501 collection_formats = {} @@ -782,8 +782,8 @@ def upload_file_with_http_info(self, pet_id, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'pet_id' is set - if ('pet_id' not in params or - params['pet_id'] is None): + if self.api_client.client_side_validation and ('pet_id' not in params or + params['pet_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `pet_id` when calling `upload_file`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/store_api.py b/samples/client/petstore/python/petstore_api/api/store_api.py index 27e1f770192..68edb01ab17 100644 --- a/samples/client/petstore/python/petstore_api/api/store_api.py +++ b/samples/client/petstore/python/petstore_api/api/store_api.py @@ -87,8 +87,8 @@ def delete_order_with_http_info(self, order_id, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params or - params['order_id'] is None): + if self.api_client.client_side_validation and ('order_id' not in params or + params['order_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `order_id` when calling `delete_order`") # noqa: E501 collection_formats = {} @@ -269,13 +269,13 @@ def get_order_by_id_with_http_info(self, order_id, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'order_id' is set - if ('order_id' not in params or - params['order_id'] is None): + if self.api_client.client_side_validation and ('order_id' not in params or + params['order_id'] is None): # noqa: E501 raise ValueError("Missing the required parameter `order_id` when calling `get_order_by_id`") # noqa: E501 - if 'order_id' in params and params['order_id'] > 5: # noqa: E501 + if self.api_client.client_side_validation and ('order_id' in params and params['order_id'] > 5): # noqa: E501 raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value less than or equal to `5`") # noqa: E501 - if 'order_id' in params and params['order_id'] < 1: # noqa: E501 + if self.api_client.client_side_validation and ('order_id' in params and params['order_id'] < 1): # noqa: E501 raise ValueError("Invalid value for parameter `order_id` when calling `get_order_by_id`, must be a value greater than or equal to `1`") # noqa: E501 collection_formats = {} @@ -368,8 +368,8 @@ def place_order_with_http_info(self, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `place_order`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api/user_api.py b/samples/client/petstore/python/petstore_api/api/user_api.py index 62a87f2e418..160b8ba8113 100644 --- a/samples/client/petstore/python/petstore_api/api/user_api.py +++ b/samples/client/petstore/python/petstore_api/api/user_api.py @@ -87,8 +87,8 @@ def create_user_with_http_info(self, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `create_user`") # noqa: E501 collection_formats = {} @@ -182,8 +182,8 @@ def create_users_with_array_input_with_http_info(self, body, **kwargs): # noqa: params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `create_users_with_array_input`") # noqa: E501 collection_formats = {} @@ -277,8 +277,8 @@ def create_users_with_list_input_with_http_info(self, body, **kwargs): # noqa: params[key] = val del params['kwargs'] # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `create_users_with_list_input`") # noqa: E501 collection_formats = {} @@ -372,8 +372,8 @@ def delete_user_with_http_info(self, username, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params or - params['username'] is None): + if self.api_client.client_side_validation and ('username' not in params or + params['username'] is None): # noqa: E501 raise ValueError("Missing the required parameter `username` when calling `delete_user`") # noqa: E501 collection_formats = {} @@ -467,8 +467,8 @@ def get_user_by_name_with_http_info(self, username, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params or - params['username'] is None): + if self.api_client.client_side_validation and ('username' not in params or + params['username'] is None): # noqa: E501 raise ValueError("Missing the required parameter `username` when calling `get_user_by_name`") # noqa: E501 collection_formats = {} @@ -564,12 +564,12 @@ def login_user_with_http_info(self, username, password, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params or - params['username'] is None): + if self.api_client.client_side_validation and ('username' not in params or + params['username'] is None): # noqa: E501 raise ValueError("Missing the required parameter `username` when calling `login_user`") # noqa: E501 # verify the required parameter 'password' is set - if ('password' not in params or - params['password'] is None): + if self.api_client.client_side_validation and ('password' not in params or + params['password'] is None): # noqa: E501 raise ValueError("Missing the required parameter `password` when calling `login_user`") # noqa: E501 collection_formats = {} @@ -754,12 +754,12 @@ def update_user_with_http_info(self, username, body, **kwargs): # noqa: E501 params[key] = val del params['kwargs'] # verify the required parameter 'username' is set - if ('username' not in params or - params['username'] is None): + if self.api_client.client_side_validation and ('username' not in params or + params['username'] is None): # noqa: E501 raise ValueError("Missing the required parameter `username` when calling `update_user`") # noqa: E501 # verify the required parameter 'body' is set - if ('body' not in params or - params['body'] is None): + if self.api_client.client_side_validation and ('body' not in params or + params['body'] is None): # noqa: E501 raise ValueError("Missing the required parameter `body` when calling `update_user`") # noqa: E501 collection_formats = {} diff --git a/samples/client/petstore/python/petstore_api/api_client.py b/samples/client/petstore/python/petstore_api/api_client.py index ab9a96868c0..05ce799d141 100644 --- a/samples/client/petstore/python/petstore_api/api_client.py +++ b/samples/client/petstore/python/petstore_api/api_client.py @@ -75,6 +75,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.cookie = cookie # Set default User-Agent. self.user_agent = 'Swagger-Codegen/1.0.0/python' + self.client_side_validation = configuration.client_side_validation def __del__(self): if self._pool is not None: @@ -533,7 +534,7 @@ def __deserialize_file(self, response): content_disposition).group(1) path = os.path.join(os.path.dirname(path), filename) - with open(path, "wb") as f: + with open(path, "w") as f: f.write(response.data) return path diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 103b93fd738..41d650fe025 100644 --- a/samples/client/petstore/python/petstore_api/configuration.py +++ b/samples/client/petstore/python/petstore_api/configuration.py @@ -99,6 +99,9 @@ def __init__(self): # Safe chars for path_param self.safe_chars_for_path_param = '' + # Disable client side validation + self.client_side_validation = True + @classmethod def set_default(cls, default): cls._default = default diff --git a/samples/client/petstore/python/petstore_api/models/__init__.py b/samples/client/petstore/python/petstore_api/models/__init__.py index c5ae381c40f..4d14b56341f 100644 --- a/samples/client/petstore/python/petstore_api/models/__init__.py +++ b/samples/client/petstore/python/petstore_api/models/__init__.py @@ -22,15 +22,19 @@ from petstore_api.models.array_of_array_of_number_only import ArrayOfArrayOfNumberOnly from petstore_api.models.array_of_number_only import ArrayOfNumberOnly from petstore_api.models.array_test import ArrayTest +from petstore_api.models.boolean import Boolean from petstore_api.models.capitalization import Capitalization +from petstore_api.models.cat import Cat from petstore_api.models.category import Category from petstore_api.models.class_model import ClassModel from petstore_api.models.client import Client +from petstore_api.models.dog import Dog from petstore_api.models.enum_arrays import EnumArrays from petstore_api.models.enum_class import EnumClass from petstore_api.models.enum_test import EnumTest from petstore_api.models.format_test import FormatTest from petstore_api.models.has_only_read_only import HasOnlyReadOnly +from petstore_api.models.ints import Ints from petstore_api.models.list import List from petstore_api.models.map_test import MapTest from petstore_api.models.mixed_properties_and_additional_properties_class import MixedPropertiesAndAdditionalPropertiesClass @@ -38,6 +42,7 @@ from petstore_api.models.model_return import ModelReturn from petstore_api.models.name import Name from petstore_api.models.number_only import NumberOnly +from petstore_api.models.numbers import Numbers from petstore_api.models.order import Order from petstore_api.models.outer_boolean import OuterBoolean from petstore_api.models.outer_composite import OuterComposite @@ -49,5 +54,3 @@ from petstore_api.models.special_model_name import SpecialModelName from petstore_api.models.tag import Tag from petstore_api.models.user import User -from petstore_api.models.cat import Cat -from petstore_api.models.dog import Dog diff --git a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py index 83de7092668..c6ebdbbb1d8 100644 --- a/samples/client/petstore/python/petstore_api/models/additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/additional_properties_class.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class AdditionalPropertiesClass(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class AdditionalPropertiesClass(object): 'map_of_map_property': 'map_of_map_property' } - def __init__(self, map_property=None, map_of_map_property=None): # noqa: E501 + def __init__(self, map_property=None, map_of_map_property=None, _configuration=None): # noqa: E501 """AdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._map_property = None self._map_of_map_property = None @@ -134,8 +139,11 @@ def __eq__(self, other): if not isinstance(other, AdditionalPropertiesClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AdditionalPropertiesClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/animal.py b/samples/client/petstore/python/petstore_api/models/animal.py index 5175148b2d3..72d2b522c69 100644 --- a/samples/client/petstore/python/petstore_api/models/animal.py +++ b/samples/client/petstore/python/petstore_api/models/animal.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Animal(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -45,8 +47,11 @@ class Animal(object): 'Cat': 'Cat' } - def __init__(self, class_name=None, color='red'): # noqa: E501 + def __init__(self, class_name=None, color='red', _configuration=None): # noqa: E501 """Animal - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._class_name = None self._color = None @@ -74,7 +79,7 @@ def class_name(self, class_name): :param class_name: The class_name of this Animal. # noqa: E501 :type: str """ - if class_name is None: + if self._configuration.client_side_validation and class_name is None: raise ValueError("Invalid value for `class_name`, must not be `None`") # noqa: E501 self._class_name = class_name @@ -145,8 +150,11 @@ def __eq__(self, other): if not isinstance(other, Animal): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Animal): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/animal_farm.py b/samples/client/petstore/python/petstore_api/models/animal_farm.py index 1df0fb39924..74fa330c0d4 100644 --- a/samples/client/petstore/python/petstore_api/models/animal_farm.py +++ b/samples/client/petstore/python/petstore_api/models/animal_farm.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class AnimalFarm(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -36,8 +38,11 @@ class AnimalFarm(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, _configuration=None): # noqa: E501 """AnimalFarm - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.discriminator = None def to_dict(self): @@ -80,8 +85,11 @@ def __eq__(self, other): if not isinstance(other, AnimalFarm): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, AnimalFarm): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/api_response.py b/samples/client/petstore/python/petstore_api/models/api_response.py index 9da53da373b..f4dde5e8bb4 100644 --- a/samples/client/petstore/python/petstore_api/models/api_response.py +++ b/samples/client/petstore/python/petstore_api/models/api_response.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class ApiResponse(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -42,8 +44,11 @@ class ApiResponse(object): 'message': 'message' } - def __init__(self, code=None, type=None, message=None): # noqa: E501 + def __init__(self, code=None, type=None, message=None, _configuration=None): # noqa: E501 """ApiResponse - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._code = None self._type = None @@ -160,8 +165,11 @@ def __eq__(self, other): if not isinstance(other, ApiResponse): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ApiResponse): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py index 1e5e8be1ed1..4959da91072 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_array_of_number_only.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class ArrayOfArrayOfNumberOnly(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class ArrayOfArrayOfNumberOnly(object): 'array_array_number': 'ArrayArrayNumber' } - def __init__(self, array_array_number=None): # noqa: E501 + def __init__(self, array_array_number=None, _configuration=None): # noqa: E501 """ArrayOfArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._array_array_number = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, ArrayOfArrayOfNumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayOfArrayOfNumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py index 0628f7af1e7..6740f02ce19 100644 --- a/samples/client/petstore/python/petstore_api/models/array_of_number_only.py +++ b/samples/client/petstore/python/petstore_api/models/array_of_number_only.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class ArrayOfNumberOnly(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class ArrayOfNumberOnly(object): 'array_number': 'ArrayNumber' } - def __init__(self, array_number=None): # noqa: E501 + def __init__(self, array_number=None, _configuration=None): # noqa: E501 """ArrayOfNumberOnly - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._array_number = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, ArrayOfNumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayOfNumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/array_test.py b/samples/client/petstore/python/petstore_api/models/array_test.py index b0785ac3f13..b73887c21a0 100644 --- a/samples/client/petstore/python/petstore_api/models/array_test.py +++ b/samples/client/petstore/python/petstore_api/models/array_test.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class ArrayTest(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -42,8 +44,11 @@ class ArrayTest(object): 'array_array_of_model': 'array_array_of_model' } - def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None): # noqa: E501 + def __init__(self, array_of_string=None, array_array_of_integer=None, array_array_of_model=None, _configuration=None): # noqa: E501 """ArrayTest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._array_of_string = None self._array_array_of_integer = None @@ -160,8 +165,11 @@ def __eq__(self, other): if not isinstance(other, ArrayTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ArrayTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/boolean.py b/samples/client/petstore/python/petstore_api/models/boolean.py new file mode 100644 index 00000000000..003b75d008b --- /dev/null +++ b/samples/client/petstore/python/petstore_api/models/boolean.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from petstore_api.configuration import Configuration + + +class Boolean(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + TRUE = "true" + FALSE = "false" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """Boolean - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Boolean, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Boolean): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Boolean): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/capitalization.py b/samples/client/petstore/python/petstore_api/models/capitalization.py index 83b0068aee2..10ea31521cb 100644 --- a/samples/client/petstore/python/petstore_api/models/capitalization.py +++ b/samples/client/petstore/python/petstore_api/models/capitalization.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Capitalization(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -48,8 +50,11 @@ class Capitalization(object): 'att_name': 'ATT_NAME' } - def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None): # noqa: E501 + def __init__(self, small_camel=None, capital_camel=None, small_snake=None, capital_snake=None, sca_eth_flow_points=None, att_name=None, _configuration=None): # noqa: E501 """Capitalization - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._small_camel = None self._capital_camel = None @@ -240,8 +245,11 @@ def __eq__(self, other): if not isinstance(other, Capitalization): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Capitalization): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/cat.py b/samples/client/petstore/python/petstore_api/models/cat.py index 4bca18ba841..c0156a2f2e3 100644 --- a/samples/client/petstore/python/petstore_api/models/cat.py +++ b/samples/client/petstore/python/petstore_api/models/cat.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Cat(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class Cat(object): 'declawed': 'declawed' } - def __init__(self, declawed=None): # noqa: E501 + def __init__(self, declawed=None, _configuration=None): # noqa: E501 """Cat - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._declawed = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, Cat): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Cat): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/category.py b/samples/client/petstore/python/petstore_api/models/category.py index dbc4fd28816..24264a64cb9 100644 --- a/samples/client/petstore/python/petstore_api/models/category.py +++ b/samples/client/petstore/python/petstore_api/models/category.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Category(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class Category(object): 'name': 'name' } - def __init__(self, id=None, name=None): # noqa: E501 + def __init__(self, id=None, name=None, _configuration=None): # noqa: E501 """Category - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._id = None self._name = None @@ -134,8 +139,11 @@ def __eq__(self, other): if not isinstance(other, Category): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Category): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/class_model.py b/samples/client/petstore/python/petstore_api/models/class_model.py index 6042036beb5..c7ff4d8eed4 100644 --- a/samples/client/petstore/python/petstore_api/models/class_model.py +++ b/samples/client/petstore/python/petstore_api/models/class_model.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class ClassModel(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class ClassModel(object): '_class': '_class' } - def __init__(self, _class=None): # noqa: E501 + def __init__(self, _class=None, _configuration=None): # noqa: E501 """ClassModel - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.__class = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, ClassModel): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ClassModel): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/client.py b/samples/client/petstore/python/petstore_api/models/client.py index 337100c3946..e37e5d45384 100644 --- a/samples/client/petstore/python/petstore_api/models/client.py +++ b/samples/client/petstore/python/petstore_api/models/client.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Client(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class Client(object): 'client': 'client' } - def __init__(self, client=None): # noqa: E501 + def __init__(self, client=None, _configuration=None): # noqa: E501 """Client - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._client = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, Client): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Client): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/dog.py b/samples/client/petstore/python/petstore_api/models/dog.py index e4bfea5584c..d64fddef7cb 100644 --- a/samples/client/petstore/python/petstore_api/models/dog.py +++ b/samples/client/petstore/python/petstore_api/models/dog.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Dog(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class Dog(object): 'breed': 'breed' } - def __init__(self, breed=None): # noqa: E501 + def __init__(self, breed=None, _configuration=None): # noqa: E501 """Dog - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._breed = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, Dog): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Dog): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/enum_arrays.py b/samples/client/petstore/python/petstore_api/models/enum_arrays.py index 5257b181b88..fdc6845a749 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_arrays.py +++ b/samples/client/petstore/python/petstore_api/models/enum_arrays.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class EnumArrays(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class EnumArrays(object): 'array_enum': 'array_enum' } - def __init__(self, just_symbol=None, array_enum=None): # noqa: E501 + def __init__(self, just_symbol=None, array_enum=None, _configuration=None): # noqa: E501 """EnumArrays - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._just_symbol = None self._array_enum = None @@ -71,7 +76,8 @@ def just_symbol(self, just_symbol): :type: str """ allowed_values = [">=", "$"] # noqa: E501 - if just_symbol not in allowed_values: + if (self._configuration.client_side_validation and + just_symbol not in allowed_values): raise ValueError( "Invalid value for `just_symbol` ({0}), must be one of {1}" # noqa: E501 .format(just_symbol, allowed_values) @@ -98,7 +104,8 @@ def array_enum(self, array_enum): :type: list[str] """ allowed_values = ["fish", "crab"] # noqa: E501 - if not set(array_enum).issubset(set(allowed_values)): + if (self._configuration.client_side_validation and + not set(array_enum).issubset(set(allowed_values))): # noqa: E501 raise ValueError( "Invalid values for `array_enum` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set(array_enum) - set(allowed_values))), # noqa: E501 @@ -147,8 +154,11 @@ def __eq__(self, other): if not isinstance(other, EnumArrays): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumArrays): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/enum_class.py b/samples/client/petstore/python/petstore_api/models/enum_class.py index 2282270dda1..b09191427df 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_class.py +++ b/samples/client/petstore/python/petstore_api/models/enum_class.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class EnumClass(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -43,8 +45,11 @@ class EnumClass(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, _configuration=None): # noqa: E501 """EnumClass - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.discriminator = None def to_dict(self): @@ -87,8 +92,11 @@ def __eq__(self, other): if not isinstance(other, EnumClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/enum_test.py b/samples/client/petstore/python/petstore_api/models/enum_test.py index f26afa5bdf9..0a46c111d88 100644 --- a/samples/client/petstore/python/petstore_api/models/enum_test.py +++ b/samples/client/petstore/python/petstore_api/models/enum_test.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class EnumTest(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -46,8 +48,11 @@ class EnumTest(object): 'outer_enum': 'outerEnum' } - def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None): # noqa: E501 + def __init__(self, enum_string=None, enum_string_required=None, enum_integer=None, enum_number=None, outer_enum=None, _configuration=None): # noqa: E501 """EnumTest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._enum_string = None self._enum_string_required = None @@ -85,7 +90,8 @@ def enum_string(self, enum_string): :type: str """ allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string not in allowed_values: + if (self._configuration.client_side_validation and + enum_string not in allowed_values): raise ValueError( "Invalid value for `enum_string` ({0}), must be one of {1}" # noqa: E501 .format(enum_string, allowed_values) @@ -111,10 +117,11 @@ def enum_string_required(self, enum_string_required): :param enum_string_required: The enum_string_required of this EnumTest. # noqa: E501 :type: str """ - if enum_string_required is None: + if self._configuration.client_side_validation and enum_string_required is None: raise ValueError("Invalid value for `enum_string_required`, must not be `None`") # noqa: E501 allowed_values = ["UPPER", "lower", ""] # noqa: E501 - if enum_string_required not in allowed_values: + if (self._configuration.client_side_validation and + enum_string_required not in allowed_values): raise ValueError( "Invalid value for `enum_string_required` ({0}), must be one of {1}" # noqa: E501 .format(enum_string_required, allowed_values) @@ -141,7 +148,8 @@ def enum_integer(self, enum_integer): :type: int """ allowed_values = [1, -1] # noqa: E501 - if enum_integer not in allowed_values: + if (self._configuration.client_side_validation and + enum_integer not in allowed_values): raise ValueError( "Invalid value for `enum_integer` ({0}), must be one of {1}" # noqa: E501 .format(enum_integer, allowed_values) @@ -168,7 +176,8 @@ def enum_number(self, enum_number): :type: float """ allowed_values = [1.1, -1.2] # noqa: E501 - if enum_number not in allowed_values: + if (self._configuration.client_side_validation and + enum_number not in allowed_values): raise ValueError( "Invalid value for `enum_number` ({0}), must be one of {1}" # noqa: E501 .format(enum_number, allowed_values) @@ -237,8 +246,11 @@ def __eq__(self, other): if not isinstance(other, EnumTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, EnumTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/format_test.py b/samples/client/petstore/python/petstore_api/models/format_test.py index 206b991719d..1f2761c6a6b 100644 --- a/samples/client/petstore/python/petstore_api/models/format_test.py +++ b/samples/client/petstore/python/petstore_api/models/format_test.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class FormatTest(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -62,8 +64,11 @@ class FormatTest(object): 'password': 'password' } - def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, byte=None, binary=None, _date=None, date_time=None, uuid=None, password=None): # noqa: E501 + def __init__(self, integer=None, int32=None, int64=None, number=None, _float=None, double=None, string=None, byte=None, binary=None, _date=None, date_time=None, uuid=None, password=None, _configuration=None): # noqa: E501 """FormatTest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._integer = None self._int32 = None @@ -121,9 +126,11 @@ def integer(self, integer): :param integer: The integer of this FormatTest. # noqa: E501 :type: int """ - if integer is not None and integer > 100: # noqa: E501 + if (self._configuration.client_side_validation and + integer is not None and integer > 100): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value less than or equal to `100`") # noqa: E501 - if integer is not None and integer < 10: # noqa: E501 + if (self._configuration.client_side_validation and + integer is not None and integer < 10): # noqa: E501 raise ValueError("Invalid value for `integer`, must be a value greater than or equal to `10`") # noqa: E501 self._integer = integer @@ -146,9 +153,11 @@ def int32(self, int32): :param int32: The int32 of this FormatTest. # noqa: E501 :type: int """ - if int32 is not None and int32 > 200: # noqa: E501 + if (self._configuration.client_side_validation and + int32 is not None and int32 > 200): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value less than or equal to `200`") # noqa: E501 - if int32 is not None and int32 < 20: # noqa: E501 + if (self._configuration.client_side_validation and + int32 is not None and int32 < 20): # noqa: E501 raise ValueError("Invalid value for `int32`, must be a value greater than or equal to `20`") # noqa: E501 self._int32 = int32 @@ -192,11 +201,13 @@ def number(self, number): :param number: The number of this FormatTest. # noqa: E501 :type: float """ - if number is None: + if self._configuration.client_side_validation and number is None: raise ValueError("Invalid value for `number`, must not be `None`") # noqa: E501 - if number is not None and number > 543.2: # noqa: E501 + if (self._configuration.client_side_validation and + number is not None and number > 543.2): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value less than or equal to `543.2`") # noqa: E501 - if number is not None and number < 32.1: # noqa: E501 + if (self._configuration.client_side_validation and + number is not None and number < 32.1): # noqa: E501 raise ValueError("Invalid value for `number`, must be a value greater than or equal to `32.1`") # noqa: E501 self._number = number @@ -219,9 +230,11 @@ def _float(self, _float): :param _float: The _float of this FormatTest. # noqa: E501 :type: float """ - if _float is not None and _float > 987.6: # noqa: E501 + if (self._configuration.client_side_validation and + _float is not None and _float > 987.6): # noqa: E501 raise ValueError("Invalid value for `_float`, must be a value less than or equal to `987.6`") # noqa: E501 - if _float is not None and _float < 54.3: # noqa: E501 + if (self._configuration.client_side_validation and + _float is not None and _float < 54.3): # noqa: E501 raise ValueError("Invalid value for `_float`, must be a value greater than or equal to `54.3`") # noqa: E501 self.__float = _float @@ -244,9 +257,11 @@ def double(self, double): :param double: The double of this FormatTest. # noqa: E501 :type: float """ - if double is not None and double > 123.4: # noqa: E501 + if (self._configuration.client_side_validation and + double is not None and double > 123.4): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value less than or equal to `123.4`") # noqa: E501 - if double is not None and double < 67.8: # noqa: E501 + if (self._configuration.client_side_validation and + double is not None and double < 67.8): # noqa: E501 raise ValueError("Invalid value for `double`, must be a value greater than or equal to `67.8`") # noqa: E501 self._double = double @@ -269,7 +284,8 @@ def string(self, string): :param string: The string of this FormatTest. # noqa: E501 :type: str """ - if string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE): # noqa: E501 + if (self._configuration.client_side_validation and + string is not None and not re.search(r'[a-z]', string, flags=re.IGNORECASE)): # noqa: E501 raise ValueError(r"Invalid value for `string`, must be a follow pattern or equal to `/[a-z]/i`") # noqa: E501 self._string = string @@ -292,9 +308,10 @@ def byte(self, byte): :param byte: The byte of this FormatTest. # noqa: E501 :type: str """ - if byte is None: + if self._configuration.client_side_validation and byte is None: raise ValueError("Invalid value for `byte`, must not be `None`") # noqa: E501 - if byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte): # noqa: E501 + if (self._configuration.client_side_validation and + byte is not None and not re.search(r'^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$', byte)): # noqa: E501 raise ValueError(r"Invalid value for `byte`, must be a follow pattern or equal to `/^(?:[A-Za-z0-9+\/]{4})*(?:[A-Za-z0-9+\/]{2}==|[A-Za-z0-9+\/]{3}=)?$/`") # noqa: E501 self._byte = byte @@ -338,7 +355,7 @@ def _date(self, _date): :param _date: The _date of this FormatTest. # noqa: E501 :type: date """ - if _date is None: + if self._configuration.client_side_validation and _date is None: raise ValueError("Invalid value for `_date`, must not be `None`") # noqa: E501 self.__date = _date @@ -403,11 +420,13 @@ def password(self, password): :param password: The password of this FormatTest. # noqa: E501 :type: str """ - if password is None: + if self._configuration.client_side_validation and password is None: raise ValueError("Invalid value for `password`, must not be `None`") # noqa: E501 - if password is not None and len(password) > 64: + if (self._configuration.client_side_validation and + password is not None and len(password) > 64): raise ValueError("Invalid value for `password`, length must be less than or equal to `64`") # noqa: E501 - if password is not None and len(password) < 10: + if (self._configuration.client_side_validation and + password is not None and len(password) < 10): raise ValueError("Invalid value for `password`, length must be greater than or equal to `10`") # noqa: E501 self._password = password @@ -452,8 +471,11 @@ def __eq__(self, other): if not isinstance(other, FormatTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, FormatTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py index 76e5ceb1e22..7a092bb5dd2 100644 --- a/samples/client/petstore/python/petstore_api/models/has_only_read_only.py +++ b/samples/client/petstore/python/petstore_api/models/has_only_read_only.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class HasOnlyReadOnly(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class HasOnlyReadOnly(object): 'foo': 'foo' } - def __init__(self, bar=None, foo=None): # noqa: E501 + def __init__(self, bar=None, foo=None, _configuration=None): # noqa: E501 """HasOnlyReadOnly - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._bar = None self._foo = None @@ -134,8 +139,11 @@ def __eq__(self, other): if not isinstance(other, HasOnlyReadOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, HasOnlyReadOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/ints.py b/samples/client/petstore/python/petstore_api/models/ints.py new file mode 100644 index 00000000000..659f1294bfe --- /dev/null +++ b/samples/client/petstore/python/petstore_api/models/ints.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from petstore_api.configuration import Configuration + + +class Ints(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + _0 = "0" + _1 = "1" + _2 = "2" + _3 = "3" + _4 = "4" + _5 = "5" + _6 = "6" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """Ints - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Ints, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Ints): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Ints): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/list.py b/samples/client/petstore/python/petstore_api/models/list.py index 46eef1e90f3..2f494c172a1 100644 --- a/samples/client/petstore/python/petstore_api/models/list.py +++ b/samples/client/petstore/python/petstore_api/models/list.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class List(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class List(object): '_123_list': '123-list' } - def __init__(self, _123_list=None): # noqa: E501 + def __init__(self, _123_list=None, _configuration=None): # noqa: E501 """List - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.__123_list = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, List): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, List): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/map_test.py b/samples/client/petstore/python/petstore_api/models/map_test.py index f2633c30a99..afe2546fc15 100644 --- a/samples/client/petstore/python/petstore_api/models/map_test.py +++ b/samples/client/petstore/python/petstore_api/models/map_test.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class MapTest(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class MapTest(object): 'map_of_enum_string': 'map_of_enum_string' } - def __init__(self, map_map_of_string=None, map_of_enum_string=None): # noqa: E501 + def __init__(self, map_map_of_string=None, map_of_enum_string=None, _configuration=None): # noqa: E501 """MapTest - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._map_map_of_string = None self._map_of_enum_string = None @@ -92,7 +97,8 @@ def map_of_enum_string(self, map_of_enum_string): :type: dict(str, str) """ allowed_values = ["UPPER", "lower"] # noqa: E501 - if not set(map_of_enum_string.keys()).issubset(set(allowed_values)): + if (self._configuration.client_side_validation and + not set(map_of_enum_string.keys()).issubset(set(allowed_values))): # noqa: E501 raise ValueError( "Invalid keys in `map_of_enum_string` [{0}], must be a subset of [{1}]" # noqa: E501 .format(", ".join(map(str, set(map_of_enum_string.keys()) - set(allowed_values))), # noqa: E501 @@ -141,8 +147,11 @@ def __eq__(self, other): if not isinstance(other, MapTest): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, MapTest): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py index cee99da3129..59aceef5a12 100644 --- a/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py +++ b/samples/client/petstore/python/petstore_api/models/mixed_properties_and_additional_properties_class.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class MixedPropertiesAndAdditionalPropertiesClass(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -42,8 +44,11 @@ class MixedPropertiesAndAdditionalPropertiesClass(object): 'map': 'map' } - def __init__(self, uuid=None, date_time=None, map=None): # noqa: E501 + def __init__(self, uuid=None, date_time=None, map=None, _configuration=None): # noqa: E501 """MixedPropertiesAndAdditionalPropertiesClass - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._uuid = None self._date_time = None @@ -160,8 +165,11 @@ def __eq__(self, other): if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, MixedPropertiesAndAdditionalPropertiesClass): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/model200_response.py b/samples/client/petstore/python/petstore_api/models/model200_response.py index 1fcaabca10e..373207ab169 100644 --- a/samples/client/petstore/python/petstore_api/models/model200_response.py +++ b/samples/client/petstore/python/petstore_api/models/model200_response.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Model200Response(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class Model200Response(object): '_class': 'class' } - def __init__(self, name=None, _class=None): # noqa: E501 + def __init__(self, name=None, _class=None, _configuration=None): # noqa: E501 """Model200Response - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._name = None self.__class = None @@ -134,8 +139,11 @@ def __eq__(self, other): if not isinstance(other, Model200Response): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Model200Response): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/model_200_response.py b/samples/client/petstore/python/petstore_api/models/model_200_response.py deleted file mode 100644 index 60f9c96a676..00000000000 --- a/samples/client/petstore/python/petstore_api/models/model_200_response.py +++ /dev/null @@ -1,138 +0,0 @@ -# coding: utf-8 - -""" - Swagger Petstore - - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 - - OpenAPI spec version: 1.0.0 - Contact: apiteam@swagger.io - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - - -import pprint -import re # noqa: F401 - -import six - - -class Model200Response(object): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'int', - '_class': 'str' - } - - attribute_map = { - 'name': 'name', - '_class': 'class' - } - - def __init__(self, name=None, _class=None): # noqa: E501 - """Model200Response - a model defined in Swagger""" # noqa: E501 - - self._name = None - self.__class = None - self.discriminator = None - - if name is not None: - self.name = name - if _class is not None: - self._class = _class - - @property - def name(self): - """Gets the name of this Model200Response. # noqa: E501 - - - :return: The name of this Model200Response. # noqa: E501 - :rtype: int - """ - return self._name - - @name.setter - def name(self, name): - """Sets the name of this Model200Response. - - - :param name: The name of this Model200Response. # noqa: E501 - :type: int - """ - - self._name = name - - @property - def _class(self): - """Gets the _class of this Model200Response. # noqa: E501 - - - :return: The _class of this Model200Response. # noqa: E501 - :rtype: str - """ - return self.__class - - @_class.setter - def _class(self, _class): - """Sets the _class of this Model200Response. - - - :param _class: The _class of this Model200Response. # noqa: E501 - :type: str - """ - - self.__class = _class - - def to_dict(self): - """Returns the model properties as a dict""" - result = {} - - for attr, _ in six.iteritems(self.swagger_types): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - else: - result[attr] = value - - return result - - def to_str(self): - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self): - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other): - """Returns true if both objects are equal""" - if not isinstance(other, Model200Response): - return False - - return self.__dict__ == other.__dict__ - - def __ne__(self, other): - """Returns true if both objects are not equal""" - return not self == other diff --git a/samples/client/petstore/python/petstore_api/models/model_return.py b/samples/client/petstore/python/petstore_api/models/model_return.py index 79253611495..0f328c3e33f 100644 --- a/samples/client/petstore/python/petstore_api/models/model_return.py +++ b/samples/client/petstore/python/petstore_api/models/model_return.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class ModelReturn(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class ModelReturn(object): '_return': 'return' } - def __init__(self, _return=None): # noqa: E501 + def __init__(self, _return=None, _configuration=None): # noqa: E501 """ModelReturn - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.__return = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, ModelReturn): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ModelReturn): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/name.py b/samples/client/petstore/python/petstore_api/models/name.py index 53be7953ea9..ba8196faf46 100644 --- a/samples/client/petstore/python/petstore_api/models/name.py +++ b/samples/client/petstore/python/petstore_api/models/name.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Name(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -44,8 +46,11 @@ class Name(object): '_123_number': '123Number' } - def __init__(self, name=None, snake_case=None, _property=None, _123_number=None): # noqa: E501 + def __init__(self, name=None, snake_case=None, _property=None, _123_number=None, _configuration=None): # noqa: E501 """Name - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._name = None self._snake_case = None @@ -79,7 +84,7 @@ def name(self, name): :param name: The name of this Name. # noqa: E501 :type: int """ - if name is None: + if self._configuration.client_side_validation and name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -187,8 +192,11 @@ def __eq__(self, other): if not isinstance(other, Name): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Name): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/number_only.py b/samples/client/petstore/python/petstore_api/models/number_only.py index 2f43a834f8b..804e393cf7c 100644 --- a/samples/client/petstore/python/petstore_api/models/number_only.py +++ b/samples/client/petstore/python/petstore_api/models/number_only.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class NumberOnly(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class NumberOnly(object): 'just_number': 'JustNumber' } - def __init__(self, just_number=None): # noqa: E501 + def __init__(self, just_number=None, _configuration=None): # noqa: E501 """NumberOnly - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._just_number = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, NumberOnly): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, NumberOnly): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/numbers.py b/samples/client/petstore/python/petstore_api/models/numbers.py new file mode 100644 index 00000000000..526a62eb648 --- /dev/null +++ b/samples/client/petstore/python/petstore_api/models/numbers.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +import pprint +import re # noqa: F401 + +import six + +from petstore_api.configuration import Configuration + + +class Numbers(object): + """NOTE: This class is auto generated by the swagger code generator program. + + Do not edit the class manually. + """ + + """ + allowed enum values + """ + _7 = "7" + _8 = "8" + _9 = "9" + _10 = "10" + + """ + Attributes: + swagger_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + swagger_types = { + } + + attribute_map = { + } + + def __init__(self, _configuration=None): # noqa: E501 + """Numbers - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration + self.discriminator = None + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map( + lambda x: x.to_dict() if hasattr(x, "to_dict") else x, + value + )) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict(map( + lambda item: (item[0], item[1].to_dict()) + if hasattr(item[1], "to_dict") else item, + value.items() + )) + else: + result[attr] = value + if issubclass(Numbers, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Numbers): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Numbers): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/order.py b/samples/client/petstore/python/petstore_api/models/order.py index 9291652787e..ad4efe203c2 100644 --- a/samples/client/petstore/python/petstore_api/models/order.py +++ b/samples/client/petstore/python/petstore_api/models/order.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Order(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -48,8 +50,11 @@ class Order(object): 'complete': 'complete' } - def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False): # noqa: E501 + def __init__(self, id=None, pet_id=None, quantity=None, ship_date=None, status=None, complete=False, _configuration=None): # noqa: E501 """Order - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._id = None self._pet_id = None @@ -177,7 +182,8 @@ def status(self, status): :type: str """ allowed_values = ["placed", "approved", "delivered"] # noqa: E501 - if status not in allowed_values: + if (self._configuration.client_side_validation and + status not in allowed_values): raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -246,8 +252,11 @@ def __eq__(self, other): if not isinstance(other, Order): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Order): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/outer_boolean.py b/samples/client/petstore/python/petstore_api/models/outer_boolean.py index 3b273333e75..64ef71982c5 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_boolean.py +++ b/samples/client/petstore/python/petstore_api/models/outer_boolean.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class OuterBoolean(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -36,8 +38,11 @@ class OuterBoolean(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, _configuration=None): # noqa: E501 """OuterBoolean - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.discriminator = None def to_dict(self): @@ -80,8 +85,11 @@ def __eq__(self, other): if not isinstance(other, OuterBoolean): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterBoolean): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/outer_composite.py b/samples/client/petstore/python/petstore_api/models/outer_composite.py index ec517a4620c..98cb079a635 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_composite.py +++ b/samples/client/petstore/python/petstore_api/models/outer_composite.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class OuterComposite(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -42,8 +44,11 @@ class OuterComposite(object): 'my_boolean': 'my_boolean' } - def __init__(self, my_number=None, my_string=None, my_boolean=None): # noqa: E501 + def __init__(self, my_number=None, my_string=None, my_boolean=None, _configuration=None): # noqa: E501 """OuterComposite - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._my_number = None self._my_string = None @@ -160,8 +165,11 @@ def __eq__(self, other): if not isinstance(other, OuterComposite): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterComposite): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/outer_enum.py b/samples/client/petstore/python/petstore_api/models/outer_enum.py index bea07410cf2..6734ac066e3 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_enum.py +++ b/samples/client/petstore/python/petstore_api/models/outer_enum.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class OuterEnum(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -43,8 +45,11 @@ class OuterEnum(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, _configuration=None): # noqa: E501 """OuterEnum - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.discriminator = None def to_dict(self): @@ -87,8 +92,11 @@ def __eq__(self, other): if not isinstance(other, OuterEnum): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterEnum): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/outer_number.py b/samples/client/petstore/python/petstore_api/models/outer_number.py index a60e97c8288..6dd397fbc1a 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_number.py +++ b/samples/client/petstore/python/petstore_api/models/outer_number.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class OuterNumber(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -36,8 +38,11 @@ class OuterNumber(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, _configuration=None): # noqa: E501 """OuterNumber - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.discriminator = None def to_dict(self): @@ -80,8 +85,11 @@ def __eq__(self, other): if not isinstance(other, OuterNumber): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterNumber): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/outer_string.py b/samples/client/petstore/python/petstore_api/models/outer_string.py index 622589ce2f6..fed6a765edb 100644 --- a/samples/client/petstore/python/petstore_api/models/outer_string.py +++ b/samples/client/petstore/python/petstore_api/models/outer_string.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class OuterString(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -36,8 +38,11 @@ class OuterString(object): attribute_map = { } - def __init__(self): # noqa: E501 + def __init__(self, _configuration=None): # noqa: E501 """OuterString - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self.discriminator = None def to_dict(self): @@ -80,8 +85,11 @@ def __eq__(self, other): if not isinstance(other, OuterString): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, OuterString): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/pet.py b/samples/client/petstore/python/petstore_api/models/pet.py index e91ba99a436..563798bd87e 100644 --- a/samples/client/petstore/python/petstore_api/models/pet.py +++ b/samples/client/petstore/python/petstore_api/models/pet.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Pet(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -48,8 +50,11 @@ class Pet(object): 'status': 'status' } - def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None): # noqa: E501 + def __init__(self, id=None, category=None, name=None, photo_urls=None, tags=None, status=None, _configuration=None): # noqa: E501 """Pet - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._id = None self._category = None @@ -130,7 +135,7 @@ def name(self, name): :param name: The name of this Pet. # noqa: E501 :type: str """ - if name is None: + if self._configuration.client_side_validation and name is None: raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 self._name = name @@ -153,7 +158,7 @@ def photo_urls(self, photo_urls): :param photo_urls: The photo_urls of this Pet. # noqa: E501 :type: list[str] """ - if photo_urls is None: + if self._configuration.client_side_validation and photo_urls is None: raise ValueError("Invalid value for `photo_urls`, must not be `None`") # noqa: E501 self._photo_urls = photo_urls @@ -200,7 +205,8 @@ def status(self, status): :type: str """ allowed_values = ["available", "pending", "sold"] # noqa: E501 - if status not in allowed_values: + if (self._configuration.client_side_validation and + status not in allowed_values): raise ValueError( "Invalid value for `status` ({0}), must be one of {1}" # noqa: E501 .format(status, allowed_values) @@ -248,8 +254,11 @@ def __eq__(self, other): if not isinstance(other, Pet): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Pet): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/read_only_first.py b/samples/client/petstore/python/petstore_api/models/read_only_first.py index 0a378f93da6..6bb37fcca08 100644 --- a/samples/client/petstore/python/petstore_api/models/read_only_first.py +++ b/samples/client/petstore/python/petstore_api/models/read_only_first.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class ReadOnlyFirst(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class ReadOnlyFirst(object): 'baz': 'baz' } - def __init__(self, bar=None, baz=None): # noqa: E501 + def __init__(self, bar=None, baz=None, _configuration=None): # noqa: E501 """ReadOnlyFirst - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._bar = None self._baz = None @@ -134,8 +139,11 @@ def __eq__(self, other): if not isinstance(other, ReadOnlyFirst): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, ReadOnlyFirst): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/special_model_name.py b/samples/client/petstore/python/petstore_api/models/special_model_name.py index 3817430b656..7012f2a2ba5 100644 --- a/samples/client/petstore/python/petstore_api/models/special_model_name.py +++ b/samples/client/petstore/python/petstore_api/models/special_model_name.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class SpecialModelName(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -38,8 +40,11 @@ class SpecialModelName(object): 'special_property_name': '$special[property.name]' } - def __init__(self, special_property_name=None): # noqa: E501 + def __init__(self, special_property_name=None, _configuration=None): # noqa: E501 """SpecialModelName - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._special_property_name = None self.discriminator = None @@ -108,8 +113,11 @@ def __eq__(self, other): if not isinstance(other, SpecialModelName): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, SpecialModelName): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/tag.py b/samples/client/petstore/python/petstore_api/models/tag.py index dc3c0b5645f..97a0b392217 100644 --- a/samples/client/petstore/python/petstore_api/models/tag.py +++ b/samples/client/petstore/python/petstore_api/models/tag.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class Tag(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -40,8 +42,11 @@ class Tag(object): 'name': 'name' } - def __init__(self, id=None, name=None): # noqa: E501 + def __init__(self, id=None, name=None, _configuration=None): # noqa: E501 """Tag - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._id = None self._name = None @@ -134,8 +139,11 @@ def __eq__(self, other): if not isinstance(other, Tag): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, Tag): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/models/user.py b/samples/client/petstore/python/petstore_api/models/user.py index 8dcac91845f..1b510e0efb7 100644 --- a/samples/client/petstore/python/petstore_api/models/user.py +++ b/samples/client/petstore/python/petstore_api/models/user.py @@ -16,6 +16,8 @@ import six +from petstore_api.configuration import Configuration + class User(object): """NOTE: This class is auto generated by the swagger code generator program. @@ -52,8 +54,11 @@ class User(object): 'user_status': 'userStatus' } - def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None): # noqa: E501 + def __init__(self, id=None, username=None, first_name=None, last_name=None, email=None, password=None, phone=None, user_status=None, _configuration=None): # noqa: E501 """User - a model defined in Swagger""" # noqa: E501 + if _configuration is None: + _configuration = Configuration() + self._configuration = _configuration self._id = None self._username = None @@ -292,8 +297,11 @@ def __eq__(self, other): if not isinstance(other, User): return False - return self.__dict__ == other.__dict__ + return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - return not self == other + if not isinstance(other, User): + return True + + return self.to_dict() != other.to_dict() diff --git a/samples/client/petstore/python/petstore_api/rest.py b/samples/client/petstore/python/petstore_api/rest.py index ef55c4ea44a..00b43a2e4ff 100644 --- a/samples/client/petstore/python/petstore_api/rest.py +++ b/samples/client/petstore/python/petstore_api/rest.py @@ -156,7 +156,7 @@ def request(self, method, url, query_params=None, headers=None, if query_params: url += '?' + urlencode(query_params) if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = None + request_body = '{}' if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( diff --git a/samples/client/petstore/python/test/test_boolean.py b/samples/client/petstore/python/test/test_boolean.py new file mode 100644 index 00000000000..1fa78246895 --- /dev/null +++ b/samples/client/petstore/python/test/test_boolean.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.boolean import Boolean # noqa: E501 +from petstore_api.rest import ApiException + + +class TestBoolean(unittest.TestCase): + """Boolean unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testBoolean(self): + """Test Boolean""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.boolean.Boolean() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_fake_api.py b/samples/client/petstore/python/test/test_fake_api.py index 00473d4a13b..4c6e00c4a79 100644 --- a/samples/client/petstore/python/test/test_fake_api.py +++ b/samples/client/petstore/python/test/test_fake_api.py @@ -53,6 +53,12 @@ def test_fake_outer_string_serialize(self): """ pass + def test_test_body_with_query_params(self): + """Test case for test_body_with_query_params + + """ + pass + def test_test_client_model(self): """Test case for test_client_model diff --git a/samples/client/petstore/python/test/test_ints.py b/samples/client/petstore/python/test/test_ints.py new file mode 100644 index 00000000000..8d764e74884 --- /dev/null +++ b/samples/client/petstore/python/test/test_ints.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.ints import Ints # noqa: E501 +from petstore_api.rest import ApiException + + +class TestInts(unittest.TestCase): + """Ints unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testInts(self): + """Test Ints""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.ints.Ints() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/python/test/test_model_200_response.py b/samples/client/petstore/python/test/test_model_200_response.py index f577dd42144..ccc768fc8f7 100644 --- a/samples/client/petstore/python/test/test_model_200_response.py +++ b/samples/client/petstore/python/test/test_model_200_response.py @@ -16,7 +16,7 @@ import unittest import petstore_api -from petstore_api.models.model_200_response import Model200Response # noqa: E501 +from petstore_api.models.model200_response import Model200Response # noqa: E501 from petstore_api.rest import ApiException diff --git a/samples/client/petstore/python/test/test_numbers.py b/samples/client/petstore/python/test/test_numbers.py new file mode 100644 index 00000000000..2c565e08f51 --- /dev/null +++ b/samples/client/petstore/python/test/test_numbers.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Swagger Petstore + + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501 + + OpenAPI spec version: 1.0.0 + Contact: apiteam@swagger.io + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + + +from __future__ import absolute_import + +import unittest + +import petstore_api +from petstore_api.models.numbers import Numbers # noqa: E501 +from petstore_api.rest import ApiException + + +class TestNumbers(unittest.TestCase): + """Numbers unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testNumbers(self): + """Test Numbers""" + # FIXME: construct object with mandatory attributes with example values + # model = petstore_api.models.numbers.Numbers() # noqa: E501 + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/samples/client/petstore/r_test/.swagger-codegen/VERSION b/samples/client/petstore/r_test/.swagger-codegen/VERSION index 017674fb59d..4b308f2ac9e 100644 --- a/samples/client/petstore/r_test/.swagger-codegen/VERSION +++ b/samples/client/petstore/r_test/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.15-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/r_test/NAMESPACE b/samples/client/petstore/r_test/NAMESPACE index 0b927aa549d..84f63d624c5 100644 --- a/samples/client/petstore/r_test/NAMESPACE +++ b/samples/client/petstore/r_test/NAMESPACE @@ -9,3 +9,6 @@ export(Order) export(Pet) export(Tag) export(User) +export(PetApi) +export(StoreApi) +export(UserApi) diff --git a/samples/client/petstore/r_test/R/ApiResponse.r b/samples/client/petstore/r_test/R/ApiResponse.r index d8a182d2463..62e7456e621 100644 --- a/samples/client/petstore/r_test/R/ApiResponse.r +++ b/samples/client/petstore/r_test/R/ApiResponse.r @@ -65,7 +65,7 @@ ApiResponse <- R6::R6Class( toJSONString = function() { sprintf( '{ - "code": %s, + "code": %d, "type": %s, "message": %s }', diff --git a/samples/client/petstore/r_test/R/Order.r b/samples/client/petstore/r_test/R/Order.r index d7054e2458c..6cbf1987d40 100644 --- a/samples/client/petstore/r_test/R/Order.r +++ b/samples/client/petstore/r_test/R/Order.r @@ -102,7 +102,7 @@ Order <- R6::R6Class( '{ "id": %d, "petId": %d, - "quantity": %s, + "quantity": %d, "shipDate": %s, "status": %s, "complete": %s diff --git a/samples/client/petstore/r_test/R/User.r b/samples/client/petstore/r_test/R/User.r index 9df47561c2e..12587b5f9cb 100644 --- a/samples/client/petstore/r_test/R/User.r +++ b/samples/client/petstore/r_test/R/User.r @@ -132,7 +132,7 @@ User <- R6::R6Class( "email": %s, "password": %s, "phone": %s, - "userStatus": %s + "userStatus": %d }', self$`id`, self$`username`, diff --git a/samples/client/petstore/ruby/.swagger-codegen/VERSION b/samples/client/petstore/ruby/.swagger-codegen/VERSION index 017674fb59d..0443c4ad098 100644 --- a/samples/client/petstore/ruby/.swagger-codegen/VERSION +++ b/samples/client/petstore/ruby/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.16-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ruby/Gemfile b/samples/client/petstore/ruby/Gemfile index d255a3ab238..f58bec06367 100644 --- a/samples/client/petstore/ruby/Gemfile +++ b/samples/client/petstore/ruby/Gemfile @@ -3,5 +3,5 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rake', '~> 12.0.0' + gem 'rake', '~> 12.3.3' end diff --git a/samples/client/petstore/ruby/Gemfile.lock b/samples/client/petstore/ruby/Gemfile.lock index e7791399b9a..24b43738046 100644 --- a/samples/client/petstore/ruby/Gemfile.lock +++ b/samples/client/petstore/ruby/Gemfile.lock @@ -26,7 +26,7 @@ GEM hashdiff (0.3.4) json (2.1.0) public_suffix (2.0.5) - rake (12.0.0) + rake (12.3.3) rspec (3.6.0) rspec-core (~> 3.6.0) rspec-expectations (~> 3.6.0) @@ -60,7 +60,7 @@ DEPENDENCIES autotest-growl (~> 0.2, >= 0.2.16) autotest-rails-pure (~> 4.1, >= 4.1.2) petstore! - rake (~> 12.0.0) + rake (~> 12.3.3) rspec (~> 3.6, >= 3.6.0) vcr (~> 3.0, >= 3.0.1) webmock (~> 1.24, >= 1.24.3) diff --git a/samples/client/petstore/ruby/README.md b/samples/client/petstore/ruby/README.md index 03a5f0b1624..e6216d676d1 100644 --- a/samples/client/petstore/ruby/README.md +++ b/samples/client/petstore/ruby/README.md @@ -119,9 +119,11 @@ Class | Method | HTTP request | Description - [Petstore::ArrayOfNumberOnly](docs/ArrayOfNumberOnly.md) - [Petstore::ArrayTest](docs/ArrayTest.md) - [Petstore::Capitalization](docs/Capitalization.md) + - [Petstore::Cat](docs/Cat.md) - [Petstore::Category](docs/Category.md) - [Petstore::ClassModel](docs/ClassModel.md) - [Petstore::Client](docs/Client.md) + - [Petstore::Dog](docs/Dog.md) - [Petstore::EnumArrays](docs/EnumArrays.md) - [Petstore::EnumClass](docs/EnumClass.md) - [Petstore::EnumTest](docs/EnumTest.md) @@ -145,8 +147,6 @@ Class | Method | HTTP request | Description - [Petstore::SpecialModelName](docs/SpecialModelName.md) - [Petstore::Tag](docs/Tag.md) - [Petstore::User](docs/User.md) - - [Petstore::Cat](docs/Cat.md) - - [Petstore::Dog](docs/Dog.md) ## Documentation for Authorization diff --git a/samples/client/petstore/ruby/lib/petstore.rb b/samples/client/petstore/ruby/lib/petstore.rb index c737083bc72..f9178c3093d 100644 --- a/samples/client/petstore/ruby/lib/petstore.rb +++ b/samples/client/petstore/ruby/lib/petstore.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -25,9 +25,11 @@ require 'petstore/models/array_of_number_only' require 'petstore/models/array_test' require 'petstore/models/capitalization' +require 'petstore/models/cat' require 'petstore/models/category' require 'petstore/models/class_model' require 'petstore/models/client' +require 'petstore/models/dog' require 'petstore/models/enum_arrays' require 'petstore/models/enum_class' require 'petstore/models/enum_test' @@ -51,8 +53,6 @@ require 'petstore/models/special_model_name' require 'petstore/models/tag' require 'petstore/models/user' -require 'petstore/models/cat' -require 'petstore/models/dog' # APIs require 'petstore/api/another_fake_api' 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 3b5276e9929..1820a55565d 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end 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 3d83f572be7..d62894794fe 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/fake_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end 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 97198936bbb..a66299b4818 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 @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end 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 df71a87cd3d..ed93deaca0a 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/pet_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end 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 5d1da3a5ca3..6e5e90534c9 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/store_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/store_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end 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 cead48440d3..e98e72edf2b 100644 --- a/samples/client/petstore/ruby/lib/petstore/api/user_api.rb +++ b/samples/client/petstore/ruby/lib/petstore/api/user_api.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/api_client.rb b/samples/client/petstore/ruby/lib/petstore/api_client.rb index 9bab5647b5d..84f6e8eeaaf 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_client.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -15,7 +15,7 @@ require 'logger' require 'tempfile' require 'typhoeus' -require 'uri' +require 'addressable/uri' module Petstore class ApiClient @@ -63,7 +63,7 @@ def call_api(http_method, path, opts = {}) :message => response.return_message) else fail ApiError.new(:code => response.code, - :response_headers => response.headers, + :response_headers => response.headers.to_h, :response_body => response.body), response.status_message end @@ -112,6 +112,8 @@ def build_request(http_method, path, opts = {}) :verbose => @config.debugging } + req_opts.merge!(multipart: true) if header_params['Content-Type'].start_with? "multipart/" + # set custom cert, if provided req_opts[:cainfo] = @config.ssl_ca_cert if @config.ssl_ca_cert @@ -264,7 +266,7 @@ def sanitize_filename(filename) def build_request_url(path) # Add leading and trailing slashes to path path = "/#{path}".gsub(/\/+/, '/') - URI.encode(@config.base_url + path) + Addressable::URI.encode(@config.base_url + path) end # Builds the HTTP request body diff --git a/samples/client/petstore/ruby/lib/petstore/api_error.rb b/samples/client/petstore/ruby/lib/petstore/api_error.rb index 90e697ea6ae..bfb23ed2401 100644 --- a/samples/client/petstore/ruby/lib/petstore/api_error.rb +++ b/samples/client/petstore/ruby/lib/petstore/api_error.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/configuration.rb b/samples/client/petstore/ruby/lib/petstore/configuration.rb index a3897a20dd2..6a238a3a556 100644 --- a/samples/client/petstore/ruby/lib/petstore/configuration.rb +++ b/samples/client/petstore/ruby/lib/petstore/configuration.rb @@ -6,11 +6,11 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end -require 'uri' +require 'addressable/uri' module Petstore class Configuration @@ -175,7 +175,7 @@ def base_path=(base_path) def base_url url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') - URI.encode(url) + Addressable::URI.encode(url) end # Gets API key (with prefix if set). diff --git a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb index 628c9d01f38..c461d0ecf04 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/additional_properties_class.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -96,7 +96,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -192,5 +192,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal.rb b/samples/client/petstore/ruby/lib/petstore/models/animal.rb index 36dc48ea009..4166472bd44 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -99,7 +99,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -195,5 +195,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb index 28bb8dc9f04..55a4a0c7715 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/animal_farm.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -74,7 +74,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -170,5 +170,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb index 92fce1c3c28..1b862a54068 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/api_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/api_response.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -101,7 +101,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -197,5 +197,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb index b7bcf78df42..aa098102e57 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_array_of_number_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -85,7 +85,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -181,5 +181,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb index ecc512cc632..74c7b9ee577 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_of_number_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -85,7 +85,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -181,5 +181,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb index e1ef9bdd9c8..3c1956544e0 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/array_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/array_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -107,7 +107,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -203,5 +203,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb index 0da649114ec..0c6fdcd27fc 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/capitalization.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -129,7 +129,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -225,5 +225,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/cat.rb b/samples/client/petstore/ruby/lib/petstore/models/cat.rb index c3ca6e15561..3da29590f6d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/cat.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/cat.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -108,7 +108,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -204,5 +204,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/category.rb b/samples/client/petstore/ruby/lib/petstore/models/category.rb index 55ce5150b5a..185b0db2294 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/category.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/category.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -92,7 +92,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -188,5 +188,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb index 4557449c163..da9ea871323 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/class_model.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/class_model.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -84,7 +84,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -180,5 +180,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/client.rb b/samples/client/petstore/ruby/lib/petstore/models/client.rb index 00688886ed6..f77087a4e77 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/client.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/client.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -83,7 +83,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -179,5 +179,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/dog.rb b/samples/client/petstore/ruby/lib/petstore/models/dog.rb index 723697063c9..8f792d2f19c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/dog.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/dog.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -108,7 +108,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -204,5 +204,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb index 54c1e97a954..ab1b9261009 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_arrays.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -128,7 +128,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -224,5 +224,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb index 4932da0527c..f88c4b57beb 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_class.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb index 63d9864ee47..b88ed2c5bc2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/enum_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -194,7 +194,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -290,5 +290,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb index 323f7e2efc6..cc945bcab14 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/format_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/format_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -397,7 +397,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -493,5 +493,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb index 682ed871d25..57a5dcb1143 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/has_only_read_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -92,7 +92,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -188,5 +188,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/list.rb b/samples/client/petstore/ruby/lib/petstore/models/list.rb index bb95065c08f..c7d9ea4d875 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/list.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/list.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -83,7 +83,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -179,5 +179,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb index 0e07f6b07b6..e985e71ec1d 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/map_test.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/map_test.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -118,7 +118,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -214,5 +214,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb index fbc4e09e6b1..a1938120ae9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/mixed_properties_and_additional_properties_class.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -103,7 +103,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -199,5 +199,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb index 40f8c1dd476..2d907646865 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_200_response.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -93,7 +93,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -189,5 +189,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb index 1568b5f9ed2..d9dbbdf9a60 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/model_return.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/model_return.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -84,7 +84,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -180,5 +180,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/name.rb b/samples/client/petstore/ruby/lib/petstore/models/name.rb index dedc947e1ec..17116afdcf2 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/name.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -116,7 +116,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -212,5 +212,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb index 359a0b909d0..f80578c1834 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/number_only.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/number_only.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -83,7 +83,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -179,5 +179,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/order.rb b/samples/client/petstore/ruby/lib/petstore/models/order.rb index 3d1ed68213b..200419a00a6 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/order.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/order.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -165,7 +165,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -261,5 +261,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb index 2a375b5f882..3f51cf3c79e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_boolean.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -74,7 +74,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -170,5 +170,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb index ba955ea31f2..fcb9167cbb5 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_composite.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -101,7 +101,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -197,5 +197,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb index 0bdb3f37255..0314b3f7c48 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_enum.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb index a79006d2872..2dd66c83a4a 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_number.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -74,7 +74,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -170,5 +170,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb b/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb index 63a7c17f9dd..35779fe39b9 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/outer_string.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -74,7 +74,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -170,5 +170,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/pet.rb b/samples/client/petstore/ruby/lib/petstore/models/pet.rb index a48e1e4b0bb..84f763dff4e 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/pet.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/pet.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -177,7 +177,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -273,5 +273,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb index 6703c3a38f5..ec3db1c62fd 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/read_only_first.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -92,7 +92,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -188,5 +188,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb index 7c9e9b1df8d..8dfe91f923c 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/special_model_name.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -83,7 +83,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -179,5 +179,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/tag.rb b/samples/client/petstore/ruby/lib/petstore/models/tag.rb index 3b89ac9cbe6..fbada771e25 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/tag.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/tag.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -92,7 +92,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -188,5 +188,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/models/user.rb b/samples/client/petstore/ruby/lib/petstore/models/user.rb index 08efe4c3b0e..1d3bb555e7f 100644 --- a/samples/client/petstore/ruby/lib/petstore/models/user.rb +++ b/samples/client/petstore/ruby/lib/petstore/models/user.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -147,7 +147,7 @@ def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i - # check to ensure the input is an array given that the the attribute + # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) @@ -243,5 +243,6 @@ def _to_hash(value) value end end + end end diff --git a/samples/client/petstore/ruby/lib/petstore/version.rb b/samples/client/petstore/ruby/lib/petstore/version.rb index a7643760122..2f5f87c9635 100644 --- a/samples/client/petstore/ruby/lib/petstore/version.rb +++ b/samples/client/petstore/ruby/lib/petstore/version.rb @@ -6,7 +6,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end diff --git a/samples/client/petstore/ruby/petstore.gemspec b/samples/client/petstore/ruby/petstore.gemspec index 5da6377a35c..79539b5d59b 100644 --- a/samples/client/petstore/ruby/petstore.gemspec +++ b/samples/client/petstore/ruby/petstore.gemspec @@ -8,7 +8,7 @@ OpenAPI spec version: 1.0.0 Contact: apiteam@swagger.io Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 2.4.3-SNAPSHOT +Swagger Codegen version: 2.4.16-SNAPSHOT =end @@ -29,6 +29,7 @@ Gem::Specification.new do |s| s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' diff --git a/samples/client/petstore/scala/pom.xml b/samples/client/petstore/scala/pom.xml index dc83c236251..934e163b5a5 100644 --- a/samples/client/petstore/scala/pom.xml +++ b/samples/client/petstore/scala/pom.xml @@ -240,12 +240,12 @@ 1.9.2 2.9.9 1.19.4 - 1.5.18 + 1.5.24 1.0.5 1.0.0 2.9.2 - 4.12 + 4.13.1 3.1.5 3.0.4 0.3.5 diff --git a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala index b47f7002e96..fda17ec6261 100644 --- a/samples/client/petstore/scala/src/test/scala/UserApiTest.scala +++ b/samples/client/petstore/scala/src/test/scala/UserApiTest.scala @@ -54,7 +54,7 @@ class UserApiTest extends FlatSpec with Matchers with BeforeAndAfterAll { it should "authenticate a user" in { api.loginUser("scala-test-username", "SCALATEST") match { - case Some(status) => status.startsWith("logged in user session") match { + case Some(status) => status.contains("logged in user session") match { case true => // success! case _ => fail("didn't get expected message " + status) } diff --git a/samples/client/petstore/spring-cloud/.swagger-codegen/VERSION b/samples/client/petstore/spring-cloud/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/spring-cloud/.swagger-codegen/VERSION +++ b/samples/client/petstore/spring-cloud/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index 1c927dea75a..c02765870ae 100644 --- a/samples/client/petstore/spring-cloud/pom.xml +++ b/samples/client/petstore/spring-cloud/pom.xml @@ -9,7 +9,7 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 org.springframework.boot diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java index 081efb62a2d..d33fdbd827d 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.3-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "Pet", description = "the Pet API") @RequestMapping(value = "/v2") public interface PetApi { diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java index 7a5fb5aebf7..9dbbcff2aa0 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.3-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "Store", description = "the Store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java index 9a9b7222caa..cc3fcc6d0ff 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.3-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "User", description = "the User API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Amount.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Amount.java index 5fb2b280d41..9d8fe3944a7 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Amount.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Amount.java @@ -15,6 +15,7 @@ @ApiModel(description = "some description ") @Validated + public class Amount { @JsonProperty("value") private Double value = null; diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java index df35945a32a..2e3da399d5c 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Category.java @@ -15,6 +15,7 @@ @ApiModel(description = "A category for a pet") @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java index 1ee3e44a828..29af821902c 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/ModelApiResponse.java @@ -15,6 +15,7 @@ @ApiModel(description = "Describes the result of uploading an image resource") @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java index 20fed9ca2da..07384880f82 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Order.java @@ -17,6 +17,7 @@ @ApiModel(description = "An order for a pets from the pet store") @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java index af7831825fd..92e7dbdd447 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Pet.java @@ -20,6 +20,7 @@ @ApiModel(description = "A pet for sale in the pet store") @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java index c8aab419da2..2905577d80f 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/Tag.java @@ -15,6 +15,7 @@ @ApiModel(description = "A tag for a pet") @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java index 7d14cfbbd5f..14981d6705f 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java +++ b/samples/client/petstore/spring-cloud/src/main/java/io/swagger/model/User.java @@ -15,6 +15,7 @@ @ApiModel(description = "A User who is purchasing from the pet store") @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/PetApiTest.java b/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/PetApiTest.java index f369ac786ca..732fc20648a 100644 --- a/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/PetApiTest.java +++ b/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/PetApiTest.java @@ -53,7 +53,6 @@ public void testUpdatePet() throws Exception { assertEquals(fetched.getCategory().getName(), pet.getCategory().getName()); } - @Ignore @Test public void testFindPetsByStatus() throws Exception { Pet pet = createRandomPet(); @@ -76,7 +75,6 @@ public void testFindPetsByStatus() throws Exception { assertTrue(found); } - @Ignore @Test public void testFindPetsByTags() throws Exception { Pet pet = createRandomPet(); diff --git a/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/StoreApiTest.java b/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/StoreApiTest.java index 2fdcfef5646..0ace35488c6 100644 --- a/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/StoreApiTest.java +++ b/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/StoreApiTest.java @@ -4,10 +4,12 @@ import io.swagger.Application; import io.swagger.TestUtils; import io.swagger.model.Order; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.http.ResponseEntity; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.threeten.bp.OffsetDateTime; @@ -32,31 +34,32 @@ public void testGetInventory() { @Test public void testPlaceOrder() { Order order = createOrder(); - client.placeOrder(order).execute(); - - Order fetched = client.getOrderById(order.getId()).execute().getBody(); + Order fetched = client.placeOrder(order).execute().getBody(); + // TODO we are using petstore-with-fake-endpoints-models-for-testing.yaml which has a constraing >1 <5 on this method + // use a different spec or fix this + // Order fetched = client.getOrderById(order.getId()).execute().getBody(); assertEquals(order.getId(), fetched.getId()); assertEquals(order.getPetId(), fetched.getPetId()); assertEquals(order.getQuantity(), fetched.getQuantity()); assertEquals(order.getShipDate().toInstant(), fetched.getShipDate().toInstant()); } - @Test public void testDeleteOrder() { Order order = createOrder(); - client.placeOrder(order).execute(); - - Order fetched = client.getOrderById(order.getId()).execute().getBody(); + Order fetched = client.placeOrder(order).execute().getBody(); + // TODO we are using petstore-with-fake-endpoints-models-for-testing.yaml which has a constraing >1 <5 on this method + // use a different spec or fix this + // Order fetched = client.getOrderById(order.getId()).execute().getBody(); assertEquals(fetched.getId(), order.getId()); - client.deleteOrder(String.valueOf(order.getId())).execute(); - - try { + // TODO we are using petstore-with-fake-endpoints-models-for-testing.yaml which has a constraing >1 <5 on this method + // use a different spec or fix this +/* try { client.getOrderById(order.getId()).execute(); fail("expected an error"); } catch (HystrixRuntimeException e) { assertTrue(e.getCause().getMessage().startsWith("status 404 ")); - } + }*/ } private Order createOrder() { diff --git a/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/UserApiTest.java b/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/UserApiTest.java index b0ffb72e7b5..ef5223a88a9 100644 --- a/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/UserApiTest.java +++ b/samples/client/petstore/spring-cloud/src/test/java/io/swagger/api/UserApiTest.java @@ -3,6 +3,7 @@ import io.swagger.Application; import io.swagger.TestUtils; import io.swagger.model.User; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; @@ -28,7 +29,7 @@ public void testCreateUser() { client.createUser(user).execute(); User fetched = client.getUserByName(user.getUsername()).execute().getBody(); - assertEquals(user.getId(), fetched.getId()); + assertEquals(user.getUsername(), fetched.getUsername()); } @Test @@ -41,7 +42,7 @@ public void testCreateUsersWithArray() { client.createUsersWithArrayInput(Arrays.asList(user1, user2)).execute(); User fetched = client.getUserByName(user1.getUsername()).execute().getBody(); - assertEquals(user1.getId(), fetched.getId()); + assertEquals(user1.getUsername(), fetched.getUsername()); } @Test @@ -54,18 +55,20 @@ public void testCreateUsersWithList() { client.createUsersWithListInput(Arrays.asList(user1, user2)).execute(); User fetched = client.getUserByName(user1.getUsername()).execute().getBody(); - assertEquals(user1.getId(), fetched.getId()); + assertEquals(user1.getUsername(), fetched.getUsername()); } + @Test public void testLoginUser() { User user = createUser(); client.createUser(user).execute(); String token = client.loginUser(user.getUsername(), user.getPassword()).execute().getBody(); - assertTrue(token.startsWith("logged in user session:")); + assertTrue(token.contains("logged in user session:")); } + @Test public void logoutUser() { client.logoutUser().execute(); diff --git a/samples/client/petstore/spring-stubs/.swagger-codegen/VERSION b/samples/client/petstore/spring-stubs/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/spring-stubs/.swagger-codegen/VERSION +++ b/samples/client/petstore/spring-stubs/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java index 640810f888f..8a0a7e0410d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.3-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -144,6 +145,6 @@ public interface PetApi { produces = "application/json", consumes = "multipart/form-data", method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file); } diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java index 2feabccd60d..de0359be13d 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.3-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java index 488c2e79b29..58221b3a58a 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.3-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Amount.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Amount.java index 5fb2b280d41..9d8fe3944a7 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Amount.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Amount.java @@ -15,6 +15,7 @@ @ApiModel(description = "some description ") @Validated + public class Amount { @JsonProperty("value") private Double value = null; diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java index df35945a32a..2e3da399d5c 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Category.java @@ -15,6 +15,7 @@ @ApiModel(description = "A category for a pet") @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java index 1ee3e44a828..29af821902c 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/ModelApiResponse.java @@ -15,6 +15,7 @@ @ApiModel(description = "Describes the result of uploading an image resource") @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java index 20fed9ca2da..07384880f82 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Order.java @@ -17,6 +17,7 @@ @ApiModel(description = "An order for a pets from the pet store") @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java index af7831825fd..92e7dbdd447 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Pet.java @@ -20,6 +20,7 @@ @ApiModel(description = "A pet for sale in the pet store") @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java index c8aab419da2..2905577d80f 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/Tag.java @@ -15,6 +15,7 @@ @ApiModel(description = "A tag for a pet") @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java index 7d14cfbbd5f..14981d6705f 100644 --- a/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java +++ b/samples/client/petstore/spring-stubs/src/main/java/io/swagger/model/User.java @@ -15,6 +15,7 @@ @ApiModel(description = "A User who is purchasing from the pet store") @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md index e0acf722db1..2d804daea01 100644 --- a/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md +++ b/samples/client/petstore/swift/promisekit/SwaggerClientTests/Pods/Alamofire/README.md @@ -1288,7 +1288,7 @@ The [ASF](https://github.com/Alamofire/Foundation#members) is looking to raise m * Potentially fund test servers to make it easier for us to test the edge cases * Potentially fund developers to work on one of our projects full-time -The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiam around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated. +The community adoption of the ASF libraries has been amazing. We are greatly humbled by your enthusiasm around the projects, and want to continue to do everything we can to move the needle forward. With your continued support, the ASF will be able to improve its reach and also provide better legal safety for the core members. If you use any of our libraries for work, see if your employers would be interested in donating. Our initial goal is to raise $1000 to get all our legal ducks in a row and kickstart this campaign. Any amount you can donate today to help us reach our goal would be greatly appreciated. Click here to lend your support to: Alamofire Software Foundation and make a donation at pledgie.com ! diff --git a/samples/client/petstore/swift5/default/.swagger-codegen/VERSION b/samples/client/petstore/swift5/default/.swagger-codegen/VERSION index a4533be7fa8..8c7754221a4 100644 --- a/samples/client/petstore/swift5/default/.swagger-codegen/VERSION +++ b/samples/client/petstore/swift5/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.11-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Boolean.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Boolean.swift new file mode 100644 index 00000000000..3533aa3a76f --- /dev/null +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Boolean.swift @@ -0,0 +1,16 @@ +// +// Boolean.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** True or False indicator */ +public enum Boolean: Bool, Codable { + case _true = "true" + case _false = "false" + +} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Ints.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Ints.swift new file mode 100644 index 00000000000..18d8fd47188 --- /dev/null +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Ints.swift @@ -0,0 +1,21 @@ +// +// Ints.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** True or False indicator */ +public enum Ints: Int, Codable { + case _0 = "0" + case _1 = "1" + case _2 = "2" + case _3 = "3" + case _4 = "4" + case _5 = "5" + case _6 = "6" + +} diff --git a/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Numbers.swift b/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Numbers.swift new file mode 100644 index 00000000000..cab1986c14c --- /dev/null +++ b/samples/client/petstore/swift5/default/PetstoreClient/Classes/Swaggers/Models/Numbers.swift @@ -0,0 +1,18 @@ +// +// Numbers.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** some number */ +public enum Numbers: Double, Codable { + case _7 = "7" + case _8 = "8" + case _9 = "9" + case _10 = "10" + +} diff --git a/samples/client/petstore/swift5/promisekit/.swagger-codegen/VERSION b/samples/client/petstore/swift5/promisekit/.swagger-codegen/VERSION index a4533be7fa8..8c7754221a4 100644 --- a/samples/client/petstore/swift5/promisekit/.swagger-codegen/VERSION +++ b/samples/client/petstore/swift5/promisekit/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.11-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Boolean.swift b/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Boolean.swift new file mode 100644 index 00000000000..3533aa3a76f --- /dev/null +++ b/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Boolean.swift @@ -0,0 +1,16 @@ +// +// Boolean.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** True or False indicator */ +public enum Boolean: Bool, Codable { + case _true = "true" + case _false = "false" + +} diff --git a/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Ints.swift b/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Ints.swift new file mode 100644 index 00000000000..18d8fd47188 --- /dev/null +++ b/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Ints.swift @@ -0,0 +1,21 @@ +// +// Ints.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** True or False indicator */ +public enum Ints: Int, Codable { + case _0 = "0" + case _1 = "1" + case _2 = "2" + case _3 = "3" + case _4 = "4" + case _5 = "5" + case _6 = "6" + +} diff --git a/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Numbers.swift b/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Numbers.swift new file mode 100644 index 00000000000..cab1986c14c --- /dev/null +++ b/samples/client/petstore/swift5/promisekit/PetstoreClient/Classes/Swaggers/Models/Numbers.swift @@ -0,0 +1,18 @@ +// +// Numbers.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** some number */ +public enum Numbers: Double, Codable { + case _7 = "7" + case _8 = "8" + case _9 = "9" + case _10 = "10" + +} diff --git a/samples/client/petstore/swift5/rxswift/.swagger-codegen/VERSION b/samples/client/petstore/swift5/rxswift/.swagger-codegen/VERSION index a4533be7fa8..8c7754221a4 100644 --- a/samples/client/petstore/swift5/rxswift/.swagger-codegen/VERSION +++ b/samples/client/petstore/swift5/rxswift/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.11-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Boolean.swift b/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Boolean.swift new file mode 100644 index 00000000000..3533aa3a76f --- /dev/null +++ b/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Boolean.swift @@ -0,0 +1,16 @@ +// +// Boolean.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** True or False indicator */ +public enum Boolean: Bool, Codable { + case _true = "true" + case _false = "false" + +} diff --git a/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Ints.swift b/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Ints.swift new file mode 100644 index 00000000000..18d8fd47188 --- /dev/null +++ b/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Ints.swift @@ -0,0 +1,21 @@ +// +// Ints.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** True or False indicator */ +public enum Ints: Int, Codable { + case _0 = "0" + case _1 = "1" + case _2 = "2" + case _3 = "3" + case _4 = "4" + case _5 = "5" + case _6 = "6" + +} diff --git a/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Numbers.swift b/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Numbers.swift new file mode 100644 index 00000000000..cab1986c14c --- /dev/null +++ b/samples/client/petstore/swift5/rxswift/PetstoreClient/Classes/Swaggers/Models/Numbers.swift @@ -0,0 +1,18 @@ +// +// Numbers.swift +// +// Generated by swagger-codegen +// https://github.com/swagger-api/swagger-codegen +// + +import Foundation + + +/** some number */ +public enum Numbers: Double, Codable { + case _7 = "7" + case _8 = "8" + case _9 = "9" + case _10 = "10" + +} diff --git a/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts index 78080a33ea2..2395c5ef295 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/pet.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat @Injectable() export class PetService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -427,7 +427,7 @@ export class PetService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts index fa78d49386a..bc984c328e9 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/store.service.ts @@ -29,7 +29,7 @@ import { Configuration } from '../configurat @Injectable() export class StoreService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -172,7 +172,7 @@ export class StoreService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts index 2d4286f42f1..1876fa53693 100644 --- a/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/default/api/user.service.ts @@ -29,7 +29,7 @@ import { Configuration } from '../configurat @Injectable() export class UserService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts index 78080a33ea2..2395c5ef295 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/pet.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat @Injectable() export class PetService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -427,7 +427,7 @@ export class PetService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts index fa78d49386a..bc984c328e9 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/store.service.ts @@ -29,7 +29,7 @@ import { Configuration } from '../configurat @Injectable() export class StoreService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -172,7 +172,7 @@ export class StoreService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts index 2d4286f42f1..1876fa53693 100644 --- a/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/npm/api/user.service.ts @@ -29,7 +29,7 @@ import { Configuration } from '../configurat @Injectable() export class UserService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts index f3caaf58a5b..f9b6b71dcf1 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/pet.service.ts @@ -31,7 +31,7 @@ import { PetServiceInterface } from './pet.serviceInt @Injectable() export class PetService implements PetServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -428,7 +428,7 @@ export class PetService implements PetServiceInterface { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts index 9c34dc32632..59ea389c4d6 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/store.service.ts @@ -30,7 +30,7 @@ import { StoreServiceInterface } from './store.servic @Injectable() export class StoreService implements StoreServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -173,7 +173,7 @@ export class StoreService implements StoreServiceInterface { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts index b093e70e7e2..f2084151a75 100644 --- a/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v2/with-interfaces/api/user.service.ts @@ -30,7 +30,7 @@ import { UserServiceInterface } from './user.serviceI @Injectable() export class UserService implements UserServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts index b3b51af413d..f8abda9e40c 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/pet.service.ts @@ -28,7 +28,7 @@ import { Configuration } from '../configurat @Injectable() export class PetService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -300,7 +300,7 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } @@ -432,7 +432,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -505,7 +505,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts index 22f13b6f1bb..a5d5b7fb633 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/store.service.ts @@ -27,7 +27,7 @@ import { Configuration } from '../configurat @Injectable() export class StoreService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -112,7 +112,7 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts index e1323ce454b..e955d6fbb70 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/npm/api/user.service.ts @@ -27,7 +27,7 @@ import { Configuration } from '../configurat @Injectable() export class UserService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v4.3/npm/package-lock.json b/samples/client/petstore/typescript-angular-v4.3/npm/package-lock.json index 684599f28d7..12b074e3e02 100644 --- a/samples/client/petstore/typescript-angular-v4.3/npm/package-lock.json +++ b/samples/client/petstore/typescript-angular-v4.3/npm/package-lock.json @@ -82,9 +82,9 @@ "dev": true }, "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true }, "ajv": { @@ -92,6 +92,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, + "optional": true, "requires": { "co": "^4.6.0", "json-stable-stringify": "^1.0.1" @@ -150,9 +151,9 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", - "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "requires": { "delegates": "^1.0.0", @@ -186,30 +187,12 @@ "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", "dev": true }, - "array-filter": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", - "dev": true - }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, - "array-map": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", - "dev": true - }, - "array-reduce": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", - "dev": true - }, "array-uniq": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", @@ -236,16 +219,20 @@ "optional": true }, "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "dev": true + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } }, "assert-plus": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true + "dev": true, + "optional": true }, "assign-symbols": { "version": "1.0.0", @@ -260,18 +247,18 @@ "dev": true }, "async": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", - "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.3.tgz", + "integrity": "sha512-zflvls11DCy+dQWzTW2dzuilv8Z5X/pjfmZOWba6TNIVDm+2UDaJmXSOXlasHKfNBs8oo3M0aT50fDEWfKZjXg==", "dev": true, "requires": { - "lodash": "^4.14.0" + "lodash": "^4.17.14" } }, "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, "async-foreach": { @@ -287,9 +274,9 @@ "dev": true }, "atob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, "autoprefixer": { @@ -310,12 +297,13 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true + "dev": true, + "optional": true }, "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "dev": true }, "babel-runtime": { @@ -394,19 +382,18 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, - "optional": true, "requires": { "tweetnacl": "^0.14.3" } @@ -418,11 +405,21 @@ "dev": true }, "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -437,6 +434,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, + "optional": true, "requires": { "hoek": "2.x.x" } @@ -479,9 +477,9 @@ "dev": true }, "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz", + "integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==", "dev": true }, "cache-base": { @@ -526,9 +524,9 @@ } }, "caniuse-lite": { - "version": "1.0.30000836", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000836.tgz", - "integrity": "sha512-DlVR8sVTKDgd7t95U0shX3g7MeJ/DOjKOhUcaiXqnVmnO5sG4Tn2rLVOkVfPUJgnQNxnGe8/4GK0dGSI+AagQw==", + "version": "1.0.30001125", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001125.tgz", + "integrity": "sha512-9f+r7BW8Qli917mU3j0fUaTweT3f3vnX/Lcs+1C73V+RADmFme+Ih0Br8vONQi3X0lseOe6ZHfsZLCA8MSjxUA==", "dev": true }, "caseless": { @@ -538,9 +536,9 @@ "dev": true }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -595,14 +593,48 @@ } }, "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "clone": { @@ -621,7 +653,8 @@ "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true + "dev": true, + "optional": true }, "code-point-at": { "version": "1.1.0", @@ -640,12 +673,12 @@ } }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { - "color-name": "^1.1.1" + "color-name": "1.1.3" } }, "color-name": { @@ -661,24 +694,24 @@ "dev": true }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -694,10 +727,21 @@ "dev": true }, "convert-source-map": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", - "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=", - "dev": true + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } + } }, "copy-descriptor": { "version": "0.1.1", @@ -706,9 +750,9 @@ "dev": true }, "core-js": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz", - "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", "dev": true }, "core-util-is": { @@ -751,15 +795,39 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "dev": true, + "optional": true, "requires": { "boom": "2.x.x" } }, + "css": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", + "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "source-map": "^0.6.1", + "source-map-resolve": "^0.5.2", + "urix": "^0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "css-parse": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-1.7.0.tgz", - "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-2.0.0.tgz", + "integrity": "sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q=", + "dev": true, + "requires": { + "css": "^2.0.0" + } }, "currently-unhandled": { "version": "0.4.1", @@ -860,9 +928,9 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } @@ -886,9 +954,9 @@ "dev": true }, "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", "dev": true }, "duplexer2": { @@ -927,9 +995,9 @@ } }, "duplexify": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", - "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", "dev": true, "requires": { "end-of-stream": "^1.0.0", @@ -939,25 +1007,31 @@ } }, "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, - "optional": true, "requires": { - "jsbn": "~0.1.0" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "electron-to-chromium": { - "version": "1.3.45", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.45.tgz", - "integrity": "sha1-RYrBscXHYM6IEaFtK/vZfsMLr7g=", + "version": "1.3.564", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.564.tgz", + "integrity": "sha512-fNaYN3EtKQWLQsrKXui8mzcryJXuA0LbCLoizeX6oayG2emBaS5MauKjCPAvc29NEY4FpLHIUWiP+Y0Bfrs5dg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "end-of-stream": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", "dev": true, "requires": { "once": "^1.4.0" @@ -974,9 +1048,9 @@ } }, "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -1035,9 +1109,9 @@ } }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, "extend-shallow": { @@ -1077,16 +1151,36 @@ "dev": true }, "fancy-log": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.2.tgz", - "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/fancy-log/-/fancy-log-1.3.3.tgz", + "integrity": "sha512-k9oEhlyc0FrVh25qYuSELjr8oxsCoc4/LEZfg2iJJrfEk/tZL9bCoJE47gqAvI2m/AUjluCS4+3I0eTx8n3AEw==", "dev": true, "requires": { "ansi-gray": "^0.1.1", "color-support": "^1.1.3", + "parse-node-version": "^1.0.0", "time-stamp": "^1.0.0" } }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -1154,6 +1248,7 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "dev": true, + "optional": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.5", @@ -1187,633 +1282,100 @@ "dev": true }, "fsevents": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.3.tgz", - "integrity": "sha512-X+57O5YkDTiEQGiw8i7wYc2nQgweIekqkepI8Q3y4wVlurgBt2SuwxTeYUYMZIGpLZH3r/TsMjczCMXE5ZOt7Q==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.9.0" + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" }, "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { + } + } + }, + "gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "requires": { + "globule": "^1.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" + }, + "dependencies": { + "assert-plus": { "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.9.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "~0.4.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - }, - "dependencies": { - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - } - } - }, - "gaze": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz", - "integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=", - "dev": true, - "requires": { - "globule": "^1.0.0" - } - }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "^1.0.0" - } - }, - "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1943,29 +1505,29 @@ } }, "globule": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", - "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", + "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", "dev": true, "requires": { "glob": "~7.1.1", - "lodash": "~4.17.4", + "lodash": "~4.17.10", "minimatch": "~3.0.2" } }, "glogg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.1.tgz", - "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/glogg/-/glogg-1.0.2.tgz", + "integrity": "sha512-5mwUoSuBk44Y4EshyiqcH95ZntbDdTQqA3QYSrxmzj28Ai0vXBGMH1ApSANH14j2sIRtqCEyg6PfsuP7ElOEDA==", "dev": true, "requires": { "sparkles": "^1.0.0" } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "gulp-inline-ng2-template": { @@ -2083,13 +1645,15 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", - "dev": true + "dev": true, + "optional": true }, "har-validator": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", "dev": true, + "optional": true, "requires": { "ajv": "^4.9.1", "har-schema": "^1.0.5" @@ -2190,6 +1754,7 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "dev": true, + "optional": true, "requires": { "boom": "2.x.x", "cryptiles": "2.x.x", @@ -2201,21 +1766,22 @@ "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true + "dev": true, + "optional": true }, "homedir-polyfill": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.1.tgz", - "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/homedir-polyfill/-/homedir-polyfill-1.0.3.tgz", + "integrity": "sha512-eSmmWE5bZTK2Nou4g0AI3zZ9rswp7GRKoKXS1BLUkvPviOqs4YTN1djQIqrXy9k5gEtdLPy86JjRwsNM9tnDcA==", "dev": true, "requires": { "parse-passwd": "^1.0.0" } }, "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "http-signature": { @@ -2223,6 +1789,7 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "dev": true, + "optional": true, "requires": { "assert-plus": "^0.2.0", "jsprim": "^1.2.2", @@ -2237,9 +1804,9 @@ "optional": true }, "in-publish": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", - "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", + "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", "dev": true }, "indent-string": { @@ -2262,15 +1829,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "is-accessor-descriptor": { @@ -2303,15 +1864,6 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-data-descriptor": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", @@ -2368,13 +1920,10 @@ "dev": true }, "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", @@ -2400,25 +1949,6 @@ "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", "dev": true }, - "is-my-ip-valid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", - "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", - "dev": true - }, - "is-my-json-valid": { - "version": "2.17.2", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", - "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", - "dev": true, - "requires": { - "generate-function": "^2.0.0", - "generate-object-property": "^1.1.0", - "is-my-ip-valid": "^1.0.0", - "jsonpointer": "^4.0.0", - "xtend": "^4.0.0" - } - }, "is-number": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-2.1.0.tgz", @@ -2428,23 +1958,6 @@ "kind-of": "^3.0.2" } }, - "is-odd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, "is-plain-object": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", @@ -2474,12 +1987,6 @@ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true - }, "is-stream": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", @@ -2538,17 +2045,16 @@ "dev": true }, "js-base64": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", - "integrity": "sha512-H7ErYLM34CvDMto3GbD6xD0JLUGYXR3QTcH6B/tr4Hi/QpSThnCsIp+Sy5FRTw3B0d6py4HcNkW7nO/wdtGWEw==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", "dev": true }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "dev": true }, "json-schema": { "version": "0.2.3", @@ -2556,15 +2062,28 @@ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", "dev": true }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, + "optional": true, "requires": { "jsonify": "~0.0.0" } }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, "json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", @@ -2584,13 +2103,8 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true + "dev": true, + "optional": true }, "jsprim": { "version": "1.4.1", @@ -2630,15 +2144,6 @@ "readable-stream": "^2.0.5" } }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, "less": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/less/-/less-2.7.3.tgz", @@ -2668,10 +2173,28 @@ "strip-bom": "^2.0.0" } }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + }, + "dependencies": { + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + } + } + }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash._basecopy": { @@ -2728,18 +2251,6 @@ "integrity": "sha1-+6HEUkwZ7ppfgTa0YJ8BfPTe1pI=", "dev": true }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, "lodash.escape": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/lodash.escape/-/lodash.escape-3.2.0.tgz", @@ -2778,12 +2289,6 @@ "lodash.isarray": "^3.0.0" } }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", - "dev": true - }, "lodash.restparam": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/lodash.restparam/-/lodash.restparam-3.6.1.tgz", @@ -2828,9 +2333,9 @@ } }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -2847,9 +2352,9 @@ } }, "make-error": { - "version": "1.3.4", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.4.tgz", - "integrity": "sha512-0Dab5btKVPhibSalc9QGXb559ED7G7iLjFXBaj9Wq8O3vorueR5K5jaE3hkG6ZQINyhA/JgG6Qk4qdFQjsYV6g==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "map-cache": { @@ -2874,9 +2379,9 @@ } }, "math-random": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.1.tgz", - "integrity": "sha1-izqsWIuKZuSXXjzepn97sylgH6w=", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", "dev": true }, "meow": { @@ -2943,18 +2448,18 @@ "optional": true }, "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "~1.33.0" + "mime-db": "1.44.0" } }, "minimatch": { @@ -2967,15 +2472,15 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -2994,20 +2499,12 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "minimist": "^1.2.5" } }, "ms": { @@ -3026,15 +2523,15 @@ } }, "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "dev": true }, "nanomatch": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -3042,7 +2539,6 @@ "define-property": "^2.0.2", "extend-shallow": "^3.0.2", "fragment-cache": "^0.2.1", - "is-odd": "^2.0.0", "is-windows": "^1.0.2", "kind-of": "^6.0.2", "object.pick": "^1.3.0", @@ -3064,9 +2560,9 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } @@ -3103,38 +2599,161 @@ } }, "node-gyp": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.2.tgz", - "integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", "dev": true, "requires": { "fstream": "^1.0.0", "glob": "^7.0.3", "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", "mkdirp": "^0.5.0", "nopt": "2 || 3", "npmlog": "0 || 1 || 2 || 3 || 4", "osenv": "0", - "request": "2", + "request": "^2.87.0", "rimraf": "2", "semver": "~5.3.0", "tar": "^2.0.0", "which": "1" }, "dependencies": { + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, "semver": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", "dev": true + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } } } }, "node-sass": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.9.0.tgz", - "integrity": "sha512-QFHfrZl6lqRU3csypwviz2XLgGNOoWQbo2GOvtsfQqOfL4cy1BtWnhx/XUeAO9LT3ahBzSRXcEO6DdvAH9DzSg==", + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", + "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -3144,30 +2763,46 @@ "get-stdin": "^4.0.1", "glob": "^7.0.3", "in-publish": "^2.0.0", - "lodash.assign": "^4.2.0", - "lodash.clonedeep": "^4.3.2", - "lodash.mergewith": "^4.6.0", + "lodash": "^4.17.15", "meow": "^3.7.0", "mkdirp": "^0.5.1", - "nan": "^2.10.0", - "node-gyp": "^3.3.1", + "nan": "^2.13.2", + "node-gyp": "^3.8.0", "npmlog": "^4.0.0", - "request": "~2.79.0", - "sass-graph": "^2.2.4", + "request": "^2.88.0", + "sass-graph": "2.2.5", "stdout-stream": "^1.4.0", "true-case-path": "^1.0.2" }, "dependencies": { + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", "dev": true }, "chalk": { @@ -3183,50 +2818,94 @@ "supports-color": "^2.0.0" } }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "chalk": "^1.1.1", - "commander": "^2.9.0", - "is-my-json-valid": "^2.12.4", - "pinkie-promise": "^2.0.0" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "qs": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, "request": { - "version": "2.79.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "requires": { - "aws-sign2": "~0.6.0", - "aws4": "^1.2.1", - "caseless": "~0.11.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.0", + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.1.1", - "har-validator": "~2.0.6", - "hawk": "~3.1.3", - "http-signature": "~1.1.0", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.7", - "oauth-sign": "~0.8.1", - "qs": "~6.3.0", - "stringstream": "~0.0.4", - "tough-cookie": "~2.3.0", - "tunnel-agent": "~0.4.1", - "uuid": "^3.0.0" + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" } }, "supports-color": { @@ -3235,11 +2914,15 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } } } }, @@ -3253,13 +2936,13 @@ } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" } @@ -3307,7 +2990,8 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "3.0.0", @@ -3406,15 +3090,6 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -3431,6 +3106,30 @@ "os-tmpdir": "^1.0.0" } }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, "parse-glob": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/parse-glob/-/parse-glob-3.0.4.tgz", @@ -3452,6 +3151,12 @@ "error-ex": "^1.2.0" } }, + "parse-node-version": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-node-version/-/parse-node-version-1.0.1.tgz", + "integrity": "sha512-3YHlOa/JgH6Mnpr05jP9eDG254US9ek25LyIxZlDItp2iJtwyaXQb57lBYLdT3MowkUFYEV2XXNAYIPlESvJlA==", + "dev": true + }, "parse-passwd": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parse-passwd/-/parse-passwd-1.0.0.tgz", @@ -3486,9 +3191,9 @@ "dev": true }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-type": { @@ -3506,7 +3211,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", - "dev": true + "dev": true, + "optional": true }, "pify": { "version": "2.3.0", @@ -3536,9 +3242,9 @@ "dev": true }, "postcss": { - "version": "6.0.22", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", - "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { "chalk": "^2.4.1", @@ -3555,9 +3261,9 @@ } }, "postcss-value-parser": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", - "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", "dev": true }, "preserve": { @@ -3573,9 +3279,9 @@ "dev": true }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "promise": { @@ -3601,302 +3307,110 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true + "dev": true, + "optional": true }, "qs": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", - "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", - "dev": true - }, - "randomatic": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.0.0.tgz", - "integrity": "sha512-VdxFOIEY3mNO5PtSRkkle/hPJDHvQhK21oa73K4yAc9qmp6N429gAyF1gZMOTMeS0/AYzaV/2Trcef+NaIonSA==", - "dev": true, - "requires": { - "is-number": "^4.0.0", - "kind-of": "^6.0.0", - "math-random": "^1.0.1" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } - }, - "read-file": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/read-file/-/read-file-0.2.0.tgz", - "integrity": "sha1-cMa6+IQux9FUD5gf0Oau1Mgb1UU=", - "dev": true - }, - "read-pkg": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", - "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", - "dev": true, - "requires": { - "load-json-file": "^1.0.0", - "normalize-package-data": "^2.3.2", - "path-type": "^1.0.0" - } - }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", - "dev": true, - "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" - } - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" - } - }, - "recast": { - "version": "0.11.23", - "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", - "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", - "dev": true, - "requires": { - "ast-types": "0.9.6", - "esprima": "~3.1.0", - "private": "~0.1.5", - "source-map": "~0.5.0" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "reflect-metadata": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.12.tgz", - "integrity": "sha512-n+IyV+nGz3+0q3/Yf1ra12KpCyi001bi4XFxSjbiWWjfqb52iTTtpGXmCCAOWWIAn9KEuFZKGqBERHmrtScZ3A==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "replace-ext": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", - "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", - "dev": true - }, - "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", - "dev": true, - "requires": { - "aws-sign2": "~0.6.0", - "aws4": "^1.2.1", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.0", - "forever-agent": "~0.6.1", - "form-data": "~2.1.1", - "har-validator": "~4.2.1", - "hawk": "~3.1.3", - "http-signature": "~1.1.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.7", - "oauth-sign": "~0.8.1", - "performance-now": "^0.2.0", - "qs": "~6.4.0", - "safe-buffer": "^5.0.1", - "stringstream": "~0.0.4", - "tough-cookie": "~2.3.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true + "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", + "dev": true, + "optional": true }, - "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "randomatic": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", "dev": true, "requires": { - "path-parse": "^1.0.5" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + } } }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "read-file": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/read-file/-/read-file-0.2.0.tgz", + "integrity": "sha1-cMa6+IQux9FUD5gf0Oau1Mgb1UU=", "dev": true }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "read-pkg": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-1.1.0.tgz", + "integrity": "sha1-9f+qXs0pyzHAR0vKfXVra7KePyg=", "dev": true, "requires": { - "glob": "^7.0.5" + "load-json-file": "^1.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^1.0.0" } }, - "rollup": { - "version": "0.51.8", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.51.8.tgz", - "integrity": "sha512-e7FwWxqb4vhdonmwRH06nqC9wR6h1kZojK2D+lN1xjiB8FDtAKgy7o+r8fCXVzQZ1ZCdcVlls3mTq5g6u38Jew==", - "dev": true - }, - "rollup-plugin-commonjs": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.1.tgz", - "integrity": "sha512-mg+WuD+jlwoo8bJtW3Mvx7Tz6TsIdMsdhuvCnDMoyjh0oxsVgsjB/N0X984RJCWwc5IIiqNVJhXeeITcc73++A==", + "read-pkg-up": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", + "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", "dev": true, "requires": { - "acorn": "^5.2.1", - "estree-walker": "^0.5.0", - "magic-string": "^0.22.4", - "resolve": "^1.4.0", - "rollup-pluginutils": "^2.0.1" + "find-up": "^1.0.0", + "read-pkg": "^1.0.0" } }, - "rollup-plugin-node-resolve": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz", - "integrity": "sha512-9zHGr3oUJq6G+X0oRMYlzid9fXicBdiydhwGChdyeNRGPcN/majtegApRKHLR5drboUvEWU+QeUmGTyEZQs3WA==", + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { - "builtin-modules": "^2.0.0", - "is-module": "^1.0.0", - "resolve": "^1.1.6" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" }, "dependencies": { - "builtin-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz", - "integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==", + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true } } }, - "rollup-pluginutils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.1.0.tgz", - "integrity": "sha512-UyIb55bvJBop3HmpULDYG8eNoWvZ4Du+kqy3KG32JcEazHuJ3uXzrzksc3/snBzxXWjyYjLgHC4OgORMCQQpAw==", + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "estree-walker": "^0.5.2", + "graceful-fs": "^4.1.11", "micromatch": "^3.1.10", - "tosource": "^1.0.0" + "readable-stream": "^2.0.2" }, "dependencies": { "arr-diff": { @@ -4147,47 +3661,253 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } + } + }, + "recast": { + "version": "0.11.23", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.11.23.tgz", + "integrity": "sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM=", + "dev": true, + "requires": { + "ast-types": "0.9.6", + "esprima": "~3.1.0", + "private": "~0.1.5", + "source-map": "~0.5.0" + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "replace-ext": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/replace-ext/-/replace-ext-0.0.1.tgz", + "integrity": "sha1-KbvZIHinOfC8zitO5B6DeVNSKSQ=", + "dev": true + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "0.51.8", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.51.8.tgz", + "integrity": "sha512-e7FwWxqb4vhdonmwRH06nqC9wR6h1kZojK2D+lN1xjiB8FDtAKgy7o+r8fCXVzQZ1ZCdcVlls3mTq5g6u38Jew==", + "dev": true + }, + "rollup-plugin-commonjs": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.4.1.tgz", + "integrity": "sha512-mg+WuD+jlwoo8bJtW3Mvx7Tz6TsIdMsdhuvCnDMoyjh0oxsVgsjB/N0X984RJCWwc5IIiqNVJhXeeITcc73++A==", + "dev": true, + "requires": { + "acorn": "^5.2.1", + "estree-walker": "^0.5.0", + "magic-string": "^0.22.4", + "resolve": "^1.4.0", + "rollup-pluginutils": "^2.0.1" + } + }, + "rollup-plugin-node-resolve": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.4.0.tgz", + "integrity": "sha512-PJcd85dxfSBWih84ozRtBkB731OjXk0KnzN0oGp7WOWcarAFkVa71cV5hTJg2qpVsV2U8EUwrzHP3tvy9vS3qg==", + "dev": true, + "requires": { + "builtin-modules": "^2.0.0", + "is-module": "^1.0.0", + "resolve": "^1.1.6" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" + }, + "dependencies": { + "estree-walker": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "dev": true, - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } } } }, "rxjs": { - "version": "5.5.10", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.10.tgz", - "integrity": "sha512-SRjimIDUHJkon+2hFo7xnvNC4ZEHGzCRwh9P7nzX3zPkCGFEg/tuElrNR7L/rZMagnK2JeH2jQwPRpmyXyLB6A==", + "version": "5.5.12", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", + "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", "dev": true, "requires": { "symbol-observable": "1.0.1" } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, "safe-regex": { @@ -4199,6 +3919,12 @@ "ret": "~0.1.10" } }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "sander": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/sander/-/sander-0.5.1.tgz", @@ -4212,21 +3938,21 @@ } }, "sass-graph": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", - "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz", + "integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", "dev": true, "requires": { "glob": "^7.0.0", "lodash": "^4.0.0", "scss-tokenizer": "^0.2.3", - "yargs": "^7.0.0" + "yargs": "^13.3.2" } }, "sax": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/sax/-/sax-0.5.8.tgz", - "integrity": "sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE=", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, "scss-tokenizer": { @@ -4251,9 +3977,9 @@ } }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "set-blocking": { @@ -4262,16 +3988,10 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -4292,21 +4012,15 @@ } }, "shell-quote": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", - "dev": true, - "requires": { - "array-filter": "~0.0.0", - "array-map": "~0.0.0", - "array-reduce": "~0.0.0", - "jsonify": "~0.0.0" - } + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", + "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", + "dev": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "snapdragon": { @@ -4401,9 +4115,9 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } @@ -4422,6 +4136,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "dev": true, + "optional": true, "requires": { "hoek": "2.x.x" } @@ -4445,12 +4160,12 @@ "dev": true }, "source-map-resolve": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "dev": true, "requires": { - "atob": "^2.0.0", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -4473,21 +4188,21 @@ "dev": true }, "sourcemap-codec": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz", - "integrity": "sha512-hX1eNBNuilj8yfFnECh0DzLgwKpBLMIvmhgEhixXNui8lMLBInTI8Kyxt++RwJnMNu7cAUo635L2+N1TxMJCzA==", + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, "sparkles": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.0.tgz", - "integrity": "sha1-Gsu/tZJDbRC76PeFt8xvgoFQEsM=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/sparkles/-/sparkles-1.0.1.tgz", + "integrity": "sha512-dSO0DDYUahUt/0/pD/Is3VIm5TGJjludZ0HVymmhYF6eNA53PVLhnUk0znSYbH8IYBuJdCE+1luR22jNLMaQdw==", "dev": true }, "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -4495,15 +4210,15 @@ } }, "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -4511,9 +4226,9 @@ } }, "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "split-string": { @@ -4526,9 +4241,9 @@ } }, "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -4538,6 +4253,7 @@ "ecc-jsbn": "~0.1.1", "getpass": "^0.1.1", "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, "dependencies": { @@ -4571,18 +4287,18 @@ } }, "stdout-stream": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz", - "integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", + "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", "dev": true, "requires": { "readable-stream": "^2.0.1" } }, "stream-shift": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", - "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.1.tgz", + "integrity": "sha512-AiisoFqQ0vbGcZgQPY1cdP2I76glaVA/RauYR4G4thNFgkTqr90yXTo4LYX60Jl+sIlPNHHdGSwo01AvbKUSVQ==", "dev": true }, "string-width": { @@ -4603,13 +4319,22 @@ "dev": true, "requires": { "safe-buffer": "~5.1.0" + }, + "dependencies": { + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + } } }, "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", - "dev": true + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", + "dev": true, + "optional": true }, "strip-ansi": { "version": "3.0.1", @@ -4655,41 +4380,47 @@ "dev": true }, "stylus": { - "version": "0.54.5", - "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.5.tgz", - "integrity": "sha1-QrlWCTHKcJDOhRWnmLqeaqPW3Hk=", - "dev": true, - "requires": { - "css-parse": "1.7.x", - "debug": "*", - "glob": "7.0.x", - "mkdirp": "0.5.x", - "sax": "0.5.x", - "source-map": "0.1.x" + "version": "0.54.8", + "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.8.tgz", + "integrity": "sha512-vr54Or4BZ7pJafo2mpf0ZcwA74rpuYCZbxrHBsH8kbcXOwSfvBFwsRfpGO5OD5fhG5HDCFW737PKaawI7OqEAg==", + "dev": true, + "requires": { + "css-parse": "~2.0.0", + "debug": "~3.1.0", + "glob": "^7.1.6", + "mkdirp": "~1.0.4", + "safer-buffer": "^2.1.2", + "sax": "~1.2.4", + "semver": "^6.3.0", + "source-map": "^0.7.3" }, "dependencies": { - "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "ms": "2.0.0" } }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, "source-map": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true } } }, @@ -4703,9 +4434,9 @@ } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -4718,13 +4449,13 @@ "dev": true }, "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", "dev": true, "requires": { "block-stream": "*", - "fstream": "^1.0.2", + "fstream": "^1.0.12", "inherits": "2" } }, @@ -4735,12 +4466,12 @@ "dev": true }, "through2": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", - "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { - "readable-stream": "^2.1.5", + "readable-stream": "~2.3.6", "xtend": "~4.0.1" } }, @@ -4822,17 +4553,12 @@ } } }, - "tosource": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tosource/-/tosource-1.0.0.tgz", - "integrity": "sha1-QtiN0RZhi88A1hBt1URvNCeQL/E=", - "dev": true - }, "tough-cookie": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, + "optional": true, "requires": { "punycode": "^1.4.1" } @@ -4844,27 +4570,12 @@ "dev": true }, "true-case-path": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.2.tgz", - "integrity": "sha1-fskRMJJHZsf1c74wIMNPj9/QDWI=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", + "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", "dev": true, "requires": { - "glob": "^6.0.4" - }, - "dependencies": { - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } + "glob": "^7.1.2" } }, "ts-node": { @@ -4916,9 +4627,9 @@ } }, "tslib": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", - "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, "tunnel-agent": { @@ -4934,8 +4645,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "dev": true }, "typescript": { "version": "2.7.2", @@ -4944,72 +4654,49 @@ "dev": true }, "uglify-js": { - "version": "3.3.24", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.24.tgz", - "integrity": "sha512-hS7+TDiqIqvWScCcKRybCQzmMnEzJ4ryl9ErRmW4GFyG48p0/dKZiy/5mVLbsFzU8CCnCgQdxMiJzZythvLzCg==", - "dev": true, - "requires": { - "commander": "~2.15.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", + "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==", + "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" + "set-value": "^2.0.1" + } + }, + "unique-stream": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.3.1.tgz", + "integrity": "sha512-2nY4TnBE70yoxHkDli7DMazpWiP7xMdCYqU2nBRO0UB+ZpEkGsSija7MvmvnZFUeC+mrgiUfcHSr3LmRFIg4+A==", + "dev": true, + "requires": { + "json-stable-stringify-without-jsonify": "^1.0.1", + "through2-filter": "^3.0.0" }, "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "through2-filter": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/through2-filter/-/through2-filter-3.0.0.tgz", + "integrity": "sha512-jaRjI2WxN3W1V8/FMZ9HKIBXixtiqs3SQSX4/YGIiP3gL6djW48VoZq9tDqeCWs3MT8YY5wb/zli8VW8snY1CA==", "dev": true, "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" + "through2": "~2.0.0", + "xtend": "~4.0.0" } } } }, - "unique-stream": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/unique-stream/-/unique-stream-2.2.1.tgz", - "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", - "dev": true, - "requires": { - "json-stable-stringify": "^1.0.0", - "through2-filter": "^2.0.0" - } - }, "universalify": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", - "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, "unset-value": { @@ -5058,29 +4745,35 @@ } } }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", - "dev": true - }, - "use": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "dev": true, "requires": { - "kind-of": "^6.0.2" + "punycode": "^2.1.0" }, "dependencies": { - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true } } }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -5088,15 +4781,15 @@ "dev": true }, "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "v8flags": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.0.2.tgz", - "integrity": "sha512-6sgSKoFw1UpUPd3cFdF7QGnrH6tDeBgW1F3v9gy8gLY0mlbiBXq8soy8aQpY6xeeCjH5K+JvC62Acp7gtl7wWA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/v8flags/-/v8flags-3.2.0.tgz", + "integrity": "sha512-mH8etigqMfiGWdeXpaaqGfs6BndypxusHHcv2qSHyZkGEznCd/qAXCWWRzeowtL54147cktFOC4P5y+kl8d8Jg==", "dev": true, "requires": { "homedir-polyfill": "^1.0.1" @@ -5109,9 +4802,9 @@ "dev": true }, "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -5199,37 +4892,72 @@ "dev": true }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" } }, "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wide-align": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "requires": { - "string-width": "^1.0.2" + "string-width": "^1.0.2 || 2" } }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "wrappy": { @@ -5239,15 +4967,15 @@ "dev": true }, "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yallist": { @@ -5257,47 +4985,80 @@ "dev": true }, "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" }, "dependencies": { - "camelcase": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "find-up": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } } } }, "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { - "camelcase": "^3.0.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "dependencies": { "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true } } diff --git a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/pet.service.ts index a922b13249f..669f4120c21 100644 --- a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/pet.service.ts @@ -29,7 +29,7 @@ import { PetServiceInterface } from './pet.serviceInt @Injectable() export class PetService implements PetServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -301,7 +301,7 @@ export class PetService implements PetServiceInterface { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } @@ -433,7 +433,7 @@ export class PetService implements PetServiceInterface { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -506,7 +506,7 @@ export class PetService implements PetServiceInterface { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/store.service.ts index 271fabb7ba8..a73f0a1beb6 100644 --- a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/store.service.ts @@ -28,7 +28,7 @@ import { StoreServiceInterface } from './store.servic @Injectable() export class StoreService implements StoreServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -113,7 +113,7 @@ export class StoreService implements StoreServiceInterface { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/user.service.ts index 491402e119a..068a351a34d 100644 --- a/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4.3/with-interfaces/api/user.service.ts @@ -28,7 +28,7 @@ import { UserServiceInterface } from './user.serviceI @Injectable() export class UserService implements UserServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v4/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts index 78080a33ea2..2395c5ef295 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/pet.service.ts @@ -30,7 +30,7 @@ import { Configuration } from '../configurat @Injectable() export class PetService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -427,7 +427,7 @@ export class PetService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts index fa78d49386a..bc984c328e9 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/store.service.ts @@ -29,7 +29,7 @@ import { Configuration } from '../configurat @Injectable() export class StoreService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); @@ -172,7 +172,7 @@ export class StoreService { let headers = new Headers(this.defaultHeaders.toJSON()); // https://github.com/angular/angular/issues/6845 // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts index 2d4286f42f1..1876fa53693 100644 --- a/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v4/npm/api/user.service.ts @@ -29,7 +29,7 @@ import { Configuration } from '../configurat @Injectable() export class UserService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new Headers(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION index 017674fb59d..5329065c433 100644 --- a/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v5/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.12-SNAPSHOT diff --git a/samples/client/petstore/typescript-angular-v5/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v5/npm/api/pet.service.ts index 18563adb1b3..a06894415ce 100644 --- a/samples/client/petstore/typescript-angular-v5/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v5/npm/api/pet.service.ts @@ -68,6 +68,7 @@ export class PetService { public addPet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable>; public addPet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable>; public addPet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } @@ -125,10 +126,12 @@ export class PetService { public deletePet(petId: number, apiKey?: string, observe?: 'response', reportProgress?: boolean): Observable>; public deletePet(petId: number, apiKey?: string, observe?: 'events', reportProgress?: boolean): Observable>; public deletePet(petId: number, apiKey?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } + let headers = this.defaultHeaders; if (apiKey !== undefined && apiKey !== null) { headers = headers.set('api_key', String(apiKey)); @@ -177,6 +180,7 @@ export class PetService { public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'response', reportProgress?: boolean): Observable>>; public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe?: 'events', reportProgress?: boolean): Observable>>; public findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (status === null || status === undefined) { throw new Error('Required parameter status was null or undefined when calling findPetsByStatus.'); } @@ -232,6 +236,7 @@ export class PetService { public findPetsByTags(tags: Array, observe?: 'response', reportProgress?: boolean): Observable>>; public findPetsByTags(tags: Array, observe?: 'events', reportProgress?: boolean): Observable>>; public findPetsByTags(tags: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (tags === null || tags === undefined) { throw new Error('Required parameter tags was null or undefined when calling findPetsByTags.'); } @@ -287,6 +292,7 @@ export class PetService { public getPetById(petId: number, observe?: 'response', reportProgress?: boolean): Observable>; public getPetById(petId: number, observe?: 'events', reportProgress?: boolean): Observable>; public getPetById(petId: number, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } @@ -294,7 +300,7 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } @@ -333,6 +339,7 @@ export class PetService { public updatePet(body: Pet, observe?: 'response', reportProgress?: boolean): Observable>; public updatePet(body: Pet, observe?: 'events', reportProgress?: boolean): Observable>; public updatePet(body: Pet, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } @@ -391,10 +398,13 @@ export class PetService { public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'response', reportProgress?: boolean): Observable>; public updatePetWithForm(petId: number, name?: string, status?: string, observe?: 'events', reportProgress?: boolean): Observable>; public updatePetWithForm(petId: number, name?: string, status?: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } + + let headers = this.defaultHeaders; // authentication (petstore_auth) required @@ -422,7 +432,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -462,10 +472,13 @@ export class PetService { public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'response', reportProgress?: boolean): Observable>; public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe?: 'events', reportProgress?: boolean): Observable>; public uploadFile(petId: number, additionalMetadata?: string, file?: Blob, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } + + let headers = this.defaultHeaders; // authentication (petstore_auth) required @@ -492,7 +505,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v5/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v5/npm/api/store.service.ts index 03016b73c9d..46f80a17b16 100644 --- a/samples/client/petstore/typescript-angular-v5/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v5/npm/api/store.service.ts @@ -67,6 +67,7 @@ export class StoreService { public deleteOrder(orderId: string, observe?: 'response', reportProgress?: boolean): Observable>; public deleteOrder(orderId: string, observe?: 'events', reportProgress?: boolean): Observable>; public deleteOrder(orderId: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } @@ -111,7 +112,7 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } @@ -149,6 +150,7 @@ export class StoreService { public getOrderById(orderId: number, observe?: 'response', reportProgress?: boolean): Observable>; public getOrderById(orderId: number, observe?: 'events', reportProgress?: boolean): Observable>; public getOrderById(orderId: number, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } @@ -190,6 +192,7 @@ export class StoreService { public placeOrder(body: Order, observe?: 'response', reportProgress?: boolean): Observable>; public placeOrder(body: Order, observe?: 'events', reportProgress?: boolean): Observable>; public placeOrder(body: Order, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } diff --git a/samples/client/petstore/typescript-angular-v5/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v5/npm/api/user.service.ts index 7c7ccda2a79..e1323ce454b 100644 --- a/samples/client/petstore/typescript-angular-v5/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v5/npm/api/user.service.ts @@ -67,6 +67,7 @@ export class UserService { public createUser(body: User, observe?: 'response', reportProgress?: boolean): Observable>; public createUser(body: User, observe?: 'events', reportProgress?: boolean): Observable>; public createUser(body: User, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } @@ -113,6 +114,7 @@ export class UserService { public createUsersWithArrayInput(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; public createUsersWithArrayInput(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; public createUsersWithArrayInput(body: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } @@ -159,6 +161,7 @@ export class UserService { public createUsersWithListInput(body: Array, observe?: 'response', reportProgress?: boolean): Observable>; public createUsersWithListInput(body: Array, observe?: 'events', reportProgress?: boolean): Observable>; public createUsersWithListInput(body: Array, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } @@ -205,6 +208,7 @@ export class UserService { public deleteUser(username: string, observe?: 'response', reportProgress?: boolean): Observable>; public deleteUser(username: string, observe?: 'events', reportProgress?: boolean): Observable>; public deleteUser(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } @@ -246,6 +250,7 @@ export class UserService { public getUserByName(username: string, observe?: 'response', reportProgress?: boolean): Observable>; public getUserByName(username: string, observe?: 'events', reportProgress?: boolean): Observable>; public getUserByName(username: string, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } @@ -288,9 +293,11 @@ export class UserService { public loginUser(username: string, password: string, observe?: 'response', reportProgress?: boolean): Observable>; public loginUser(username: string, password: string, observe?: 'events', reportProgress?: boolean): Observable>; public loginUser(username: string, password: string, observe: any = 'body', reportProgress: boolean = false ): 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.'); } @@ -379,9 +386,11 @@ export class UserService { public updateUser(username: string, body: User, observe?: 'response', reportProgress?: boolean): Observable>; public updateUser(username: string, body: User, observe?: 'events', reportProgress?: boolean): Observable>; public updateUser(username: string, body: User, observe: any = 'body', reportProgress: boolean = false ): Observable { + if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling updateUser.'); } + if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updateUser.'); } diff --git a/samples/client/petstore/typescript-angular-v5/npm/model/amount.ts b/samples/client/petstore/typescript-angular-v5/npm/model/amount.ts new file mode 100644 index 00000000000..90fc5c01a30 --- /dev/null +++ b/samples/client/petstore/typescript-angular-v5/npm/model/amount.ts @@ -0,0 +1,24 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +import { Currency } from './currency'; + + +/** + * some description + */ +export interface Amount { + /** + * some description + */ + value: number; + currency: Currency; +} diff --git a/samples/client/petstore/typescript-angular-v5/npm/model/currency.ts b/samples/client/petstore/typescript-angular-v5/npm/model/currency.ts new file mode 100644 index 00000000000..c9ff596d4cb --- /dev/null +++ b/samples/client/petstore/typescript-angular-v5/npm/model/currency.ts @@ -0,0 +1,17 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +/** + * some description + */ +export type Currency = string; diff --git a/samples/client/petstore/typescript-angular-v5/npm/model/models.ts b/samples/client/petstore/typescript-angular-v5/npm/model/models.ts index 8607c5dabd0..f6aebdbf709 100644 --- a/samples/client/petstore/typescript-angular-v5/npm/model/models.ts +++ b/samples/client/petstore/typescript-angular-v5/npm/model/models.ts @@ -1,5 +1,7 @@ +export * from './amount'; export * from './apiResponse'; export * from './category'; +export * from './currency'; export * from './order'; export * from './pet'; export * from './tag'; diff --git a/samples/client/petstore/typescript-angular-v5/npm/package-lock.json b/samples/client/petstore/typescript-angular-v5/npm/package-lock.json index 2416a260e18..1b1c4a11fe2 100644 --- a/samples/client/petstore/typescript-angular-v5/npm/package-lock.json +++ b/samples/client/petstore/typescript-angular-v5/npm/package-lock.json @@ -5,27 +5,27 @@ "requires": true, "dependencies": { "@angular/common": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/@angular/common/-/common-5.2.10.tgz", - "integrity": "sha512-4zgI/Q6bo/KCvrDPf8gc2IpTJ3PFKgd9RF4jZuh1uc+uEYTAj396tDF8o412AJ/iwtYOHWUx+YgzAvT8dHXZ5Q==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/@angular/common/-/common-5.2.11.tgz", + "integrity": "sha512-LniJjGAeftUJDJh+2+LEjltcGen08C/VMxQ/eUYmesytKy1sN+MWzh3GbpKfEWtWmyUsYTG9lAAJNo3L3jPwsw==", "dev": true, "requires": { "tslib": "^1.7.1" } }, "@angular/compiler": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-5.2.10.tgz", - "integrity": "sha512-FI9ip+aWGpKQB+VfNbFQ+wyh0K4Th8Q/MrHxW6CN4BYVAfFtfORRohvyyYk0sRxuQO8JFN3W/FFfdXjuL+cZKw==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/@angular/compiler/-/compiler-5.2.11.tgz", + "integrity": "sha512-ICvB1ud1mxaXUYLb8vhJqiLhGBVocAZGxoHTglv6hMkbrRYcnlB3FZJFOzBvtj+krkd1jamoYLI43UAmesqQ6Q==", "dev": true, "requires": { "tslib": "^1.7.1" } }, "@angular/compiler-cli": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-5.2.10.tgz", - "integrity": "sha512-RhI26rVALRn3LrU0CAIEj56m60vLyCd8e2Ah79yRP6vlXL8k6SylXytUljTeXIBtiVu2Bi1qKGf2s1X674GzCw==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/@angular/compiler-cli/-/compiler-cli-5.2.11.tgz", + "integrity": "sha512-dwrQ0yxoCM/XzKzlm7pTsyg4/6ECjT9emZufGj8t12bLMO8NDn1IJOsqXJA1+onEgQKhlr0Ziwi+96TvDTb1Cg==", "dev": true, "requires": { "chokidar": "^1.4.2", @@ -35,27 +35,27 @@ } }, "@angular/core": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/@angular/core/-/core-5.2.10.tgz", - "integrity": "sha512-glDuTtHTcAVhfU3NVewxz/W+Iweq5IaeW2tnMa+RKLopYk9fRs8eR5iTixTGvegwKR770vfXg/gR7P6Ii5cYGQ==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/@angular/core/-/core-5.2.11.tgz", + "integrity": "sha512-h2vpvXNAdOqKzbVaZcHnHGMT5A8uDnizk6FgGq6SPyw9s3d+/VxZ9LJaPjUk3g2lICA7og1tUel+2YfF971MlQ==", "dev": true, "requires": { "tslib": "^1.7.1" } }, "@angular/http": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/@angular/http/-/http-5.2.10.tgz", - "integrity": "sha512-euEJbxpH+pKBAwGUSo7XvNdods/kY6I4s8OUaJPUMtraQkhE6TJ0OMYvnqmGbdLimsg3ZMxqm54jCOjj9saEOQ==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/@angular/http/-/http-5.2.11.tgz", + "integrity": "sha512-eR7wNXh1+6MpcQNb3sq4bJVX03dx50Wl3kpPG+Q7N1VSL0oPQSobaTrR17ac3oFCEfSJn6kkUCqtUXha6wcNHg==", "dev": true, "requires": { "tslib": "^1.7.1" } }, "@angular/platform-browser": { - "version": "5.2.10", - "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-5.2.10.tgz", - "integrity": "sha512-oF1A0BS1wpTlxfv6YytkFCkztvvtVllnh5IUnoyV+siVT3qogKat9ZmzCmcDJ5SvIDYkY+rXBhumyFzBZ5ufFg==", + "version": "5.2.11", + "resolved": "https://registry.npmjs.org/@angular/platform-browser/-/platform-browser-5.2.11.tgz", + "integrity": "sha512-6YZ4IpBFqXx88vEzBZG2WWnaSYXbFWDgG0iT+bZPHAfwsbmqbcMcs7Ogu+XZ4VmK02dTqbrFh7U4P2W+sqrzow==", "dev": true, "requires": { "tslib": "^1.7.1" @@ -84,6 +84,7 @@ "resolved": "https://registry.npmjs.org/ajv/-/ajv-4.11.8.tgz", "integrity": "sha1-gv+wKynmYq5TvcIK8VlHcGc5xTY=", "dev": true, + "optional": true, "requires": { "co": "^4.6.0", "json-stable-stringify": "^1.0.1" @@ -169,9 +170,9 @@ "dev": true }, "are-we-there-yet": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.4.tgz", - "integrity": "sha1-u13KOCu5TwXhUZQ3PRb9O6HKEQ0=", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", "dev": true, "requires": { "delegates": "^1.0.0", @@ -199,30 +200,12 @@ "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", "dev": true }, - "array-filter": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/array-filter/-/array-filter-0.0.1.tgz", - "integrity": "sha1-fajPLiZijtcygDWB/SH2fKzS7uw=", - "dev": true - }, "array-find-index": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", "dev": true }, - "array-map": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-map/-/array-map-0.0.0.tgz", - "integrity": "sha1-iKK6tz0c97zVwbEYoAP2b2ZfpmI=", - "dev": true - }, - "array-reduce": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/array-reduce/-/array-reduce-0.0.0.tgz", - "integrity": "sha1-FziZ0//Rx9k4PkR5Ul2+J4yrXys=", - "dev": true - }, "array-unique": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.2.1.tgz", @@ -237,16 +220,20 @@ "optional": true }, "asn1": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", - "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=", - "dev": true + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "requires": { + "safer-buffer": "~2.1.0" + } }, "assert-plus": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "integrity": "sha1-104bh+ev/A24qttwIfP+SBAasjQ=", - "dev": true + "dev": true, + "optional": true }, "assign-symbols": { "version": "1.0.0", @@ -255,9 +242,9 @@ "dev": true }, "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", - "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", "dev": true }, "async-foreach": { @@ -273,9 +260,9 @@ "dev": true }, "atob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", - "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", "dev": true }, "autoprefixer": { @@ -296,12 +283,13 @@ "version": "0.6.0", "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", "integrity": "sha1-FDQt0428yU0OW4fXY81jYSwOeU8=", - "dev": true + "dev": true, + "optional": true }, "aws4": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", - "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==", + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.10.1.tgz", + "integrity": "sha512-zg7Hz2k5lI8kb7U32998pRRFin7zJlkfezGJjUc2heaD4Pw2wObakCDVzkKztTm/Ln7eiVvYsjqak0Ed4LkMDA==", "dev": true }, "babel-runtime": { @@ -380,29 +368,38 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, - "optional": true, "requires": { "tweetnacl": "^0.14.3" } }, "binary-extensions": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", - "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=", + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "block-stream": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", @@ -417,6 +414,7 @@ "resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", "integrity": "sha1-OciRjO/1eZ+D+UkqhI9iWt0Mdm8=", "dev": true, + "optional": true, "requires": { "hoek": "2.x.x" } @@ -513,15 +511,15 @@ "dev": true }, "buffer-from": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz", - "integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "builtin-modules": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", - "integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz", + "integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==", "dev": true }, "cache-base": { @@ -566,15 +564,15 @@ } }, "caniuse-lite": { - "version": "1.0.30000836", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000836.tgz", - "integrity": "sha512-DlVR8sVTKDgd7t95U0shX3g7MeJ/DOjKOhUcaiXqnVmnO5sG4Tn2rLVOkVfPUJgnQNxnGe8/4GK0dGSI+AagQw==", + "version": "1.0.30001125", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001125.tgz", + "integrity": "sha512-9f+r7BW8Qli917mU3j0fUaTweT3f3vnX/Lcs+1C73V+RADmFme+Ih0Br8vONQi3X0lseOe6ZHfsZLCA8MSjxUA==", "dev": true }, "capture-stack-trace": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.0.tgz", - "integrity": "sha1-Sm+gc5nCa7pH8LJJa00PtAjFVQ0=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/capture-stack-trace/-/capture-stack-trace-1.0.1.tgz", + "integrity": "sha512-mYQLZnx5Qt1JgB1WEiMCf2647plpGeQ2NMR/5L0HNZzGQo4fuSPnK+wjfPnKZV0aiJDgzmWqqkV/g7JD+DW0qw==", "dev": true }, "caseless": { @@ -584,9 +582,9 @@ "dev": true }, "chalk": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", - "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -612,15 +610,15 @@ } }, "chownr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", - "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", "dev": true }, "ci-info": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.1.3.tgz", - "integrity": "sha512-SK/846h/Rcy8q9Z9CAwGBLfCJ6EkjJWdpelWDufQpqVDYq2Wnnv8zlSO6AMQap02jvhVruKKpEtQOufo3pFhLg==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-1.6.0.tgz", + "integrity": "sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A==", "dev": true }, "class-utils": { @@ -653,18 +651,18 @@ } }, "clean-css": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.1.11.tgz", - "integrity": "sha1-Ls3xRaujj1R0DybO/Q/z4D4SXWo=", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-4.2.3.tgz", + "integrity": "sha512-VcMWDN54ZN/DS+g58HYL5/n4Zrqe8vHJpGA8KdgUXFU4fuP/aHNw8eld9SyEIyabIMJX/0RaY/fplOo5hYLSFA==", "dev": true, "requires": { - "source-map": "0.5.x" + "source-map": "~0.6.0" }, "dependencies": { "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } @@ -676,21 +674,56 @@ "dev": true }, "cliui": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", - "integrity": "sha1-EgYBU3qRbSmUD5NNo7SNWFo5IT0=", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wrap-ansi": "^2.0.0" + "string-width": "^3.1.0", + "strip-ansi": "^5.2.0", + "wrap-ansi": "^5.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", - "dev": true + "dev": true, + "optional": true }, "code-point-at": { "version": "1.1.0", @@ -709,12 +742,12 @@ } }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { - "color-name": "^1.1.1" + "color-name": "1.1.3" } }, "color-name": { @@ -724,18 +757,18 @@ "dev": true }, "combined-stream": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true }, "commenting": { @@ -745,9 +778,9 @@ "dev": true }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "concat-map": { @@ -757,12 +790,12 @@ "dev": true }, "configstore": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.2.tgz", - "integrity": "sha512-vtv5HtGjcYUgFrXc6Kx747B83MRRVS5R1VTEQoXvuP+kMI+if6uywV0nDGoiydJRy4yk7h9od5Og0kxx4zUXmw==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-3.1.5.tgz", + "integrity": "sha512-nlOhI4+fdzoK5xmJ+NY+1gZK56bwEaWZr8fYuXohZ9Vkc1o3a4T/R3M+yE/w7x/ZVJ1zF8c+oaOvF0dztdUgmA==", "dev": true, "requires": { - "dot-prop": "^4.1.0", + "dot-prop": "^4.2.1", "graceful-fs": "^4.1.2", "make-dir": "^1.0.0", "unique-string": "^1.0.0", @@ -783,9 +816,9 @@ "dev": true }, "core-js": { - "version": "2.5.6", - "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.6.tgz", - "integrity": "sha512-lQUVfQi0aLix2xpyjrrJEvfuYCqPc/HwmTKsC/VNf8q0zsjX7SQZtp4+oRONN5Tsur9GDETPjj+Ub2iDiGZfSQ==", + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.11.tgz", + "integrity": "sha512-5wjnpaT/3dV+XB4borEsnAYQchn00XSgTAWKDkEqv+K8KevjbzmofK6hfJ9TZIlpj2N0xQpazy7PiRQiWHqzWg==", "dev": true }, "core-util-is": { @@ -837,6 +870,7 @@ "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", "integrity": "sha1-O9/s3GCBR8HGcgL6KR59ylnqo7g=", "dev": true, + "optional": true, "requires": { "boom": "2.x.x" } @@ -847,11 +881,34 @@ "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", "dev": true }, + "css": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz", + "integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==", + "dev": true, + "requires": { + "inherits": "^2.0.3", + "source-map": "^0.6.1", + "source-map-resolve": "^0.5.2", + "urix": "^0.1.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "css-parse": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-1.7.0.tgz", - "integrity": "sha1-Mh9s9zeCpv91ERE5D8BeLGV9jJs=", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-2.0.0.tgz", + "integrity": "sha1-pGjuZnwW2BzPBcWMONKpfHgNv9Q=", + "dev": true, + "requires": { + "css": "^2.0.0" + } }, "cuint": { "version": "0.2.2", @@ -907,9 +964,9 @@ "dev": true }, "deep-extend": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.5.1.tgz", - "integrity": "sha512-N8vBdOa+DF7zkRrDCsaOXoCs/E2fJfx9B9MrKnnSiHNh4ws7eSys6YQE4KvT1cecKmOASYQBhbKjeuDD9lT81w==", + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", "dev": true }, "define-property": { @@ -958,9 +1015,9 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } @@ -978,18 +1035,18 @@ "dev": true }, "dot-prop": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", - "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.1.tgz", + "integrity": "sha512-l0p4+mIuJIua0mhxGoh4a+iNL9bmeK5DvnSVQa6T0OhrVmaEa1XScX5Etc673FePCJOArq/4Pa2cLGODUWTPOQ==", "dev": true, "requires": { "is-obj": "^1.0.0" } }, "duplexer": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", - "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", + "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", "dev": true }, "duplexer3": { @@ -999,19 +1056,25 @@ "dev": true }, "ecc-jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", - "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, - "optional": true, "requires": { - "jsbn": "~0.1.0" + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" } }, "electron-to-chromium": { - "version": "1.3.45", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.45.tgz", - "integrity": "sha1-RYrBscXHYM6IEaFtK/vZfsMLr7g=", + "version": "1.3.564", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.564.tgz", + "integrity": "sha512-fNaYN3EtKQWLQsrKXui8mzcryJXuA0LbCLoizeX6oayG2emBaS5MauKjCPAvc29NEY4FpLHIUWiP+Y0Bfrs5dg==", + "dev": true + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "errno": { @@ -1025,9 +1088,9 @@ } }, "error-ex": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.1.tgz", - "integrity": "sha1-+FWobOYa3E6GIcPNoh56dhLDqNw=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -1046,9 +1109,9 @@ "dev": true }, "estree-walker": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true }, "execa": { @@ -1098,9 +1161,9 @@ } }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, "extend-shallow": { @@ -1139,6 +1202,25 @@ "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", "dev": true }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -1146,14 +1228,14 @@ "dev": true }, "fill-range": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.3.tgz", - "integrity": "sha1-ULd9/X5Gm8dJJHCWNpn+eoSFpyM=", + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-2.2.4.tgz", + "integrity": "sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==", "dev": true, "requires": { "is-number": "^2.1.0", "isobject": "^2.0.0", - "randomatic": "^1.1.3", + "randomatic": "^3.0.0", "repeat-element": "^1.1.2", "repeat-string": "^1.5.2" } @@ -1206,6 +1288,7 @@ "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.1.4.tgz", "integrity": "sha1-M8GDrPGTJ27KqYFDpp6Uv+4XUNE=", "dev": true, + "optional": true, "requires": { "asynckit": "^0.4.0", "combined-stream": "^1.0.5", @@ -1233,12 +1316,12 @@ } }, "fs-minipass": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", "dev": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.6.0" } }, "fs.realpath": { @@ -1248,631 +1331,98 @@ "dev": true }, "fsevents": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.3.tgz", - "integrity": "sha512-X+57O5YkDTiEQGiw8i7wYc2nQgweIekqkepI8Q3y4wVlurgBt2SuwxTeYUYMZIGpLZH3r/TsMjczCMXE5ZOt7Q==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.9.0" + "bindings": "^1.5.0", + "nan": "^2.12.1" + } + }, + "fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + } + }, + "gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "dev": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "gaze": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.3.tgz", + "integrity": "sha512-BRdNm8hbWzFzWHERTrejLqwHDfS4GibPoq5wjTPIoJHoBtKGPg3xAFfxmM+9ztbXelxcf2hwQcaz1PtmFeue8g==", + "dev": true, + "requires": { + "globule": "^1.0.0" + } + }, + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "get-stdin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", + "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", + "dev": true + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0" }, "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { + "assert-plus": { "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "2.6.9", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "2.0.0" - } - }, - "deep-extend": { - "version": "0.4.2", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.21", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": "^2.1.0" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.2.4", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.1", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.1.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.2.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^2.1.2", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.9.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.0", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.1.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.1.10", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "~0.4.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.0.5" - } - }, - "safe-buffer": { - "version": "5.1.1", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.5.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.0.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.1", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.2", - "bundled": true, - "dev": true - } - } - }, - "fstream": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.11.tgz", - "integrity": "sha1-XB+x8RdHcRTwYyoOtLcbPLD9MXE=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "dev": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "gaze": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/gaze/-/gaze-1.1.2.tgz", - "integrity": "sha1-hHIkZ3rbiHDWeSV+0ziP22HkAQU=", - "dev": true, - "requires": { - "globule": "^1.0.0" - } - }, - "generate-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "integrity": "sha1-aFj+fAlpt9TpCTM3ZHrHn2DfvnQ=", - "dev": true - }, - "generate-object-property": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "integrity": "sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=", - "dev": true, - "requires": { - "is-property": "^1.0.0" - } - }, - "get-caller-file": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", - "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=", - "dev": true - }, - "get-stdin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-4.0.1.tgz", - "integrity": "sha1-uWjGsKBDhDJJAui/Gl3zJXmkUP4=", - "dev": true - }, - "get-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", - "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", - "dev": true - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", - "dev": true - }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "dev": true, - "requires": { - "assert-plus": "^1.0.0" - }, - "dependencies": { - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", "dev": true } } }, "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -1921,13 +1471,13 @@ } }, "globule": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/globule/-/globule-1.2.0.tgz", - "integrity": "sha1-HcScaCLdnoovoAuiopUAboZkvQk=", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/globule/-/globule-1.3.2.tgz", + "integrity": "sha512-7IDTQTIu2xzXkT+6mlluidnWo+BypnbSoEVVQCGfzqnl5Ik8d3e1d4wycb8Rj9tWW+Z39uPWsdlquqiqPCd/pA==", "dev": true, "requires": { "glob": "~7.1.1", - "lodash": "~4.17.4", + "lodash": "~4.17.10", "minimatch": "~3.0.2" } }, @@ -1951,22 +1501,24 @@ } }, "graceful-fs": { - "version": "4.1.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", - "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=", + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "har-schema": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-1.0.5.tgz", "integrity": "sha1-0mMTX0MwfALGAq/I/pWXDAFRNp4=", - "dev": true + "dev": true, + "optional": true }, "har-validator": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-4.2.1.tgz", "integrity": "sha1-M0gdDxu/9gDdID11gSpqX7oALio=", "dev": true, + "optional": true, "requires": { "ajv": "^4.9.1", "har-schema": "^1.0.5" @@ -2058,6 +1610,7 @@ "resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "integrity": "sha1-B4REvXwWQLD+VA0sm3PVlnjo4cQ=", "dev": true, + "optional": true, "requires": { "boom": "2.x.x", "cryptiles": "2.x.x", @@ -2069,12 +1622,13 @@ "version": "2.16.3", "resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", "integrity": "sha1-ILt0A9POo5jpHcRxCo/xuCdKJe0=", - "dev": true + "dev": true, + "optional": true }, "hosted-git-info": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.6.0.tgz", - "integrity": "sha512-lIbgIIQA3lz5XaB6vxakj6sDHADJiZadYEJB+FgA+C4nubM1NwcuvUr9EJPmnH1skZqpqUzWborWo8EIUi0Sdw==", + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "http-signature": { @@ -2082,6 +1636,7 @@ "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz", "integrity": "sha1-33LiZwZs0Kxn+3at+OE0qPvPkb8=", "dev": true, + "optional": true, "requires": { "assert-plus": "^0.2.0", "jsprim": "^1.2.2", @@ -2108,9 +1663,9 @@ "dev": true }, "in-publish": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.0.tgz", - "integrity": "sha1-4g/146KvwmkDILbcVSaCqcf631E=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/in-publish/-/in-publish-2.0.1.tgz", + "integrity": "sha512-oDM0kUSNFC31ShNxHKUyfZKy8ZeXZBWMjMdZHKLOk13uvT27VTL/QzRGfRUcevJhpkZAvlhPYuXkF7eNWrtyxQ==", "dev": true }, "indent-string": { @@ -2133,9 +1688,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ini": { @@ -2145,16 +1700,13 @@ "dev": true }, "injection-js": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/injection-js/-/injection-js-2.2.1.tgz", - "integrity": "sha512-zHI+E+dM0PXix5FFTO1Y4/UOyAzE7zG1l/QwAn4jchTThOoBq+UYRFK4AVG7lQgFL+go62SbrzSsjXy9DFEZUg==", - "dev": true - }, - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=", - "dev": true + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/injection-js/-/injection-js-2.3.1.tgz", + "integrity": "sha512-t+kpDAOL/DUZ68JncAhsb8C91qhJ6dXRMcOuvJfNA7sp63etdiQe6KQoxE/nZ5b2eTi0TQX6OothOCm89cLAJQ==", + "dev": true, + "requires": { + "tslib": "^1.9.3" + } }, "is-accessor-descriptor": { "version": "0.1.6", @@ -2186,22 +1738,13 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "is-builtin-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-1.0.0.tgz", - "integrity": "sha1-VAVy0096wxGfj3bDDLwbHgN6/74=", - "dev": true, - "requires": { - "builtin-modules": "^1.0.0" - } - }, "is-ci": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.1.0.tgz", - "integrity": "sha512-c7TnwxLePuqIlxHgr7xtxzycJPegNHFuIrBkwbf8hc58//+Op1CqFkyS+xnIMkwn9UsJIwc174BIjkyBmSpjKg==", + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-1.2.1.tgz", + "integrity": "sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg==", "dev": true, "requires": { - "ci-info": "^1.0.0" + "ci-info": "^1.5.0" } }, "is-data-descriptor": { @@ -2260,13 +1803,10 @@ "dev": true }, "is-finite": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.0.2.tgz", - "integrity": "sha1-zGZ3aVYCvlUO8R6LSqYwU0K20Ko=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", + "dev": true }, "is-fullwidth-code-point": { "version": "1.0.0", @@ -2302,25 +1842,6 @@ "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", "dev": true }, - "is-my-ip-valid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz", - "integrity": "sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==", - "dev": true - }, - "is-my-json-valid": { - "version": "2.17.2", - "resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.17.2.tgz", - "integrity": "sha512-IBhBslgngMQN8DDSppmgDv7RNrlFotuuDsKcrCP3+HbFaVivIBU7u9oiiErw8sH4ynx3+gOGQ3q2otkgiSi6kg==", - "dev": true, - "requires": { - "generate-function": "^2.0.0", - "generate-object-property": "^1.1.0", - "is-my-ip-valid": "^1.0.0", - "jsonpointer": "^4.0.0", - "xtend": "^4.0.0" - } - }, "is-npm": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-1.0.0.tgz", @@ -2342,23 +1863,6 @@ "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, - "is-odd": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", - "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", - "dev": true, - "requires": { - "is-number": "^4.0.0" - }, - "dependencies": { - "is-number": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", - "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", - "dev": true - } - } - }, "is-path-inside": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", @@ -2397,12 +1901,6 @@ "integrity": "sha1-IHurkWOEmcB7Kt8kCkGochADRXU=", "dev": true }, - "is-property": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "integrity": "sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=", - "dev": true - }, "is-redirect": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", @@ -2410,9 +1908,9 @@ "dev": true }, "is-retry-allowed": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.1.0.tgz", - "integrity": "sha1-EaBgVotnM5REAz0BJaYaINVk+zQ=", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", + "integrity": "sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==", "dev": true }, "is-stream": { @@ -2467,17 +1965,16 @@ "dev": true }, "js-base64": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.4.3.tgz", - "integrity": "sha512-H7ErYLM34CvDMto3GbD6xD0JLUGYXR3QTcH6B/tr4Hi/QpSThnCsIp+Sy5FRTw3B0d6py4HcNkW7nO/wdtGWEw==", + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz", + "integrity": "sha512-pZe//GGmwJndub7ZghVHz7vjb2LgC1m8B07Au3eYqeqv9emhESByMXxaEgkUkEqJe87oBbSniGYoQNIBklc7IQ==", "dev": true }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "dev": true }, "json-parse-better-errors": { "version": "1.0.2", @@ -2491,11 +1988,18 @@ "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", "dev": true }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, "json-stable-stringify": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/json-stable-stringify/-/json-stable-stringify-1.0.1.tgz", "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, + "optional": true, "requires": { "jsonify": "~0.0.0" } @@ -2519,13 +2023,8 @@ "version": "0.0.0", "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", - "dev": true - }, - "jsonpointer": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-4.0.1.tgz", - "integrity": "sha1-T9kss04OnbPInIYi7PUfm5eMbLk=", - "dev": true + "dev": true, + "optional": true }, "jsprim": { "version": "1.4.1", @@ -2565,15 +2064,6 @@ "package-json": "^4.0.0" } }, - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "dev": true, - "requires": { - "invert-kv": "^1.0.0" - } - }, "less": { "version": "2.7.3", "resolved": "https://registry.npmjs.org/less/-/less-2.7.3.tgz", @@ -2588,15 +2078,6 @@ "promise": "^7.1.1", "request": "2.81.0", "source-map": "^0.5.3" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "optional": true - } } }, "load-json-file": { @@ -2624,12 +2105,12 @@ } }, "locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { - "p-locate": "^2.0.0", + "p-locate": "^3.0.0", "path-exists": "^3.0.0" }, "dependencies": { @@ -2642,27 +2123,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", - "dev": true - }, - "lodash.assign": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-4.2.0.tgz", - "integrity": "sha1-DZnzzNem0mHRm9rrkkUAXShYCOc=", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", - "dev": true - }, - "lodash.mergewith": { - "version": "4.6.1", - "resolved": "https://registry.npmjs.org/lodash.mergewith/-/lodash.mergewith-4.6.1.tgz", - "integrity": "sha512-eWw5r+PYICtEBgrBE5hhlT6aAa75f411bgDz/ZL2KZqYV03USvucsxcHUIlGTDTECs1eunpI7HOV7U+WLDvNdQ==", + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "loud-rejection": { @@ -2682,9 +2145,9 @@ "dev": true }, "lru-cache": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", - "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", "dev": true, "requires": { "pseudomap": "^1.0.2", @@ -2701,9 +2164,9 @@ } }, "make-dir": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", - "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", "dev": true, "requires": { "pify": "^3.0.0" @@ -2738,6 +2201,12 @@ "object-visit": "^1.0.0" } }, + "math-random": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", + "integrity": "sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==", + "dev": true + }, "meow": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/meow/-/meow-3.7.0.tgz", @@ -2796,18 +2265,18 @@ "dev": true }, "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==", + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { - "mime-db": "~1.33.0" + "mime-db": "1.44.0" } }, "minimatch": { @@ -2820,42 +2289,42 @@ } }, "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "minipass": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.0.tgz", - "integrity": "sha512-jWC2Eg+Np4bxah7llu1IrUNSJQxtLz/J+pOjTM0nFpJXGAaV18XBWhUn031Q1tAA/TJtA1jgwnOe9S2PQa4Lbg==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", "dev": true, "requires": { - "safe-buffer": "^5.1.1", + "safe-buffer": "^5.1.2", "yallist": "^3.0.0" }, "dependencies": { "yallist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", - "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true } } }, "minizlib": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.1.0.tgz", - "integrity": "sha512-4T6Ur/GctZ27nHfpt9THOdRZNgyJ9FZchYO1ceg5S8Q3DNLCKYy44nCZzgCJgcvx2UM8czmqak5BCxJMrq37lA==", + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", "dev": true, "requires": { - "minipass": "^2.2.1" + "minipass": "^2.9.0" } }, "mixin-deep": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", - "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", "dev": true, "requires": { "for-in": "^1.0.2", @@ -2874,20 +2343,12 @@ } }, "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "minimist": "^1.2.5" } }, "moment": { @@ -2903,15 +2364,15 @@ "dev": true }, "nan": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", - "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "dev": true }, "nanomatch": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", - "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", "dev": true, "requires": { "arr-diff": "^4.0.0", @@ -2919,7 +2380,6 @@ "define-property": "^2.0.2", "extend-shallow": "^3.0.2", "fragment-cache": "^0.2.1", - "is-odd": "^2.0.0", "is-windows": "^1.0.2", "kind-of": "^6.0.2", "object.pick": "^1.3.0", @@ -2941,17 +2401,17 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } }, "ng-packagr": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-2.4.4.tgz", - "integrity": "sha512-+zIM3kihH+8G4vxGnC1PFWinNPTZewo7ChajLKk1XnPynpaqxHlA1oZdJ9X8FP3F2w0oF4exodIJzqq6WyNfeA==", + "version": "2.4.5", + "resolved": "https://registry.npmjs.org/ng-packagr/-/ng-packagr-2.4.5.tgz", + "integrity": "sha512-1SnzFGIM2urn0fFp2aP9+fv5xs1HyhiDwwHbowZIBlPQ+gVRuhVNLTM3L21URDakDt3+rO9D+DipyyvRWnBRLw==", "dev": true, "requires": { "@ngtools/json-schema": "^1.1.0", @@ -2986,26 +2446,139 @@ } }, "node-gyp": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.6.2.tgz", - "integrity": "sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA=", + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", "dev": true, "requires": { "fstream": "^1.0.0", "glob": "^7.0.3", "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", "mkdirp": "^0.5.0", "nopt": "2 || 3", "npmlog": "0 || 1 || 2 || 3 || 4", "osenv": "0", - "request": "2", + "request": "^2.87.0", "rimraf": "2", "semver": "~5.3.0", "tar": "^2.0.0", "which": "1" }, "dependencies": { + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true + }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, + "har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, + "qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true + }, + "request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "dev": true, + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + } + }, "semver": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", @@ -3013,22 +2586,32 @@ "dev": true }, "tar": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.1.tgz", - "integrity": "sha1-jk0qJWwOIYXGsYrWlK7JaLg8sdE=", + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", "dev": true, "requires": { "block-stream": "*", - "fstream": "^1.0.2", + "fstream": "^1.0.12", "inherits": "2" } + }, + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } } } }, "node-sass": { - "version": "4.9.0", - "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.9.0.tgz", - "integrity": "sha512-QFHfrZl6lqRU3csypwviz2XLgGNOoWQbo2GOvtsfQqOfL4cy1BtWnhx/XUeAO9LT3ahBzSRXcEO6DdvAH9DzSg==", + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/node-sass/-/node-sass-4.14.1.tgz", + "integrity": "sha512-sjCuOlvGyCJS40R8BscF5vhVlQjNN069NtQ1gSxyK1u9iqvn6tf7O1R4GNowVZfiZUCRt5MmMs1xd+4V/7Yr0g==", "dev": true, "requires": { "async-foreach": "^0.1.3", @@ -3038,30 +2621,46 @@ "get-stdin": "^4.0.1", "glob": "^7.0.3", "in-publish": "^2.0.0", - "lodash.assign": "^4.2.0", - "lodash.clonedeep": "^4.3.2", - "lodash.mergewith": "^4.6.0", + "lodash": "^4.17.15", "meow": "^3.7.0", "mkdirp": "^0.5.1", - "nan": "^2.10.0", - "node-gyp": "^3.3.1", + "nan": "^2.13.2", + "node-gyp": "^3.8.0", "npmlog": "^4.0.0", - "request": "~2.79.0", - "sass-graph": "^2.2.4", + "request": "^2.88.0", + "sass-graph": "2.2.5", "stdout-stream": "^1.4.0", "true-case-path": "^1.0.2" }, "dependencies": { + "ajv": { + "version": "6.12.4", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, "ansi-styles": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=", "dev": true }, - "caseless": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "integrity": "sha1-cVuW6phBWTzDMGeSP17GDr2k99c=", + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", "dev": true }, "chalk": { @@ -3077,50 +2676,94 @@ "supports-color": "^2.0.0" } }, + "form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true + }, "har-validator": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", - "integrity": "sha1-zcvAgYgmWtEZtqWnyKtw7s+10n0=", + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "dev": true, + "requires": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + } + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "dev": true, "requires": { - "chalk": "^1.1.1", - "commander": "^2.9.0", - "is-my-json-valid": "^2.12.4", - "pinkie-promise": "^2.0.0" + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" } }, + "oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + }, "qs": { - "version": "6.3.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.3.2.tgz", - "integrity": "sha1-51vV9uJoEioqDgvaYwslUMFmUCw=", + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, "request": { - "version": "2.79.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.79.0.tgz", - "integrity": "sha1-Tf5b9r6LjNw3/Pk+BLZVd3InEN4=", + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", "dev": true, "requires": { - "aws-sign2": "~0.6.0", - "aws4": "^1.2.1", - "caseless": "~0.11.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.0", + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", "forever-agent": "~0.6.1", - "form-data": "~2.1.1", - "har-validator": "~2.0.6", - "hawk": "~3.1.3", - "http-signature": "~1.1.0", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.7", - "oauth-sign": "~0.8.1", - "qs": "~6.3.0", - "stringstream": "~0.0.4", - "tough-cookie": "~2.3.0", - "tunnel-agent": "~0.4.1", - "uuid": "^3.0.0" + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" } }, "supports-color": { @@ -3129,11 +2772,15 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, - "tunnel-agent": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", - "integrity": "sha1-Y3PbdpCf5XDgjXNYM2Xtgop07us=", - "dev": true + "tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "requires": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + } } } }, @@ -3156,13 +2803,13 @@ } }, "normalize-package-data": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha512-9jjUFbTPfEy3R/ad/2oNbKtW9Hgovl5O1FvFWKkKblNXoN/Oou6+9+KKohPK13Yc3/TyunyWhJp6gvRNR/PPAw==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", - "is-builtin-module": "^1.0.0", + "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" } @@ -3219,7 +2866,8 @@ "version": "0.8.2", "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=", - "dev": true + "dev": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -3308,15 +2956,6 @@ "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", "dev": true }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "dev": true, - "requires": { - "lcid": "^1.0.0" - } - }, "os-tmpdir": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", @@ -3340,27 +2979,27 @@ "dev": true }, "p-limit": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.2.0.tgz", - "integrity": "sha512-Y/OtIaXtUPr4/YpMv1pCL5L5ed0rumAaAeBSj12F+bSlMdys7i8oQF/GUJmfpTS/QoaRrS/k6pma29haJpsMng==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { - "p-try": "^1.0.0" + "p-try": "^2.0.0" } }, "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { - "p-limit": "^1.1.0" + "p-limit": "^2.0.0" } }, "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "package-json": { @@ -3430,9 +3069,9 @@ "dev": true }, "path-parse": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", - "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-type": { @@ -3450,7 +3089,8 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-0.2.0.tgz", "integrity": "sha1-M+8wxcd9TqIcWlOGnZG1bY8lVeU=", - "dev": true + "dev": true, + "optional": true }, "pify": { "version": "2.3.0", @@ -3480,14 +3120,22 @@ "dev": true }, "postcss": { - "version": "6.0.22", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.22.tgz", - "integrity": "sha512-Toc9lLoUASwGqxBSJGTVcOQiDqjK+Z2XlWBg+IgYwQMY9vA2f7iMpXVc1GpPcfTSyM5lkxNo0oDwDRO+wm7XHA==", + "version": "6.0.23", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-6.0.23.tgz", + "integrity": "sha512-soOk1h6J3VMTZtVeVpv15/Hpdl2cBLX3CAw4TAbkpTJiNPk9YP/zWcD1ND+xEtvyuuvKzbxliTOIyvkSeSJ6ag==", "dev": true, "requires": { "chalk": "^2.4.1", "source-map": "^0.6.1", "supports-color": "^5.4.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "postcss-clean": { @@ -3514,9 +3162,9 @@ } }, "postcss-value-parser": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.0.tgz", - "integrity": "sha1-h/OPnxj3dKSrTIojL1xc6IcqnRU=", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==", "dev": true }, "prepend-http": { @@ -3532,9 +3180,9 @@ "dev": true }, "process-nextick-args": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "promise": { @@ -3560,66 +3208,58 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, + "psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, "punycode": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", - "dev": true + "dev": true, + "optional": true }, "qs": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.4.0.tgz", "integrity": "sha1-E+JtKK1rD/qpExLNO/cI7TUecjM=", - "dev": true + "dev": true, + "optional": true }, "randomatic": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-1.1.7.tgz", - "integrity": "sha512-D5JUjPyJbaJDkuAazpVnSfVkLlpeO3wDlPROTMLGKG1zMFNFRgrciKo1ltz/AzNTkqE0HzDx655QOL51N06how==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/randomatic/-/randomatic-3.1.1.tgz", + "integrity": "sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==", "dev": true, "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" + "is-number": "^4.0.0", + "kind-of": "^6.0.0", + "math-random": "^1.0.1" }, "dependencies": { "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "dev": true, - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==", + "dev": true }, "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true } } }, "rc": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.7.tgz", - "integrity": "sha512-LdLD8xD4zzLsAT5xyushXDNscEjB7+2ulnl8+r1pnESlYtlJtVSoCMBGr30eDRJ3+2Gq89jK9P9e4tCEH1+ywA==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "dev": true, "requires": { - "deep-extend": "^0.5.1", + "deep-extend": "^0.6.0", "ini": "~1.3.0", "minimist": "^1.2.0", "strip-json-comments": "~2.0.1" @@ -3667,6 +3307,40 @@ "strip-bom": "^3.0.0" } }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, "parse-json": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", @@ -3677,6 +3351,12 @@ "json-parse-better-errors": "^1.0.1" } }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, "path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", @@ -3706,9 +3386,9 @@ } }, "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -3721,272 +3401,14 @@ } }, "readdirp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", - "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "minimatch": "^3.0.2", - "readable-stream": "^2.0.2", - "set-immediate-shim": "^1.0.1" - } - }, - "redent": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", - "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", - "dev": true, - "requires": { - "indent-string": "^2.1.0", - "strip-indent": "^1.0.1" - } - }, - "reflect-metadata": { - "version": "0.1.12", - "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.12.tgz", - "integrity": "sha512-n+IyV+nGz3+0q3/Yf1ra12KpCyi001bi4XFxSjbiWWjfqb52iTTtpGXmCCAOWWIAn9KEuFZKGqBERHmrtScZ3A==", - "dev": true - }, - "regenerator-runtime": { - "version": "0.11.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", - "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", - "dev": true - }, - "regex-cache": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", - "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", - "dev": true, - "requires": { - "is-equal-shallow": "^0.1.3" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", - "dev": true, - "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" - } - }, - "registry-auth-token": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", - "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", - "dev": true, - "requires": { - "rc": "^1.1.6", - "safe-buffer": "^5.0.1" - } - }, - "registry-url": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", - "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", - "dev": true, - "requires": { - "rc": "^1.0.1" - } - }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", - "dev": true - }, - "repeat-element": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", - "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=", - "dev": true - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", - "dev": true - }, - "repeating": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", - "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", - "dev": true, - "requires": { - "is-finite": "^1.0.0" - } - }, - "request": { - "version": "2.81.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", - "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", - "dev": true, - "requires": { - "aws-sign2": "~0.6.0", - "aws4": "^1.2.1", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.0", - "forever-agent": "~0.6.1", - "form-data": "~2.1.1", - "har-validator": "~4.2.1", - "hawk": "~3.1.3", - "http-signature": "~1.1.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.7", - "oauth-sign": "~0.8.1", - "performance-now": "^0.2.0", - "qs": "~6.4.0", - "safe-buffer": "^5.0.1", - "stringstream": "~0.0.4", - "tough-cookie": "~2.3.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.0.0" - } - }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", - "dev": true - }, - "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", - "dev": true - }, - "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", - "dev": true, - "requires": { - "path-parse": "^1.0.5" - } - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", - "dev": true - }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", - "dev": true - }, - "rimraf": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", - "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", - "dev": true, - "requires": { - "glob": "^7.0.5" - } - }, - "rollup": { - "version": "0.55.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.55.5.tgz", - "integrity": "sha512-2hke9NOy332kxvnmMQOgl7DHm94zihNyYJNd8ZLWo4U0EjFvjUkeWa0+ge+70bTg+mY0xJ7NUsf5kIhDtrGrtA==", - "dev": true - }, - "rollup-plugin-cleanup": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-cleanup/-/rollup-plugin-cleanup-2.0.1.tgz", - "integrity": "sha512-Z2UpMe3l2Oo8jzoB2gAWcb3UqIyiGxlh8kKlcs/W53yTPtwdF8RGfhuTx+/kjRlkSc5TC03t3sX3Lj3B40k9Eg==", - "dev": true, - "requires": { - "acorn": "4.x", - "magic-string": "^0.22.4", - "rollup-pluginutils": "^2.0.1" - } - }, - "rollup-plugin-commonjs": { - "version": "8.3.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.3.0.tgz", - "integrity": "sha512-PYs3OiYgENFYEmI3vOEm5nrp3eY90YZqd5vGmQqeXmhJsAWFIrFdROCvOasqJ1HgeTvqyYo9IGXnFDyoboNcgQ==", - "dev": true, - "requires": { - "acorn": "^5.2.1", - "estree-walker": "^0.5.0", - "magic-string": "^0.22.4", - "resolve": "^1.4.0", - "rollup-pluginutils": "^2.0.1" - }, - "dependencies": { - "acorn": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz", - "integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==", - "dev": true - } - } - }, - "rollup-plugin-license": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-0.6.0.tgz", - "integrity": "sha512-Ttz65oRtNKcfV5icDkQTixc8ja64ueoXejRJoAtmjXYAWVg0qx+tu5rXmEOXWXmUXeGs0ARUVIAG0p1JK0gACQ==", - "dev": true, - "requires": { - "commenting": "1.0.5", - "lodash": "4.17.5", - "magic-string": "0.22.4", - "mkdirp": "0.5.1", - "moment": "2.21.0" - }, - "dependencies": { - "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", - "dev": true - }, - "magic-string": { - "version": "0.22.4", - "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.4.tgz", - "integrity": "sha512-kxBL06p6iO2qPBHsqGK2b3cRwiRGpnmSuVWNhwHcMX7qJOUr1HvricYP1LZOCdkQBUp0jiWg2d6WJwR3vYgByw==", - "dev": true, - "requires": { - "vlq": "^0.2.1" - } - } - } - }, - "rollup-plugin-node-resolve": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.3.0.tgz", - "integrity": "sha512-9zHGr3oUJq6G+X0oRMYlzid9fXicBdiydhwGChdyeNRGPcN/majtegApRKHLR5drboUvEWU+QeUmGTyEZQs3WA==", - "dev": true, - "requires": { - "builtin-modules": "^2.0.0", - "is-module": "^1.0.0", - "resolve": "^1.1.6" - }, - "dependencies": { - "builtin-modules": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz", - "integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==", - "dev": true - } - } - }, - "rollup-pluginutils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.1.0.tgz", - "integrity": "sha512-UyIb55bvJBop3HmpULDYG8eNoWvZ4Du+kqy3KG32JcEazHuJ3uXzrzksc3/snBzxXWjyYjLgHC4OgORMCQQpAw==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", "dev": true, "requires": { - "estree-walker": "^0.5.2", + "graceful-fs": "^4.1.11", "micromatch": "^3.1.10", - "tosource": "^1.0.0" + "readable-stream": "^2.0.2" }, "dependencies": { "arr-diff": { @@ -4216,59 +3638,328 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "dev": true, - "requires": { - "is-buffer": "^1.1.5" - } - } + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true + }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + } + } + }, + "redent": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", + "integrity": "sha1-z5Fqsf1fHxbfsggi3W7H9zDCr94=", + "dev": true, + "requires": { + "indent-string": "^2.1.0", + "strip-indent": "^1.0.1" + } + }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", + "dev": true + }, + "regex-cache": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/regex-cache/-/regex-cache-0.4.4.tgz", + "integrity": "sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==", + "dev": true, + "requires": { + "is-equal-shallow": "^0.1.3" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "registry-auth-token": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.4.0.tgz", + "integrity": "sha512-4LM6Fw8eBQdwMYcES4yTnn2TqIasbXuwDx3um+QRs7S55aMKCBKBxvPXl2RiUjHwuJLTyYfxSpmfSAjQpcuP+A==", + "dev": true, + "requires": { + "rc": "^1.1.6", + "safe-buffer": "^5.0.1" + } + }, + "registry-url": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-3.1.0.tgz", + "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", + "dev": true, + "requires": { + "rc": "^1.0.1" + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true + }, + "repeating": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", + "integrity": "sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=", + "dev": true, + "requires": { + "is-finite": "^1.0.0" + } + }, + "request": { + "version": "2.81.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.81.0.tgz", + "integrity": "sha1-xpKJRqDgbF+Nb4qTM0af/aRimKA=", + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "~0.6.0", + "aws4": "^1.2.1", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.0", + "forever-agent": "~0.6.1", + "form-data": "~2.1.1", + "har-validator": "~4.2.1", + "hawk": "~3.1.3", + "http-signature": "~1.1.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.7", + "oauth-sign": "~0.8.1", + "performance-now": "^0.2.0", + "qs": "~6.4.0", + "safe-buffer": "^5.0.1", + "stringstream": "~0.0.4", + "tough-cookie": "~2.3.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.0.0" + } + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true + }, + "require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "rollup": { + "version": "0.55.5", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-0.55.5.tgz", + "integrity": "sha512-2hke9NOy332kxvnmMQOgl7DHm94zihNyYJNd8ZLWo4U0EjFvjUkeWa0+ge+70bTg+mY0xJ7NUsf5kIhDtrGrtA==", + "dev": true + }, + "rollup-plugin-cleanup": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/rollup-plugin-cleanup/-/rollup-plugin-cleanup-2.0.1.tgz", + "integrity": "sha512-Z2UpMe3l2Oo8jzoB2gAWcb3UqIyiGxlh8kKlcs/W53yTPtwdF8RGfhuTx+/kjRlkSc5TC03t3sX3Lj3B40k9Eg==", + "dev": true, + "requires": { + "acorn": "4.x", + "magic-string": "^0.22.4", + "rollup-pluginutils": "^2.0.1" + } + }, + "rollup-plugin-commonjs": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.3.0.tgz", + "integrity": "sha512-PYs3OiYgENFYEmI3vOEm5nrp3eY90YZqd5vGmQqeXmhJsAWFIrFdROCvOasqJ1HgeTvqyYo9IGXnFDyoboNcgQ==", + "dev": true, + "requires": { + "acorn": "^5.2.1", + "estree-walker": "^0.5.0", + "magic-string": "^0.22.4", + "resolve": "^1.4.0", + "rollup-pluginutils": "^2.0.1" + }, + "dependencies": { + "acorn": { + "version": "5.7.4", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", + "dev": true + }, + "estree-walker": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", + "dev": true + } + } + }, + "rollup-plugin-license": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-license/-/rollup-plugin-license-0.6.0.tgz", + "integrity": "sha512-Ttz65oRtNKcfV5icDkQTixc8ja64ueoXejRJoAtmjXYAWVg0qx+tu5rXmEOXWXmUXeGs0ARUVIAG0p1JK0gACQ==", + "dev": true, + "requires": { + "commenting": "1.0.5", + "lodash": "4.17.5", + "magic-string": "0.22.4", + "mkdirp": "0.5.1", + "moment": "2.21.0" + }, + "dependencies": { + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==", + "dev": true + }, + "magic-string": { + "version": "0.22.4", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.4.tgz", + "integrity": "sha512-kxBL06p6iO2qPBHsqGK2b3cRwiRGpnmSuVWNhwHcMX7qJOUr1HvricYP1LZOCdkQBUp0jiWg2d6WJwR3vYgByw==", + "dev": true, + "requires": { + "vlq": "^0.2.1" } }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", - "dev": true - }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "dev": true }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" + "minimist": "0.0.8" } } } }, + "rollup-plugin-node-resolve": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.4.0.tgz", + "integrity": "sha512-PJcd85dxfSBWih84ozRtBkB731OjXk0KnzN0oGp7WOWcarAFkVa71cV5hTJg2qpVsV2U8EUwrzHP3tvy9vS3qg==", + "dev": true, + "requires": { + "builtin-modules": "^2.0.0", + "is-module": "^1.0.0", + "resolve": "^1.1.6" + } + }, + "rollup-pluginutils": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", + "dev": true, + "requires": { + "estree-walker": "^0.6.1" + } + }, "rxjs": { - "version": "5.5.10", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.10.tgz", - "integrity": "sha512-SRjimIDUHJkon+2hFo7xnvNC4ZEHGzCRwh9P7nzX3zPkCGFEg/tuElrNR7L/rZMagnK2JeH2jQwPRpmyXyLB6A==", + "version": "5.5.12", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.12.tgz", + "integrity": "sha512-xx2itnL5sBbqeeiVgNPVuQQ1nC8Jp2WfNJhXWHmElW9YmrpS9UVnNzhP3EH3HFqexO5Tlp8GhYY+WEcqcVMvGw==", "dev": true, "requires": { "symbol-observable": "1.0.1" @@ -4289,6 +3980,12 @@ "ret": "~0.1.10" } }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, "sander": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/sander/-/sander-0.5.1.tgz", @@ -4302,21 +3999,21 @@ } }, "sass-graph": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.4.tgz", - "integrity": "sha1-E/vWPNHK8JCLn9k0dq1DpR0eC0k=", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-2.2.5.tgz", + "integrity": "sha512-VFWDAHOe6mRuT4mZRd4eKE+d8Uedrk6Xnh7Sh9b4NGufQLQjOrvf/MQoOdx+0s92L89FeyUUNfU597j/3uNpag==", "dev": true, "requires": { "glob": "^7.0.0", "lodash": "^4.0.0", "scss-tokenizer": "^0.2.3", - "yargs": "^7.0.0" + "yargs": "^13.3.2" } }, "sax": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/sax/-/sax-0.5.8.tgz", - "integrity": "sha1-1HLbIo6zMcJQaw6MFVJK25OdEsE=", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", "dev": true }, "scss-tokenizer": { @@ -4341,9 +4038,9 @@ } }, "semver": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", - "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "semver-diff": { @@ -4361,16 +4058,10 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, "set-value": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", - "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", "dev": true, "requires": { "extend-shallow": "^2.0.1", @@ -4406,21 +4097,15 @@ "dev": true }, "shell-quote": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.6.1.tgz", - "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", - "dev": true, - "requires": { - "array-filter": "~0.0.0", - "array-map": "~0.0.0", - "array-reduce": "~0.0.0", - "jsonify": "~0.0.0" - } + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.2.tgz", + "integrity": "sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==", + "dev": true }, "signal-exit": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "snapdragon": { @@ -4456,12 +4141,6 @@ "requires": { "is-extendable": "^0.1.0" } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true } } }, @@ -4521,9 +4200,9 @@ "dev": true }, "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true } } @@ -4542,6 +4221,7 @@ "resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", "integrity": "sha1-ZUEYTMkK7qbG57NeJlkIJEPGYZg=", "dev": true, + "optional": true, "requires": { "hoek": "2.x.x" } @@ -4559,18 +4239,18 @@ } }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, "source-map-resolve": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.1.tgz", - "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", "dev": true, "requires": { - "atob": "^2.0.0", + "atob": "^2.1.2", "decode-uri-component": "^0.2.0", "resolve-url": "^0.2.1", "source-map-url": "^0.4.0", @@ -4578,13 +4258,21 @@ } }, "source-map-support": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.5.tgz", - "integrity": "sha512-mR7/Nd5l1z6g99010shcXJiNEaf3fEtmLhRB/sBcQVJGodcHCULPp2y4Sfa43Kv2zq7T+Izmfp/WHCR6dYkQCA==", + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "source-map-url": { @@ -4594,15 +4282,15 @@ "dev": true }, "sourcemap-codec": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz", - "integrity": "sha512-hX1eNBNuilj8yfFnECh0DzLgwKpBLMIvmhgEhixXNui8lMLBInTI8Kyxt++RwJnMNu7cAUo635L2+N1TxMJCzA==", + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, "spdx-correct": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz", - "integrity": "sha512-N19o9z5cEyc8yQQPukRCZ9EUmb4HUpnrmaL/fxS2pBo2jbfcFRVuFZ/oFC+vZz0MNNk0h80iMn5/S6qGZOL5+g==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -4610,15 +4298,15 @@ } }, "spdx-exceptions": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.1.0.tgz", - "integrity": "sha512-4K1NsmrlCU1JJgUrtgEeTVyfx8VaYea9J9LvARxhbHtVtohPs/gFGG5yy49beySjlIMhhXZ4QqujIZEfS4l6Cg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -4626,9 +4314,9 @@ } }, "spdx-license-ids": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.0.tgz", - "integrity": "sha512-2+EPwgbnmOIl8HjGBXXMd9NAu02vLjOO1nWw4kmeRDFyHn+M/ETfHxQUK0oXg8ctgVnl9t3rosNVsZ1jG61nDA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "split-string": { @@ -4641,9 +4329,9 @@ } }, "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -4653,6 +4341,7 @@ "ecc-jsbn": "~0.1.1", "getpass": "^0.1.1", "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" }, "dependencies": { @@ -4686,9 +4375,9 @@ } }, "stdout-stream": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.0.tgz", - "integrity": "sha1-osfIWH5U2UJ+qe2zrD8s1SLfN4s=", + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/stdout-stream/-/stdout-stream-1.4.1.tgz", + "integrity": "sha512-j4emi03KXqJWcIeF8eIXkjMFN1Cmb8gUlDYGeBALLPo5qdyTfA9bOtl8m33lRoC+vFMkP3gl0WsDr6+gzxbbTA==", "dev": true, "requires": { "readable-stream": "^2.0.1" @@ -4715,10 +4404,11 @@ } }, "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=", - "dev": true + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.6.tgz", + "integrity": "sha512-87GEBAkegbBcweToUrdzf3eLhWNg06FJTebl4BVJz/JgWy8CvEr9dRtX5qWphiynMSQlxxi+QqN0z5T32SLlhA==", + "dev": true, + "optional": true }, "strip-ansi": { "version": "3.0.1", @@ -4757,41 +4447,47 @@ "dev": true }, "stylus": { - "version": "0.54.5", - "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.5.tgz", - "integrity": "sha1-QrlWCTHKcJDOhRWnmLqeaqPW3Hk=", - "dev": true, - "requires": { - "css-parse": "1.7.x", - "debug": "*", - "glob": "7.0.x", - "mkdirp": "0.5.x", - "sax": "0.5.x", - "source-map": "0.1.x" + "version": "0.54.8", + "resolved": "https://registry.npmjs.org/stylus/-/stylus-0.54.8.tgz", + "integrity": "sha512-vr54Or4BZ7pJafo2mpf0ZcwA74rpuYCZbxrHBsH8kbcXOwSfvBFwsRfpGO5OD5fhG5HDCFW737PKaawI7OqEAg==", + "dev": true, + "requires": { + "css-parse": "~2.0.0", + "debug": "~3.1.0", + "glob": "^7.1.6", + "mkdirp": "~1.0.4", + "safer-buffer": "^2.1.2", + "sax": "~1.2.4", + "semver": "^6.3.0", + "source-map": "^0.7.3" }, "dependencies": { - "glob": { - "version": "7.0.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", - "integrity": "sha1-IRuvr0nlJbjNkyYNFKsTYVKz9Xo=", + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "ms": "2.0.0" } }, + "mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true + }, + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + }, "source-map": { - "version": "0.1.43", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz", - "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true } } }, @@ -4805,9 +4501,9 @@ } }, "supports-color": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -4820,24 +4516,24 @@ "dev": true }, "tar": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.2.tgz", - "integrity": "sha512-BfkE9CciGGgDsATqkikUHrQrraBCO+ke/1f6SFAEMnxyyfN9lxC+nW1NFWMpqH865DhHIy9vQi682gk1X7friw==", + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", "dev": true, "requires": { - "chownr": "^1.0.1", + "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.2.4", - "minizlib": "^1.1.0", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" }, "dependencies": { "yallist": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.2.tgz", - "integrity": "sha1-hFK0u36Dx8GI2AQcGoN8dz1ti7k=", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "dev": true } } @@ -4899,17 +4595,12 @@ } } }, - "tosource": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/tosource/-/tosource-1.0.0.tgz", - "integrity": "sha1-QtiN0RZhi88A1hBt1URvNCeQL/E=", - "dev": true - }, "tough-cookie": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", "dev": true, + "optional": true, "requires": { "punycode": "^1.4.1" } @@ -4921,27 +4612,12 @@ "dev": true }, "true-case-path": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.2.tgz", - "integrity": "sha1-fskRMJJHZsf1c74wIMNPj9/QDWI=", + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/true-case-path/-/true-case-path-1.0.3.tgz", + "integrity": "sha512-m6s2OdQe5wgpFMC+pAJ+q9djG82O2jcHPOI6RNg1yy9rCYR+WD6Nbpl32fDpfC56nirdRy+opFa/Vk7HYhqaew==", "dev": true, "requires": { - "glob": "^6.0.4" - }, - "dependencies": { - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", - "dev": true, - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - } + "glob": "^7.1.2" } }, "tsickle": { @@ -4954,12 +4630,20 @@ "mkdirp": "^0.5.1", "source-map": "^0.6.0", "source-map-support": "^0.5.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "tslib": { - "version": "1.9.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", - "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", "dev": true }, "tunnel-agent": { @@ -4975,8 +4659,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "dev": true }, "typescript": { "version": "2.7.2", @@ -4985,48 +4668,21 @@ "dev": true }, "uglify-js": { - "version": "3.3.24", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.3.24.tgz", - "integrity": "sha512-hS7+TDiqIqvWScCcKRybCQzmMnEzJ4ryl9ErRmW4GFyG48p0/dKZiy/5mVLbsFzU8CCnCgQdxMiJzZythvLzCg==", - "dev": true, - "requires": { - "commander": "~2.15.0", - "source-map": "~0.6.1" - } + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", + "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==", + "dev": true }, "union-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", - "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", "dev": true, "requires": { "arr-union": "^3.1.0", "get-value": "^2.0.6", "is-extendable": "^0.1.1", - "set-value": "^0.4.3" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "dev": true, - "requires": { - "is-extendable": "^0.1.0" - } - }, - "set-value": { - "version": "0.4.3", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", - "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", - "dev": true, - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.1", - "to-object-path": "^0.3.0" - } - } + "set-value": "^2.0.1" } }, "unique-string": { @@ -5039,9 +4695,9 @@ } }, "universalify": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", - "integrity": "sha1-+nG63UQ3r0wUiEHjs7Fl+enlkLc=", + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, "unset-value": { @@ -5114,6 +4770,23 @@ "xdg-basedir": "^3.0.0" } }, + "uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + }, + "dependencies": { + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true + } + } + }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", @@ -5130,21 +4803,10 @@ } }, "use": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", - "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", - "dev": true, - "requires": { - "kind-of": "^6.0.2" - }, - "dependencies": { - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==", - "dev": true - } - } + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true }, "util-deprecate": { "version": "1.0.2", @@ -5153,15 +4815,15 @@ "dev": true }, "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "validate-npm-package-license": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.3.tgz", - "integrity": "sha512-63ZOUnL4SIXj4L0NixR3L1lcjO38crAbgrTpl28t8jjrfuiOBL5Iygm+60qPs/KsZGzPNg6Smnc/oY16QTjF0g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -5194,33 +4856,33 @@ "dev": true }, "which": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.0.tgz", - "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" } }, "which-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-1.0.0.tgz", - "integrity": "sha1-u6Y8qGGUiZT/MHc2CJ47lgJsKk8=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, "wide-align": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.2.tgz", - "integrity": "sha512-ijDLlyQ7s6x1JgCLur53osjm/UXUYD9+0PbYKrBsYisYXzCxN+HC3mYDNy/dWdmf3AwqwU3CXwDCvsNgGK1S0w==", + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", "dev": true, "requires": { - "string-width": "^1.0.2" + "string-width": "^1.0.2 || 2" } }, "widest-line": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.0.tgz", - "integrity": "sha1-AUKk6KJD+IgsAjOqDgKBqnYVInM=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", "dev": true, "requires": { "string-width": "^2.1.1" @@ -5260,13 +4922,48 @@ } }, "wrap-ansi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "dev": true, "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1" + "ansi-styles": "^3.2.0", + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "wrappy": { @@ -5276,9 +4973,9 @@ "dev": true }, "write-file-atomic": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.3.0.tgz", - "integrity": "sha512-xuPeK4OdjWqtfi59ylvVL0Yn35SF3zgcAcv7rBPFHVaEapaDr4GdGgm3j7ckTwH9wHL7fGmgfAnb0+THrHb8tA==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", "dev": true, "requires": { "graceful-fs": "^4.1.11", @@ -5292,12 +4989,6 @@ "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", "dev": true }, - "xtend": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", - "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=", - "dev": true - }, "xxhashjs": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/xxhashjs/-/xxhashjs-0.2.2.tgz", @@ -5308,9 +4999,9 @@ } }, "y18n": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", - "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yallist": { @@ -5320,57 +5011,80 @@ "dev": true }, "yargs": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-7.1.0.tgz", - "integrity": "sha1-a6MY6xaWFyf10oT46gA+jWFU0Mg=", + "version": "13.3.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.3.2.tgz", + "integrity": "sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==", "dev": true, "requires": { - "camelcase": "^3.0.0", - "cliui": "^3.2.0", - "decamelize": "^1.1.1", - "get-caller-file": "^1.0.1", - "os-locale": "^1.4.0", - "read-pkg-up": "^1.0.1", + "cliui": "^5.0.0", + "find-up": "^3.0.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^2.0.0", "set-blocking": "^2.0.0", - "string-width": "^1.0.2", - "which-module": "^1.0.0", - "y18n": "^3.2.1", - "yargs-parser": "^5.0.0" + "string-width": "^3.0.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^13.1.2" }, "dependencies": { - "camelcase": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "find-up": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, - "read-pkg-up": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-1.0.1.tgz", - "integrity": "sha1-nWPBMnbAZZGNV/ACpX9AobZD+wI=", + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { - "find-up": "^1.0.0", - "read-pkg": "^1.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" } } } }, "yargs-parser": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-5.0.0.tgz", - "integrity": "sha1-J17PDX/+Bcd+ZOfIbkzZS/DhIoo=", + "version": "13.1.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.2.tgz", + "integrity": "sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==", "dev": true, "requires": { - "camelcase": "^3.0.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" }, "dependencies": { "camelcase": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-3.0.0.tgz", - "integrity": "sha1-MvxLn82vhF/N9+c7uXysImHwqwo=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true } } diff --git a/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v5/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v5/with-interfaces/api/pet.service.ts b/samples/client/petstore/typescript-angular-v5/with-interfaces/api/pet.service.ts index a922b13249f..669f4120c21 100644 --- a/samples/client/petstore/typescript-angular-v5/with-interfaces/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v5/with-interfaces/api/pet.service.ts @@ -29,7 +29,7 @@ import { PetServiceInterface } from './pet.serviceInt @Injectable() export class PetService implements PetServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -301,7 +301,7 @@ export class PetService implements PetServiceInterface { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } @@ -433,7 +433,7 @@ export class PetService implements PetServiceInterface { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -506,7 +506,7 @@ export class PetService implements PetServiceInterface { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v5/with-interfaces/api/store.service.ts b/samples/client/petstore/typescript-angular-v5/with-interfaces/api/store.service.ts index 271fabb7ba8..a73f0a1beb6 100644 --- a/samples/client/petstore/typescript-angular-v5/with-interfaces/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v5/with-interfaces/api/store.service.ts @@ -28,7 +28,7 @@ import { StoreServiceInterface } from './store.servic @Injectable() export class StoreService implements StoreServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -113,7 +113,7 @@ export class StoreService implements StoreServiceInterface { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v5/with-interfaces/api/user.service.ts b/samples/client/petstore/typescript-angular-v5/with-interfaces/api/user.service.ts index 491402e119a..068a351a34d 100644 --- a/samples/client/petstore/typescript-angular-v5/with-interfaces/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v5/with-interfaces/api/user.service.ts @@ -28,7 +28,7 @@ import { UserServiceInterface } from './user.serviceI @Injectable() export class UserService implements UserServiceInterface { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-angular-v6/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts b/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts index d6c8e0a54a7..fe9986da63e 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts +++ b/samples/client/petstore/typescript-angular-v6/npm/api/pet.service.ts @@ -28,7 +28,7 @@ import { Configuration } from '../configurat @Injectable() export class PetService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -300,7 +300,7 @@ export class PetService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } @@ -432,7 +432,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; if (useForm) { @@ -505,7 +505,7 @@ export class PetService { const canConsumeForm = this.canConsumeForm(consumes); - let formParams: { append(param: string, value: any): void; }; + let formParams: { append(param: string, value: any): void | HttpParams; }; let useForm = false; let convertFormParamsToString = false; // use FormData to transmit files using content-type "multipart/form-data" diff --git a/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts b/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts index 4646f5723d3..7696b040d2b 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts +++ b/samples/client/petstore/typescript-angular-v6/npm/api/store.service.ts @@ -27,7 +27,7 @@ import { Configuration } from '../configurat @Injectable() export class StoreService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); @@ -112,7 +112,7 @@ export class StoreService { let headers = this.defaultHeaders; // authentication (api_key) required - if (this.configuration.apiKeys["api_key"]) { + if (this.configuration.apiKeys && this.configuration.apiKeys["api_key"]) { headers = headers.set('api_key', this.configuration.apiKeys["api_key"]); } diff --git a/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts b/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts index f80c6132ef8..52403dbc27b 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts +++ b/samples/client/petstore/typescript-angular-v6/npm/api/user.service.ts @@ -27,7 +27,7 @@ import { Configuration } from '../configurat @Injectable() export class UserService { - protected basePath = 'http://petstore.swagger.io/v2'; + protected basePath = 'https://petstore.swagger.io/v2'; public defaultHeaders = new HttpHeaders(); public configuration = new Configuration(); diff --git a/samples/client/petstore/typescript-angular-v6/npm/package-lock.json b/samples/client/petstore/typescript-angular-v6/npm/package-lock.json index 33f26766332..9458a4cb60f 100644 --- a/samples/client/petstore/typescript-angular-v6/npm/package-lock.json +++ b/samples/client/petstore/typescript-angular-v6/npm/package-lock.json @@ -235,7 +235,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "dev": true + "dev": true, + "optional": true }, "assign-symbols": { "version": "1.0.0", @@ -380,6 +381,16 @@ "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", "dev": true }, + "bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "dev": true, + "optional": true, + "requires": { + "file-uri-to-path": "1.0.0" + } + }, "boxen": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/boxen/-/boxen-3.2.0.tgz", @@ -655,6 +666,7 @@ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, + "optional": true, "requires": { "delayed-stream": "~1.0.0" } @@ -835,7 +847,8 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "dev": true + "dev": true, + "optional": true }, "diff": { "version": "3.5.0", @@ -1001,7 +1014,8 @@ "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "dev": true + "dev": true, + "optional": true }, "fast-deep-equal": { "version": "2.0.1", @@ -1017,6 +1031,13 @@ "dev": true, "optional": true }, + "file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "dev": true, + "optional": true + }, "filename-regex": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/filename-regex/-/filename-regex-2.0.1.tgz", @@ -1112,532 +1133,14 @@ "dev": true }, "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz", + "integrity": "sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==", "dev": true, "optional": true, "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "dev": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "dev": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "dev": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "dev": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "dev": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "dev": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "dev": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "dev": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "dev": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "dev": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "dev": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "dev": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "dev": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "dev": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "dev": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "dev": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "dev": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "dev": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "dev": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "dev": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "dev": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "dev": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } + "bindings": "^1.5.0", + "nan": "^2.12.1" } }, "get-stream": { @@ -2166,7 +1669,8 @@ "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true + "dev": true, + "optional": true }, "json-buffer": { "version": "3.0.0", @@ -2400,13 +1904,15 @@ "version": "1.40.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", - "dev": true + "dev": true, + "optional": true }, "mime-types": { "version": "2.1.24", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, + "optional": true, "requires": { "mime-db": "1.40.0" } @@ -2477,9 +1983,9 @@ "dev": true }, "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "version": "2.14.1", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.1.tgz", + "integrity": "sha512-isWHgVjnFjh2x2yuJ/tj3JbwoHu3UC2dX5G/88Cm24yB6YopVgxvBObDY7n5xW6ExmFhJpSEQqFPvq9zaXc8Jw==", "dev": true, "optional": true }, @@ -2608,9 +2114,9 @@ } }, "fsevents": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz", - "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "dev": true, "optional": true }, @@ -3709,7 +3215,8 @@ "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", - "dev": true + "dev": true, + "optional": true }, "sass": { "version": "1.22.5", @@ -3771,9 +3278,9 @@ } }, "fsevents": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.0.7.tgz", - "integrity": "sha512-a7YT0SV3RB+DjYcppwVDLtn13UQnmg0SWZS7ezZD0UjnLwXmy8Zm21GMVGLaFGimIqcvyMQaOJBrop8MyOp1kQ==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "dev": true, "optional": true }, @@ -4370,7 +3877,8 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true + "dev": true, + "optional": true }, "type-fest": { "version": "0.6.0", diff --git a/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/default/api.ts b/samples/client/petstore/typescript-fetch/builds/default/api.ts index 9d538e2147b..263c89d41d8 100644 --- a/samples/client/petstore/typescript-fetch/builds/default/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/default/api.ts @@ -17,7 +17,7 @@ import * as url from "url"; import * as portableFetch from "portable-fetch"; import { Configuration } from "./configuration"; -const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); +const BASE_PATH = "https://petstore.swagger.io/v2".replace(/\/+$/, ""); /** * @@ -40,7 +40,7 @@ export interface FetchAPI { } /** - * + * * @export * @interface FetchArgs */ @@ -50,7 +50,7 @@ export interface FetchArgs { } /** - * + * * @export * @class BaseAPI */ @@ -66,7 +66,7 @@ export class BaseAPI { }; /** - * + * * @export * @class RequiredError * @extends {Error} diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts index 9d538e2147b..263c89d41d8 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/api.ts @@ -17,7 +17,7 @@ import * as url from "url"; import * as portableFetch from "portable-fetch"; import { Configuration } from "./configuration"; -const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); +const BASE_PATH = "https://petstore.swagger.io/v2".replace(/\/+$/, ""); /** * @@ -40,7 +40,7 @@ export interface FetchAPI { } /** - * + * * @export * @interface FetchArgs */ @@ -50,7 +50,7 @@ export interface FetchArgs { } /** - * + * * @export * @class BaseAPI */ @@ -66,7 +66,7 @@ export class BaseAPI { }; /** - * + * * @export * @class RequiredError * @extends {Error} diff --git a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json index 3bf9e42bcf6..240874eb2bc 100644 --- a/samples/client/petstore/typescript-fetch/builds/es6-target/package.json +++ b/samples/client/petstore/typescript-fetch/builds/es6-target/package.json @@ -12,7 +12,7 @@ "license": "Unlicense", "main": "./dist/index.js", "typings": "./dist/index.d.ts", - "scripts": { + "scripts" : { "build": "tsc --outDir dist/", "prepublishOnly": "npm run build" }, @@ -21,9 +21,9 @@ }, "devDependencies": { "@types/node": "^8.0.9", - "typescript": "^2.0" + "typescript": "^4.0.3" }, - "publishConfig": { - "registry": "https://skimdb.npmjs.com/registry" + "publishConfig":{ + "registry":"https://skimdb.npmjs.com/registry" } } diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-interfaces/api.ts b/samples/client/petstore/typescript-fetch/builds/with-interfaces/api.ts index ad84d145d3f..47c17a14250 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-interfaces/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-interfaces/api.ts @@ -17,7 +17,7 @@ import * as url from "url"; import * as portableFetch from "portable-fetch"; import { Configuration } from "./configuration"; -const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); +const BASE_PATH = "https://petstore.swagger.io/v2".replace(/\/+$/, ""); /** * @@ -40,7 +40,7 @@ export interface FetchAPI { } /** - * + * * @export * @interface FetchArgs */ @@ -50,7 +50,7 @@ export interface FetchArgs { } /** - * + * * @export * @class BaseAPI */ @@ -66,7 +66,7 @@ export class BaseAPI { }; /** - * + * * @export * @class RequiredError * @extends {Error} diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts index 9d538e2147b..263c89d41d8 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/api.ts @@ -17,7 +17,7 @@ import * as url from "url"; import * as portableFetch from "portable-fetch"; import { Configuration } from "./configuration"; -const BASE_PATH = "http://petstore.swagger.io/v2".replace(/\/+$/, ""); +const BASE_PATH = "https://petstore.swagger.io/v2".replace(/\/+$/, ""); /** * @@ -40,7 +40,7 @@ export interface FetchAPI { } /** - * + * * @export * @interface FetchArgs */ @@ -50,7 +50,7 @@ export interface FetchArgs { } /** - * + * * @export * @class BaseAPI */ @@ -66,7 +66,7 @@ export class BaseAPI { }; /** - * + * * @export * @class RequiredError * @extends {Error} diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json index 9e1c7628b36..240874eb2bc 100644 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json +++ b/samples/client/petstore/typescript-fetch/builds/with-npm-version/package.json @@ -21,7 +21,7 @@ }, "devDependencies": { "@types/node": "^8.0.9", - "typescript": "^2.0" + "typescript": "^4.0.3" }, "publishConfig":{ "registry":"https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/typescript-fetch/builds/with-npm-version/yarn.lock b/samples/client/petstore/typescript-fetch/builds/with-npm-version/yarn.lock deleted file mode 100644 index 097b098c676..00000000000 --- a/samples/client/petstore/typescript-fetch/builds/with-npm-version/yarn.lock +++ /dev/null @@ -1,47 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/isomorphic-fetch@0.0.34": - version "0.0.34" - resolved "https://registry.yarnpkg.com/@types/isomorphic-fetch/-/isomorphic-fetch-0.0.34.tgz#3c3483e606c041378438e951464f00e4e60706d6" - -"@types/node@^8.0.9": - version "8.0.17" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.17.tgz#677bc8c118cfb76013febb62ede1f31d2c7222a1" - -encoding@^0.1.11: - version "0.1.12" - resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.12.tgz#538b66f3ee62cd1ab51ec323829d1f9480c74beb" - dependencies: - iconv-lite "~0.4.13" - -iconv-lite@~0.4.13: - version "0.4.18" - resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.18.tgz#23d8656b16aae6742ac29732ea8f0336a4789cf2" - -is-stream@^1.0.1: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -isomorphic-fetch@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-2.2.1.tgz#611ae1acf14f5e81f729507472819fe9733558a9" - dependencies: - node-fetch "^1.0.1" - whatwg-fetch ">=0.10.0" - -node-fetch@^1.0.1: - version "1.7.1" - resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-1.7.1.tgz#899cb3d0a3c92f952c47f1b876f4c8aeabd400d5" - dependencies: - encoding "^0.1.11" - is-stream "^1.0.1" - -typescript@^2.0: - version "2.4.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.4.2.tgz#f8395f85d459276067c988aa41837a8f82870844" - -whatwg-fetch@>=0.10.0: - version "2.0.3" - resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-2.0.3.tgz#9c84ec2dcf68187ff00bc64e1274b442176e1c84" diff --git a/samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts b/samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts index 8c89846d007..99db74e9a2e 100644 --- a/samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts +++ b/samples/client/petstore/typescript-fetch/tests/default/test/PetApi.ts @@ -11,7 +11,9 @@ describe('PetApi', () => { const fixture: Pet = createTestFixture(); beforeEach(() => { - api = new PetApi(); + api = new PetApi({ + basePath:'https://petstore.swagger.io/v2' + }); }); it('should add and delete Pet', () => { diff --git a/samples/client/petstore/typescript-inversify/.swagger-codegen/VERSION b/samples/client/petstore/typescript-inversify/.swagger-codegen/VERSION index 855ff9501eb..52f864c9d49 100644 --- a/samples/client/petstore/typescript-inversify/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-inversify/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.0-SNAPSHOT \ No newline at end of file +2.4.10-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-inversify/api/pet.service.ts b/samples/client/petstore/typescript-inversify/api/pet.service.ts index b52d0f56cf8..b3535d661d7 100644 --- a/samples/client/petstore/typescript-inversify/api/pet.service.ts +++ b/samples/client/petstore/typescript-inversify/api/pet.service.ts @@ -11,14 +11,14 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/toPromise'; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; import { ApiResponse } from '../model/apiResponse'; import { Pet } from '../model/pet'; @@ -29,13 +29,10 @@ import { COLLECTION_FORMATS } from '../variables'; @injectable() export class PetService { - private basePath: string = 'http://petstore.swagger.io/v2'; + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration; + @inject('IApiHttpClient') private httpClient: IHttpClient; + - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { - if(this.APIConfiguration.basePath) - this.basePath = this.APIConfiguration.basePath; - } /** * Add a new pet to the store @@ -60,9 +57,9 @@ export class PetService { headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/pet`, body , headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.post(`${this.APIConfiguration.basePath}/pet`, body as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -95,9 +92,9 @@ export class PetService { } headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.delete(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.delete(`${this.APIConfiguration.basePath}/pet/${encodeURIComponent(String(petId))}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -118,7 +115,7 @@ export class PetService { let queryParameters: string[] = []; if (status) { - queryParameters.push("status="+encodeURIComponent(status.join(COLLECTION_FORMATS['csv']))); + queryParameters.push('status='+encodeURIComponent(status.join(COLLECTION_FORMATS['csv']))); } // authentication (petstore_auth) required @@ -130,9 +127,9 @@ export class PetService { } headers['Accept'] = 'application/xml'; - const response: Observable>> = this.httpClient.get(`${this.basePath}/pet/findByStatus?${queryParameters.join('&')}`, headers); - if (observe == 'body') { - return response.map(httpResponse => >(httpResponse.response)); + const response: Observable>> = this.httpClient.get(`${this.APIConfiguration.basePath}/pet/findByStatus?${queryParameters.join('&')}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -153,7 +150,7 @@ export class PetService { let queryParameters: string[] = []; if (tags) { - queryParameters.push("tags="+encodeURIComponent(tags.join(COLLECTION_FORMATS['csv']))); + queryParameters.push('tags='+encodeURIComponent(tags.join(COLLECTION_FORMATS['csv']))); } // authentication (petstore_auth) required @@ -165,9 +162,9 @@ export class PetService { } headers['Accept'] = 'application/xml'; - const response: Observable>> = this.httpClient.get(`${this.basePath}/pet/findByTags?${queryParameters.join('&')}`, headers); - if (observe == 'body') { - return response.map(httpResponse => >(httpResponse.response)); + const response: Observable>> = this.httpClient.get(`${this.APIConfiguration.basePath}/pet/findByTags?${queryParameters.join('&')}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -187,14 +184,14 @@ export class PetService { } // authentication (api_key) required - if (this.APIConfiguration.apiKeys["api_key"]) { - headers['api_key'] = this.APIConfiguration.apiKeys["api_key"]; + if (this.APIConfiguration.apiKeys['api_key']) { + headers['api_key'] = this.APIConfiguration.apiKeys['api_key']; } headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.get(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.get(`${this.APIConfiguration.basePath}/pet/${encodeURIComponent(String(petId))}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -223,9 +220,9 @@ export class PetService { headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.put(`${this.basePath}/pet`, body , headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.put(`${this.APIConfiguration.basePath}/pet`, body as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -264,9 +261,9 @@ export class PetService { formData.append('status', status); } - const response: Observable> = this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}`, body, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.post(`${this.APIConfiguration.basePath}/pet/${encodeURIComponent(String(petId))}` as any, body, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -305,9 +302,9 @@ export class PetService { formData.append('file', file); } - const response: Observable> = this.httpClient.post(`${this.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage`, body, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.post(`${this.APIConfiguration.basePath}/pet/${encodeURIComponent(String(petId))}/uploadImage` as any, body, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } diff --git a/samples/client/petstore/typescript-inversify/api/store.service.ts b/samples/client/petstore/typescript-inversify/api/store.service.ts index 0185d32f2af..75f94d111f6 100644 --- a/samples/client/petstore/typescript-inversify/api/store.service.ts +++ b/samples/client/petstore/typescript-inversify/api/store.service.ts @@ -11,14 +11,14 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/toPromise'; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; import { Order } from '../model/order'; @@ -28,13 +28,10 @@ import { COLLECTION_FORMATS } from '../variables'; @injectable() export class StoreService { - private basePath: string = 'http://petstore.swagger.io/v2'; + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration; + @inject('IApiHttpClient') private httpClient: IHttpClient; + - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { - if(this.APIConfiguration.basePath) - this.basePath = this.APIConfiguration.basePath; - } /** * Delete purchase order by ID @@ -51,9 +48,9 @@ export class StoreService { headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.delete(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.delete(`${this.APIConfiguration.basePath}/store/order/${encodeURIComponent(String(orderId))}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -68,14 +65,14 @@ export class StoreService { public getInventory(observe?: 'response', headers?: Headers): Observable>; public getInventory(observe: any = 'body', headers: Headers = {}): Observable { // authentication (api_key) required - if (this.APIConfiguration.apiKeys["api_key"]) { - headers['api_key'] = this.APIConfiguration.apiKeys["api_key"]; + if (this.APIConfiguration.apiKeys['api_key']) { + headers['api_key'] = this.APIConfiguration.apiKeys['api_key']; } headers['Accept'] = 'application/json'; - const response: Observable> = this.httpClient.get(`${this.basePath}/store/inventory`, headers); - if (observe == 'body') { - return response.map(httpResponse => <{ [key: string]: number; }>(httpResponse.response)); + const response: Observable> = this.httpClient.get(`${this.APIConfiguration.basePath}/store/inventory` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -96,9 +93,9 @@ export class StoreService { headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.get(`${this.basePath}/store/order/${encodeURIComponent(String(orderId))}`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.get(`${this.APIConfiguration.basePath}/store/order/${encodeURIComponent(String(orderId))}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -120,9 +117,9 @@ export class StoreService { headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/store/order`, body , headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.post(`${this.APIConfiguration.basePath}/store/order`, body as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } diff --git a/samples/client/petstore/typescript-inversify/api/user.service.ts b/samples/client/petstore/typescript-inversify/api/user.service.ts index 3a794603bf8..e19e5df5cbc 100644 --- a/samples/client/petstore/typescript-inversify/api/user.service.ts +++ b/samples/client/petstore/typescript-inversify/api/user.service.ts @@ -11,14 +11,14 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Observable } from "rxjs/Observable"; +import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/toPromise'; -import IHttpClient from "../IHttpClient"; -import { inject, injectable } from "inversify"; -import { IAPIConfiguration } from "../IAPIConfiguration"; -import { Headers } from "../Headers"; -import HttpResponse from "../HttpResponse"; +import IHttpClient from '../IHttpClient'; +import { inject, injectable } from 'inversify'; +import { IAPIConfiguration } from '../IAPIConfiguration'; +import { Headers } from '../Headers'; +import HttpResponse from '../HttpResponse'; import { User } from '../model/user'; @@ -28,13 +28,10 @@ import { COLLECTION_FORMATS } from '../variables'; @injectable() export class UserService { - private basePath: string = 'http://petstore.swagger.io/v2'; + @inject('IAPIConfiguration') private APIConfiguration: IAPIConfiguration; + @inject('IApiHttpClient') private httpClient: IHttpClient; + - constructor(@inject("IApiHttpClient") private httpClient: IHttpClient, - @inject("IAPIConfiguration") private APIConfiguration: IAPIConfiguration ) { - if(this.APIConfiguration.basePath) - this.basePath = this.APIConfiguration.basePath; - } /** * Create user @@ -52,9 +49,9 @@ export class UserService { headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user`, body , headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.post(`${this.APIConfiguration.basePath}/user`, body as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -76,9 +73,9 @@ export class UserService { headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithArray`, body , headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.post(`${this.APIConfiguration.basePath}/user/createWithArray`, body as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -100,9 +97,9 @@ export class UserService { headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.post(`${this.basePath}/user/createWithList`, body , headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.post(`${this.APIConfiguration.basePath}/user/createWithList`, body as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -123,9 +120,9 @@ export class UserService { headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.delete(`${this.basePath}/user/${encodeURIComponent(String(username))}`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.delete(`${this.APIConfiguration.basePath}/user/${encodeURIComponent(String(username))}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -146,9 +143,9 @@ export class UserService { headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.get(`${this.basePath}/user/${encodeURIComponent(String(username))}`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.get(`${this.APIConfiguration.basePath}/user/${encodeURIComponent(String(username))}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -174,17 +171,17 @@ export class UserService { let queryParameters: string[] = []; if (username !== undefined) { - queryParameters.push("username="+encodeURIComponent(String(username))); + queryParameters.push('username='+encodeURIComponent(String(username))); } if (password !== undefined) { - queryParameters.push("password="+encodeURIComponent(String(password))); + queryParameters.push('password='+encodeURIComponent(String(password))); } headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.get(`${this.basePath}/user/login?${queryParameters.join('&')}`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.get(`${this.APIConfiguration.basePath}/user/login?${queryParameters.join('&')}` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -200,9 +197,9 @@ export class UserService { public logoutUser(observe: any = 'body', headers: Headers = {}): Observable { headers['Accept'] = 'application/xml'; - const response: Observable> = this.httpClient.get(`${this.basePath}/user/logout`, headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.get(`${this.APIConfiguration.basePath}/user/logout` as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } @@ -229,9 +226,9 @@ export class UserService { headers['Accept'] = 'application/xml'; headers['Content-Type'] = 'application/json'; - const response: Observable> = this.httpClient.put(`${this.basePath}/user/${encodeURIComponent(String(username))}`, body , headers); - if (observe == 'body') { - return response.map(httpResponse => (httpResponse.response)); + const response: Observable> = this.httpClient.put(`${this.APIConfiguration.basePath}/user/${encodeURIComponent(String(username))}`, body as any, headers); + if (observe === 'body') { + return response.map(httpResponse => httpResponse.response); } return response; } diff --git a/samples/client/petstore/typescript-node/npm/.swagger-codegen/VERSION b/samples/client/petstore/typescript-node/npm/.swagger-codegen/VERSION index 017674fb59d..91fb2f83cd4 100644 --- a/samples/client/petstore/typescript-node/npm/.swagger-codegen/VERSION +++ b/samples/client/petstore/typescript-node/npm/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.14-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/api.d.ts b/samples/client/petstore/typescript-node/npm/api.d.ts index 477f0605576..da11de067ba 100644 --- a/samples/client/petstore/typescript-node/npm/api.d.ts +++ b/samples/client/petstore/typescript-node/npm/api.d.ts @@ -193,35 +193,35 @@ export declare class PetApi { setDefaultAuthentication(auth: Authentication): void; setApiKey(key: PetApiApiKeys, value: string): void; accessToken: string; - addPet(body: Pet): Promise<{ + addPet(body: Pet, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - deletePet(petId: number, apiKey?: string): Promise<{ + deletePet(petId: number, apiKey?: string, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>): Promise<{ + findPetsByStatus(status: Array<'available' | 'pending' | 'sold'>, options?: any): Promise<{ response: http.ClientResponse; body: Array; }>; - findPetsByTags(tags: Array): Promise<{ + findPetsByTags(tags: Array, options?: any): Promise<{ response: http.ClientResponse; body: Array; }>; - getPetById(petId: number): Promise<{ + getPetById(petId: number, options?: any): Promise<{ response: http.ClientResponse; body: Pet; }>; - updatePet(body: Pet): Promise<{ + updatePet(body: Pet, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - updatePetWithForm(petId: number, name?: string, status?: string): Promise<{ + updatePetWithForm(petId: number, name?: string, status?: string, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - uploadFile(petId: number, additionalMetadata?: string, file?: Buffer): Promise<{ + uploadFile(petId: number, additionalMetadata?: string, file?: Buffer, options?: any): Promise<{ response: http.ClientResponse; body: ApiResponse; }>; @@ -244,21 +244,21 @@ export declare class StoreApi { setDefaultAuthentication(auth: Authentication): void; setApiKey(key: StoreApiApiKeys, value: string): void; accessToken: string; - deleteOrder(orderId: string): Promise<{ + deleteOrder(orderId: string, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - getInventory(): Promise<{ + getInventory(options?: any): Promise<{ response: http.ClientResponse; body: { [key: string]: number; }; }>; - getOrderById(orderId: number): Promise<{ + getOrderById(orderId: number, options?: any): Promise<{ response: http.ClientResponse; body: Order; }>; - placeOrder(body: Order): Promise<{ + placeOrder(body: Order, options?: any): Promise<{ response: http.ClientResponse; body: Order; }>; @@ -281,35 +281,35 @@ export declare class UserApi { setDefaultAuthentication(auth: Authentication): void; setApiKey(key: UserApiApiKeys, value: string): void; accessToken: string; - createUser(body: User): Promise<{ + createUser(body: User, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - createUsersWithArrayInput(body: Array): Promise<{ + createUsersWithArrayInput(body: Array, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - createUsersWithListInput(body: Array): Promise<{ + createUsersWithListInput(body: Array, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - deleteUser(username: string): Promise<{ + deleteUser(username: string, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - getUserByName(username: string): Promise<{ + getUserByName(username: string, options?: any): Promise<{ response: http.ClientResponse; body: User; }>; - loginUser(username: string, password: string): Promise<{ + loginUser(username: string, password: string, options?: any): Promise<{ response: http.ClientResponse; body: string; }>; - logoutUser(): Promise<{ + logoutUser(options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; - updateUser(username: string, body: User): Promise<{ + updateUser(username: string, body: User, options?: any): Promise<{ response: http.ClientResponse; body?: any; }>; diff --git a/samples/client/petstore/typescript-node/npm/api.js b/samples/client/petstore/typescript-node/npm/api.js index 70222c61ce8..6ba5fabdf7d 100644 --- a/samples/client/petstore/typescript-node/npm/api.js +++ b/samples/client/petstore/typescript-node/npm/api.js @@ -501,7 +501,8 @@ var PetApi = (function () { enumerable: true, configurable: true }); - PetApi.prototype.addPet = function (body) { + PetApi.prototype.addPet = function (body, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -509,6 +510,7 @@ var PetApi = (function () { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling addPet.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'POST', @@ -545,7 +547,8 @@ var PetApi = (function () { }); }); }; - PetApi.prototype.deletePet = function (petId, apiKey) { + PetApi.prototype.deletePet = function (petId, apiKey, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); var localVarQueryParameters = {}; @@ -555,6 +558,7 @@ var PetApi = (function () { throw new Error('Required parameter petId was null or undefined when calling deletePet.'); } localVarHeaderParams['api_key'] = ObjectSerializer.serialize(apiKey, "string"); + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'DELETE', @@ -590,7 +594,8 @@ var PetApi = (function () { }); }); }; - PetApi.prototype.findPetsByStatus = function (status) { + PetApi.prototype.findPetsByStatus = function (status, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet/findByStatus'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -601,6 +606,7 @@ var PetApi = (function () { if (status !== undefined) { localVarQueryParameters['status'] = ObjectSerializer.serialize(status, "Array<'available' | 'pending' | 'sold'>"); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -637,7 +643,8 @@ var PetApi = (function () { }); }); }; - PetApi.prototype.findPetsByTags = function (tags) { + PetApi.prototype.findPetsByTags = function (tags, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet/findByTags'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -648,6 +655,7 @@ var PetApi = (function () { if (tags !== undefined) { localVarQueryParameters['tags'] = ObjectSerializer.serialize(tags, "Array"); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -684,7 +692,8 @@ var PetApi = (function () { }); }); }; - PetApi.prototype.getPetById = function (petId) { + PetApi.prototype.getPetById = function (petId, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); var localVarQueryParameters = {}; @@ -693,6 +702,7 @@ var PetApi = (function () { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling getPetById.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -729,7 +739,8 @@ var PetApi = (function () { }); }); }; - PetApi.prototype.updatePet = function (body) { + PetApi.prototype.updatePet = function (body, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -737,6 +748,7 @@ var PetApi = (function () { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updatePet.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'PUT', @@ -773,7 +785,8 @@ var PetApi = (function () { }); }); }; - PetApi.prototype.updatePetWithForm = function (petId, name, status) { + PetApi.prototype.updatePetWithForm = function (petId, name, status, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet/{petId}' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); var localVarQueryParameters = {}; @@ -782,6 +795,7 @@ var PetApi = (function () { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling updatePetWithForm.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; if (name !== undefined) { localVarFormParams['name'] = ObjectSerializer.serialize(name, "string"); @@ -823,7 +837,8 @@ var PetApi = (function () { }); }); }; - PetApi.prototype.uploadFile = function (petId, additionalMetadata, file) { + PetApi.prototype.uploadFile = function (petId, additionalMetadata, file, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/pet/{petId}/uploadImage' .replace('{' + 'petId' + '}', encodeURIComponent(String(petId))); var localVarQueryParameters = {}; @@ -832,6 +847,7 @@ var PetApi = (function () { if (petId === null || petId === undefined) { throw new Error('Required parameter petId was null or undefined when calling uploadFile.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; if (additionalMetadata !== undefined) { localVarFormParams['additionalMetadata'] = ObjectSerializer.serialize(additionalMetadata, "string"); @@ -933,7 +949,8 @@ var StoreApi = (function () { enumerable: true, configurable: true }); - StoreApi.prototype.deleteOrder = function (orderId) { + StoreApi.prototype.deleteOrder = function (orderId, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/store/order/{orderId}' .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); var localVarQueryParameters = {}; @@ -942,6 +959,7 @@ var StoreApi = (function () { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling deleteOrder.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'DELETE', @@ -976,11 +994,13 @@ var StoreApi = (function () { }); }); }; - StoreApi.prototype.getInventory = function () { + StoreApi.prototype.getInventory = function (options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/store/inventory'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); var localVarFormParams = {}; + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -1017,7 +1037,8 @@ var StoreApi = (function () { }); }); }; - StoreApi.prototype.getOrderById = function (orderId) { + StoreApi.prototype.getOrderById = function (orderId, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/store/order/{orderId}' .replace('{' + 'orderId' + '}', encodeURIComponent(String(orderId))); var localVarQueryParameters = {}; @@ -1026,6 +1047,7 @@ var StoreApi = (function () { if (orderId === null || orderId === undefined) { throw new Error('Required parameter orderId was null or undefined when calling getOrderById.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -1061,7 +1083,8 @@ var StoreApi = (function () { }); }); }; - StoreApi.prototype.placeOrder = function (body) { + StoreApi.prototype.placeOrder = function (body, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/store/order'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -1069,6 +1092,7 @@ var StoreApi = (function () { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling placeOrder.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'POST', @@ -1163,7 +1187,8 @@ var UserApi = (function () { enumerable: true, configurable: true }); - UserApi.prototype.createUser = function (body) { + UserApi.prototype.createUser = function (body, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -1171,6 +1196,7 @@ var UserApi = (function () { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUser.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'POST', @@ -1206,7 +1232,8 @@ var UserApi = (function () { }); }); }; - UserApi.prototype.createUsersWithArrayInput = function (body) { + UserApi.prototype.createUsersWithArrayInput = function (body, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user/createWithArray'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -1214,6 +1241,7 @@ var UserApi = (function () { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithArrayInput.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'POST', @@ -1249,7 +1277,8 @@ var UserApi = (function () { }); }); }; - UserApi.prototype.createUsersWithListInput = function (body) { + UserApi.prototype.createUsersWithListInput = function (body, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user/createWithList'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -1257,6 +1286,7 @@ var UserApi = (function () { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling createUsersWithListInput.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'POST', @@ -1292,7 +1322,8 @@ var UserApi = (function () { }); }); }; - UserApi.prototype.deleteUser = function (username) { + UserApi.prototype.deleteUser = function (username, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); var localVarQueryParameters = {}; @@ -1301,6 +1332,7 @@ var UserApi = (function () { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling deleteUser.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'DELETE', @@ -1335,7 +1367,8 @@ var UserApi = (function () { }); }); }; - UserApi.prototype.getUserByName = function (username) { + UserApi.prototype.getUserByName = function (username, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); var localVarQueryParameters = {}; @@ -1344,6 +1377,7 @@ var UserApi = (function () { if (username === null || username === undefined) { throw new Error('Required parameter username was null or undefined when calling getUserByName.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -1379,7 +1413,8 @@ var UserApi = (function () { }); }); }; - UserApi.prototype.loginUser = function (username, password) { + UserApi.prototype.loginUser = function (username, password, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user/login'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); @@ -1396,6 +1431,7 @@ var UserApi = (function () { if (password !== undefined) { localVarQueryParameters['password'] = ObjectSerializer.serialize(password, "string"); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -1431,11 +1467,13 @@ var UserApi = (function () { }); }); }; - UserApi.prototype.logoutUser = function () { + UserApi.prototype.logoutUser = function (options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user/logout'; var localVarQueryParameters = {}; var localVarHeaderParams = Object.assign({}, this.defaultHeaders); var localVarFormParams = {}; + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'GET', @@ -1470,7 +1508,8 @@ var UserApi = (function () { }); }); }; - UserApi.prototype.updateUser = function (username, body) { + UserApi.prototype.updateUser = function (username, body, options) { + if (options === void 0) { options = {}; } var localVarPath = this.basePath + '/user/{username}' .replace('{' + 'username' + '}', encodeURIComponent(String(username))); var localVarQueryParameters = {}; @@ -1482,6 +1521,7 @@ var UserApi = (function () { if (body === null || body === undefined) { throw new Error('Required parameter body was null or undefined when calling updateUser.'); } + Object.assign(localVarHeaderParams, options.headers); var localVarUseFormData = false; var localVarRequestOptions = { method: 'PUT', diff --git a/samples/client/petstore/typescript-node/npm/api.js.map b/samples/client/petstore/typescript-node/npm/api.js.map index 46053169ad2..b7242f39952 100644 --- a/samples/client/petstore/typescript-node/npm/api.js.map +++ b/samples/client/petstore/typescript-node/npm/api.js.map @@ -1 +1 @@ -{"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;AAYA,yCAA4C;AAE5C,kCAAqC;AAErC,IAAI,eAAe,GAAG,+BAA+B,CAAC;AAOtD,IAAI,UAAU,GAAG;IACG,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;CACP,CAAC;AAEnB;IAAA;IAsGA,CAAC;IApGiB,gCAAe,GAA7B,UAA8B,IAAS,EAAE,YAAoB;QACzD,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,YAAY,CAAC;QACxB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/D,MAAM,CAAC,YAAY,CAAC;QACxB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,YAAY,CAAC;QACxB,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,CAAC,YAAY,CAAC;YACxB,CAAC;YAED,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,CAAC,YAAY,CAAC;YACxB,CAAC;YAGD,IAAI,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC;YAChE,EAAE,CAAC,CAAC,qBAAqB,IAAI,IAAI,CAAC,CAAC,CAAC;gBAChC,MAAM,CAAC,YAAY,CAAC;YACxB,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;oBAC9B,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBACvC,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,MAAM,CAAC,YAAY,CAAC;gBACxB,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEa,0BAAS,GAAvB,UAAwB,IAAS,EAAE,IAAY;QAC3C,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7C,IAAI,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACjD,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,IAAI,eAAe,GAAU,EAAE,CAAC;YAChC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;gBACrB,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YACpE,CAAC;YACD,MAAM,CAAC,eAAe,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YACD,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YAGD,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;YACzD,IAAI,QAAQ,GAA2B,EAAE,CAAC;YAC1C,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC;gBAC/B,IAAI,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC1C,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;YAChH,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;IACL,CAAC;IAEa,4BAAW,GAAzB,UAA0B,IAAS,EAAE,IAAY;QAE7C,IAAI,GAAG,gBAAgB,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpD,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7C,IAAI,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACjD,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,IAAI,eAAe,GAAU,EAAE,CAAC;YAChC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;gBACrB,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YACtE,CAAC;YACD,MAAM,CAAC,eAAe,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YAED,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YACD,IAAI,QAAQ,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;YACzD,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC;gBAC/B,IAAI,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC1C,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;YAClH,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;IACL,CAAC;IACL,uBAAC;AAAD,CAAC,AAtGD,IAsGC;AAKD;IAAA;IAwBA,CAAC;IAHU,0BAAmB,GAA1B;QACI,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACnC,CAAC;IAhBM,oBAAa,GAAuB,SAAS,CAAC;IAE9C,uBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,UAAU;SACrB;KAAK,CAAC;IAKf,aAAC;CAAA,AAxBD,IAwBC;AAxBY,wBAAM;AA6BnB;IAAA;IA2BA,CAAC;IAHU,+BAAmB,GAA1B;QACI,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC;IACxC,CAAC;IArBM,yBAAa,GAAuB,SAAS,CAAC;IAE9C,4BAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,SAAS;YACrB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,kBAAC;CAAA,AA3BD,IA2BC;AA3BY,kCAAW;AAgCxB;IAAA;IAqBA,CAAC;IAHU,4BAAmB,GAA1B;QACI,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACrC,CAAC;IAhBM,sBAAa,GAAuB,SAAS,CAAC;IAE9C,yBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,eAAC;CAAA,AArBD,IAqBC;AArBY,4BAAQ;AA0BrB;IAAA;IAUA,CAAC;IAHU,4BAAmB,GAA1B;QACI,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACrC,CAAC;IAPM,sBAAa,GAAuB,SAAS,CAAC;IAE9C,yBAAgB,GAA0D,EAChF,CAAC;IAKN,eAAC;CAAA,AAVD,IAUC;AAVY,4BAAQ;AAerB;IAAA;IAgDA,CAAC;IAHU,yBAAmB,GAA1B;QACI,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAClC,CAAC;IApCM,mBAAa,GAAuB,SAAS,CAAC;IAE9C,sBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,MAAM;SACjB;QACD;YACI,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,kBAAkB;SAC7B;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,SAAS;SACpB;KAAK,CAAC;IAKf,YAAC;CAAA,AAhDD,IAgDC;AAhDY,sBAAK;AAkDlB,WAAiB,KAAK;IAClB,IAAY,UAIX;IAJD,WAAY,UAAU;QAClB,kCAAe,QAAQ,YAAA,CAAA;QACvB,oCAAiB,UAAU,cAAA,CAAA;QAC3B,qCAAkB,WAAW,eAAA,CAAA;IACjC,CAAC,EAJW,UAAU,GAAV,gBAAU,KAAV,gBAAU,QAIrB;AACL,CAAC,EANgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAMrB;AAxDY,sBAAK;AA4DlB;IAAA;IAgDA,CAAC;IAHU,uBAAmB,GAA1B;QACI,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAChC,CAAC;IApCM,iBAAa,GAAuB,SAAS,CAAC;IAE9C,oBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,UAAU;SACrB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,eAAe;SAC1B;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,YAAY;SACvB;QACD;YACI,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,gBAAgB;SAC3B;KAAK,CAAC;IAKf,UAAC;CAAA,AAhDD,IAgDC;AAhDY,kBAAG;AAkDhB,WAAiB,GAAG;IAChB,IAAY,UAIX;IAJD,WAAY,UAAU;QAClB,qCAAkB,WAAW,eAAA,CAAA;QAC7B,mCAAgB,SAAS,aAAA,CAAA;QACzB,gCAAa,MAAM,UAAA,CAAA;IACvB,CAAC,EAJW,UAAU,GAAV,cAAU,KAAV,cAAU,QAIrB;AACL,CAAC,EANgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAMnB;AAxDY,kBAAG;AA4DhB;IAAA;IAqBA,CAAC;IAHU,uBAAmB,GAA1B;QACI,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAChC,CAAC;IAhBM,iBAAa,GAAuB,SAAS,CAAC;IAE9C,oBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,UAAC;CAAA,AArBD,IAqBC;AArBY,kBAAG;AA0BhB;IAAA;IA4DA,CAAC;IAHU,wBAAmB,GAA1B;QACI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IA9CM,kBAAa,GAAuB,SAAS,CAAC;IAE9C,qBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,YAAY;YACxB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,WAAC;CAAA,AA5DD,IA4DC;AA5DY,oBAAI;AA+DjB,IAAI,QAAQ,GAA2B;IAC/B,kBAAkB,EAAE,KAAK,CAAC,UAAU;IACpC,gBAAgB,EAAE,GAAG,CAAC,UAAU;CACvC,CAAA;AAED,IAAI,OAAO,GAA2B;IAClC,QAAQ,EAAE,MAAM;IAChB,aAAa,EAAE,WAAW;IAC1B,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,IAAI;CACf,CAAA;AASD;IAAA;QACW,aAAQ,GAAW,EAAE,CAAC;QACtB,aAAQ,GAAW,EAAE,CAAC;IAOjC,CAAC;IALG,sCAAc,GAAd,UAAe,cAAuC;QAClD,cAAc,CAAC,IAAI,GAAG;YAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACnD,CAAA;IACL,CAAC;IACL,oBAAC;AAAD,CAAC,AATD,IASC;AATY,sCAAa;AAW1B;IAGI,oBAAoB,QAAgB,EAAU,SAAiB;QAA3C,aAAQ,GAAR,QAAQ,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QAFxD,WAAM,GAAW,EAAE,CAAC;IAG3B,CAAC;IAED,mCAAc,GAAd,UAAe,cAAuC;QAClD,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC;YACrB,cAAc,CAAC,EAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3D,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,cAAc,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;YAC/E,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACzD,CAAC;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,gCAAU;AAevB;IAAA;QACW,gBAAW,GAAW,EAAE,CAAC;IAOpC,CAAC;IALG,8BAAc,GAAd,UAAe,cAAuC;QAClD,EAAE,CAAC,CAAC,cAAc,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3C,cAAc,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3E,CAAC;IACL,CAAC;IACL,YAAC;AAAD,CAAC,AARD,IAQC;AARY,sBAAK;AAUlB;IAAA;QACW,aAAQ,GAAW,EAAE,CAAC;QACtB,aAAQ,GAAW,EAAE,CAAC;IAKjC,CAAC;IAHG,iCAAc,GAAd,UAAe,CAA0B;IAEzC,CAAC;IACL,eAAC;AAAD,CAAC,AAPD,IAOC;AAPY,4BAAQ;AASrB,IAAY,aAEX;AAFD,WAAY,aAAa;IACrB,uDAAO,CAAA;AACX,CAAC,EAFW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAExB;AAED;IAYI,gBAAY,kBAA0B,EAAE,QAAiB,EAAE,QAAiB;QAXlE,cAAS,GAAG,eAAe,CAAC;QAC5B,mBAAc,GAAS,EAAE,CAAC;QAC1B,oBAAe,GAAa,KAAK,CAAC;QAElC,oBAAe,GAAG;YACxB,SAAS,EAAkB,IAAI,QAAQ,EAAE;YACzC,SAAS,EAAE,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9C,eAAe,EAAE,IAAI,KAAK,EAAE;SAC/B,CAAA;QAIG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACX,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;QACL,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAA;YACtC,CAAC;QACL,CAAC;IACL,CAAC;IAED,sBAAI,kCAAc;aAAlB,UAAmB,KAAc;YAC7B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QACjC,CAAC;;;OAAA;IAED,sBAAI,4BAAQ;aAIZ;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAND,UAAa,QAAgB;YACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,CAAC;;;OAAA;IAMM,yCAAwB,GAA/B,UAAgC,IAAoB;QACvD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,0BAAS,GAAhB,UAAiB,GAAkB,EAAE,KAAa;QAC7C,IAAI,CAAC,eAAuB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;IACrE,CAAC;IAED,sBAAI,+BAAW;aAAf,UAAgB,KAAa;YACzB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3D,CAAC;;;OAAA;IAMM,uBAAM,GAAb,UAAe,IAAS;QACpB,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC5C,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;QAC1F,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC;SAChD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,0BAAS,GAAhB,UAAkB,KAAa,EAAE,MAAe;QAC5C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc;aAC9C,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAED,oBAAoB,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE/E,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,QAAQ;YAChB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,iCAAgB,GAAvB,UAAyB,MAA+C;QACpE,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC;QACzD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;QACtG,CAAC;QAED,EAAE,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;YACvB,uBAAuB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,yCAAyC,CAAC,CAAC;QACtH,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAwD,UAAC,OAAO,EAAE,MAAM;YACtF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;oBACxD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,+BAAc,GAArB,UAAuB,IAAmB;QACtC,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC;QACvD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAED,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACrB,uBAAuB,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACxF,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAwD,UAAC,OAAO,EAAE,MAAM;YACtF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;oBACxD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,2BAAU,GAAjB,UAAmB,KAAa;QAC5B,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc;aAC9C,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;QAC/F,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAiD,UAAC,OAAO,EAAE,MAAM;YAC/E,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;oBACjD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,0BAAS,GAAhB,UAAkB,IAAS;QACvB,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC5C,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;QAC7F,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC;SAChD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAQM,kCAAiB,GAAxB,UAA0B,KAAa,EAAE,IAAa,EAAE,MAAe;QACnE,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc;aAC9C,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;QACtG,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACrB,kBAAkB,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5E,CAAC;QAED,EAAE,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;YACvB,kBAAkB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChF,CAAC;QAED,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAQM,2BAAU,GAAjB,UAAmB,KAAa,EAAE,kBAA2B,EAAE,IAAa;QACxE,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,0BAA0B;aAC1D,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;QAC/F,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,EAAE,CAAC,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC;YACnC,kBAAkB,CAAC,oBAAoB,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;QACxG,CAAC;QAED,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACrB,kBAAkB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QACtC,CAAC;QACD,mBAAmB,GAAG,IAAI,CAAC;QAE3B,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAyD,UAAC,OAAO,EAAE,MAAM;YACvF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;oBACzD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,aAAC;AAAD,CAAC,AAhgBD,IAggBC;AAhgBY,wBAAM;AAigBnB,IAAY,eAEX;AAFD,WAAY,eAAe;IACvB,2DAAO,CAAA;AACX,CAAC,EAFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAE1B;AAED;IAYI,kBAAY,kBAA0B,EAAE,QAAiB,EAAE,QAAiB;QAXlE,cAAS,GAAG,eAAe,CAAC;QAC5B,mBAAc,GAAS,EAAE,CAAC;QAC1B,oBAAe,GAAa,KAAK,CAAC;QAElC,oBAAe,GAAG;YACxB,SAAS,EAAkB,IAAI,QAAQ,EAAE;YACzC,SAAS,EAAE,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9C,eAAe,EAAE,IAAI,KAAK,EAAE;SAC/B,CAAA;QAIG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACX,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;QACL,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAA;YACtC,CAAC;QACL,CAAC;IACL,CAAC;IAED,sBAAI,oCAAc;aAAlB,UAAmB,KAAc;YAC7B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QACjC,CAAC;;;OAAA;IAED,sBAAI,8BAAQ;aAIZ;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAND,UAAa,QAAgB;YACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,CAAC;;;OAAA;IAMM,2CAAwB,GAA/B,UAAgC,IAAoB;QACvD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,4BAAS,GAAhB,UAAiB,GAAoB,EAAE,KAAa;QAC/C,IAAI,CAAC,eAAuB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;IACvE,CAAC;IAED,sBAAI,iCAAW;aAAf,UAAgB,KAAa;YACzB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3D,CAAC;;;OAAA;IAMM,8BAAW,GAAlB,UAAoB,OAAe;QAC/B,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,wBAAwB;aACxD,OAAO,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,QAAQ;YAChB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAKM,+BAAY,GAAnB;QACI,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAC;QACxD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAwE,UAAC,OAAO,EAAE,MAAM;YACtG,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAC;oBACxE,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,+BAAY,GAAnB,UAAqB,OAAe;QAChC,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,wBAAwB;aACxD,OAAO,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;QACnG,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAmD,UAAC,OAAO,EAAE,MAAM;YACjF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;oBACnD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,6BAAU,GAAjB,UAAmB,IAAW;QAC1B,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;QACpD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC;SAClD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAmD,UAAC,OAAO,EAAE,MAAM;YACjF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;oBACnD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,eAAC;AAAD,CAAC,AA7PD,IA6PC;AA7PY,4BAAQ;AA8PrB,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,yDAAO,CAAA;AACX,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAED;IAYI,iBAAY,kBAA0B,EAAE,QAAiB,EAAE,QAAiB;QAXlE,cAAS,GAAG,eAAe,CAAC;QAC5B,mBAAc,GAAS,EAAE,CAAC;QAC1B,oBAAe,GAAa,KAAK,CAAC;QAElC,oBAAe,GAAG;YACxB,SAAS,EAAkB,IAAI,QAAQ,EAAE;YACzC,SAAS,EAAE,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9C,eAAe,EAAE,IAAI,KAAK,EAAE;SAC/B,CAAA;QAIG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACX,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;QACL,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAA;YACtC,CAAC;QACL,CAAC;IACL,CAAC;IAED,sBAAI,mCAAc;aAAlB,UAAmB,KAAc;YAC7B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QACjC,CAAC;;;OAAA;IAED,sBAAI,6BAAQ;aAIZ;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAND,UAAa,QAAgB;YACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,CAAC;;;OAAA;IAMM,0CAAwB,GAA/B,UAAgC,IAAoB;QACvD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,2BAAS,GAAhB,UAAiB,GAAmB,EAAE,KAAa;QAC9C,IAAI,CAAC,eAAuB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;IACtE,CAAC;IAED,sBAAI,gCAAW;aAAf,UAAgB,KAAa;YACzB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3D,CAAC;;;OAAA;IAMM,4BAAU,GAAjB,UAAmB,IAAU;QACzB,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC7C,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;SACjD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,2CAAyB,GAAhC,UAAkC,IAAiB;QAC/C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,uBAAuB,CAAC;QAC7D,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAC;QAC7G,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;SACxD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,0CAAwB,GAA/B,UAAiC,IAAiB;QAC9C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,sBAAsB,CAAC;QAC5D,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC5G,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;SACxD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,4BAAU,GAAjB,UAAmB,QAAgB;QAC/B,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB;aAClD,OAAO,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,QAAQ;YAChB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,+BAAa,GAApB,UAAsB,QAAgB;QAClC,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB;aAClD,OAAO,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;QACrG,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBAClD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,2BAAS,GAAhB,UAAkB,QAAgB,EAAE,QAAgB;QAChD,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC;QACnD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QACjG,CAAC;QAGD,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QACjG,CAAC;QAED,EAAE,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YACzB,uBAAuB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzF,CAAC;QAED,EAAE,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YACzB,uBAAuB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzF,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAoD,UAAC,OAAO,EAAE,MAAM;YAClF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;oBACpD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAKM,4BAAU,GAAjB;QACI,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;QACpD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,4BAAU,GAAjB,UAAmB,QAAgB,EAAE,IAAU;QAC3C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB;aAClD,OAAO,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAGD,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAGD,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;SACjD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,cAAC;AAAD,CAAC,AA9dD,IA8dC;AA9dY,0BAAO"} \ No newline at end of file +{"version":3,"file":"api.js","sourceRoot":"","sources":["api.ts"],"names":[],"mappings":";;AAYA,yCAA4C;AAE5C,kCAAqC;AAErC,IAAI,eAAe,GAAG,+BAA+B,CAAC;AAOtD,IAAI,UAAU,GAAG;IACG,QAAQ;IACR,SAAS;IACT,QAAQ;IACR,SAAS;IACT,MAAM;IACN,OAAO;IACP,QAAQ;IACR,KAAK;CACP,CAAC;AAEnB;IAAA;IAsGA,CAAC;IApGiB,gCAAe,GAA7B,UAA8B,IAAS,EAAE,YAAoB;QACzD,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,YAAY,CAAC;QACxB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAC/D,MAAM,CAAC,YAAY,CAAC;QACxB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,YAAY,KAAK,MAAM,CAAC,CAAC,CAAC;YACjC,MAAM,CAAC,YAAY,CAAC;QACxB,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,CAAC,YAAY,CAAC;YACxB,CAAC;YAED,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBACzB,MAAM,CAAC,YAAY,CAAC;YACxB,CAAC;YAGD,IAAI,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC,aAAa,CAAC;YAChE,EAAE,CAAC,CAAC,qBAAqB,IAAI,IAAI,CAAC,CAAC,CAAC;gBAChC,MAAM,CAAC,YAAY,CAAC;YACxB,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,EAAE,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;oBAC9B,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;gBACvC,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,MAAM,CAAC,YAAY,CAAC;gBACxB,CAAC;YACL,CAAC;QACL,CAAC;IACL,CAAC;IAEa,0BAAS,GAAvB,UAAwB,IAAS,EAAE,IAAY;QAC3C,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7C,IAAI,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACjD,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,IAAI,eAAe,GAAU,EAAE,CAAC;YAChC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;gBACrB,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YACpE,CAAC;YACD,MAAM,CAAC,eAAe,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YACD,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YAGD,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;YACzD,IAAI,QAAQ,GAA2B,EAAE,CAAC;YAC1C,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC;gBAC/B,IAAI,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC1C,QAAQ,CAAC,aAAa,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;YAChH,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;IACL,CAAC;IAEa,4BAAW,GAAzB,UAA0B,IAAS,EAAE,IAAY;QAE7C,IAAI,GAAG,gBAAgB,CAAC,eAAe,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACpD,EAAE,CAAC,CAAC,IAAI,IAAI,SAAS,CAAC,CAAC,CAAC;YACpB,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YACvD,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC7C,IAAI,OAAO,GAAW,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;YACjD,OAAO,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,EAAE,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,IAAI,eAAe,GAAU,EAAE,CAAC;YAChC,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC;gBACrB,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,eAAe,CAAC,IAAI,CAAC,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;YACtE,CAAC;YACD,MAAM,CAAC,eAAe,CAAC;QAC3B,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC;YACzB,MAAM,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;QAC1B,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YAED,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;gBACjB,MAAM,CAAC,IAAI,CAAC;YAChB,CAAC;YACD,IAAI,QAAQ,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACnC,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,mBAAmB,EAAE,CAAC;YACzD,GAAG,CAAC,CAAC,IAAI,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC;gBAC/B,IAAI,aAAa,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;gBAC1C,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC;YAClH,CAAC;YACD,MAAM,CAAC,QAAQ,CAAC;QACpB,CAAC;IACL,CAAC;IACL,uBAAC;AAAD,CAAC,AAtGD,IAsGC;AAKD;IAAA;IAwBA,CAAC;IAHU,0BAAmB,GAA1B;QACI,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC;IACnC,CAAC;IAhBM,oBAAa,GAAuB,SAAS,CAAC;IAE9C,uBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,UAAU;SACrB;KAAK,CAAC;IAKf,aAAC;CAAA,AAxBD,IAwBC;AAxBY,wBAAM;AA6BnB;IAAA;IA2BA,CAAC;IAHU,+BAAmB,GAA1B;QACI,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC;IACxC,CAAC;IArBM,yBAAa,GAAuB,SAAS,CAAC;IAE9C,4BAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,SAAS;YACjB,UAAU,EAAE,SAAS;YACrB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,kBAAC;CAAA,AA3BD,IA2BC;AA3BY,kCAAW;AAgCxB;IAAA;IAqBA,CAAC;IAHU,4BAAmB,GAA1B;QACI,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACrC,CAAC;IAhBM,sBAAa,GAAuB,SAAS,CAAC;IAE9C,yBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,eAAC;CAAA,AArBD,IAqBC;AArBY,4BAAQ;AA0BrB;IAAA;IAUA,CAAC;IAHU,4BAAmB,GAA1B;QACI,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IACrC,CAAC;IAPM,sBAAa,GAAuB,SAAS,CAAC;IAE9C,yBAAgB,GAA0D,EAChF,CAAC;IAKN,eAAC;CAAA,AAVD,IAUC;AAVY,4BAAQ;AAerB;IAAA;IAgDA,CAAC;IAHU,yBAAmB,GAA1B;QACI,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC;IAClC,CAAC;IApCM,mBAAa,GAAuB,SAAS,CAAC;IAE9C,sBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,MAAM;SACjB;QACD;YACI,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,kBAAkB;SAC7B;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,SAAS;SACpB;KAAK,CAAC;IAKf,YAAC;CAAA,AAhDD,IAgDC;AAhDY,sBAAK;AAkDlB,WAAiB,KAAK;IAClB,IAAY,UAIX;IAJD,WAAY,UAAU;QAClB,kCAAe,QAAQ,YAAA,CAAA;QACvB,oCAAiB,UAAU,cAAA,CAAA;QAC3B,qCAAkB,WAAW,eAAA,CAAA;IACjC,CAAC,EAJW,UAAU,GAAV,gBAAU,KAAV,gBAAU,QAIrB;AACL,CAAC,EANgB,KAAK,GAAL,aAAK,KAAL,aAAK,QAMrB;AAxDY,sBAAK;AA4DlB;IAAA;IAgDA,CAAC;IAHU,uBAAmB,GAA1B;QACI,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAChC,CAAC;IApCM,iBAAa,GAAuB,SAAS,CAAC;IAE9C,oBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,UAAU;SACrB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,eAAe;SAC1B;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,YAAY;SACvB;QACD;YACI,MAAM,EAAE,QAAQ;YAChB,UAAU,EAAE,QAAQ;YACpB,MAAM,EAAE,gBAAgB;SAC3B;KAAK,CAAC;IAKf,UAAC;CAAA,AAhDD,IAgDC;AAhDY,kBAAG;AAkDhB,WAAiB,GAAG;IAChB,IAAY,UAIX;IAJD,WAAY,UAAU;QAClB,qCAAkB,WAAW,eAAA,CAAA;QAC7B,mCAAgB,SAAS,aAAA,CAAA;QACzB,gCAAa,MAAM,UAAA,CAAA;IACvB,CAAC,EAJW,UAAU,GAAV,cAAU,KAAV,cAAU,QAIrB;AACL,CAAC,EANgB,GAAG,GAAH,WAAG,KAAH,WAAG,QAMnB;AAxDY,kBAAG;AA4DhB;IAAA;IAqBA,CAAC;IAHU,uBAAmB,GAA1B;QACI,MAAM,CAAC,GAAG,CAAC,gBAAgB,CAAC;IAChC,CAAC;IAhBM,iBAAa,GAAuB,SAAS,CAAC;IAE9C,oBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,MAAM;YACd,UAAU,EAAE,MAAM;YAClB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,UAAC;CAAA,AArBD,IAqBC;AArBY,kBAAG;AA0BhB;IAAA;IA4DA,CAAC;IAHU,wBAAmB,GAA1B;QACI,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IA9CM,kBAAa,GAAuB,SAAS,CAAC;IAE9C,qBAAgB,GAA0D;QAC7E;YACI,MAAM,EAAE,IAAI;YACZ,UAAU,EAAE,IAAI;YAChB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,WAAW;YACnB,UAAU,EAAE,WAAW;YACvB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,UAAU;YAClB,UAAU,EAAE,UAAU;YACtB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,OAAO;YACf,UAAU,EAAE,OAAO;YACnB,MAAM,EAAE,QAAQ;SACnB;QACD;YACI,MAAM,EAAE,YAAY;YACpB,UAAU,EAAE,YAAY;YACxB,MAAM,EAAE,QAAQ;SACnB;KAAK,CAAC;IAKf,WAAC;CAAA,AA5DD,IA4DC;AA5DY,oBAAI;AA+DjB,IAAI,QAAQ,GAA2B;IAC/B,kBAAkB,EAAE,KAAK,CAAC,UAAU;IACpC,gBAAgB,EAAE,GAAG,CAAC,UAAU;CACvC,CAAA;AAED,IAAI,OAAO,GAA2B;IAClC,QAAQ,EAAE,MAAM;IAChB,aAAa,EAAE,WAAW;IAC1B,UAAU,EAAE,QAAQ;IACpB,UAAU,EAAE,QAAQ;IACpB,OAAO,EAAE,KAAK;IACd,KAAK,EAAE,GAAG;IACV,KAAK,EAAE,GAAG;IACV,MAAM,EAAE,IAAI;CACf,CAAA;AASD;IAAA;QACW,aAAQ,GAAW,EAAE,CAAC;QACtB,aAAQ,GAAW,EAAE,CAAC;IAOjC,CAAC;IALG,sCAAc,GAAd,UAAe,cAAuC;QAClD,cAAc,CAAC,IAAI,GAAG;YAClB,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACnD,CAAA;IACL,CAAC;IACL,oBAAC;AAAD,CAAC,AATD,IASC;AATY,sCAAa;AAW1B;IAGI,oBAAoB,QAAgB,EAAU,SAAiB;QAA3C,aAAQ,GAAR,QAAQ,CAAQ;QAAU,cAAS,GAAT,SAAS,CAAQ;QAFxD,WAAM,GAAW,EAAE,CAAC;IAG3B,CAAC;IAED,mCAAc,GAAd,UAAe,cAAuC;QAClD,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,OAAO,CAAC,CAAC,CAAC;YACrB,cAAc,CAAC,EAAG,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QAC3D,CAAC;QAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,IAAI,QAAQ,IAAI,cAAc,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;YAC/E,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC;QACzD,CAAC;IACL,CAAC;IACL,iBAAC;AAAD,CAAC,AAbD,IAaC;AAbY,gCAAU;AAevB;IAAA;QACW,gBAAW,GAAW,EAAE,CAAC;IAOpC,CAAC;IALG,8BAAc,GAAd,UAAe,cAAuC;QAClD,EAAE,CAAC,CAAC,cAAc,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;YAC3C,cAAc,CAAC,OAAO,CAAC,eAAe,CAAC,GAAG,SAAS,GAAG,IAAI,CAAC,WAAW,CAAC;QAC3E,CAAC;IACL,CAAC;IACL,YAAC;AAAD,CAAC,AARD,IAQC;AARY,sBAAK;AAUlB;IAAA;QACW,aAAQ,GAAW,EAAE,CAAC;QACtB,aAAQ,GAAW,EAAE,CAAC;IAKjC,CAAC;IAHG,iCAAc,GAAd,UAAe,CAA0B;IAEzC,CAAC;IACL,eAAC;AAAD,CAAC,AAPD,IAOC;AAPY,4BAAQ;AASrB,IAAY,aAEX;AAFD,WAAY,aAAa;IACrB,uDAAO,CAAA;AACX,CAAC,EAFW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAExB;AAED;IAYI,gBAAY,kBAA0B,EAAE,QAAiB,EAAE,QAAiB;QAXlE,cAAS,GAAG,eAAe,CAAC;QAC5B,mBAAc,GAAS,EAAE,CAAC;QAC1B,oBAAe,GAAa,KAAK,CAAC;QAElC,oBAAe,GAAG;YACxB,SAAS,EAAkB,IAAI,QAAQ,EAAE;YACzC,SAAS,EAAE,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9C,eAAe,EAAE,IAAI,KAAK,EAAE;SAC/B,CAAA;QAIG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACX,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;QACL,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAA;YACtC,CAAC;QACL,CAAC;IACL,CAAC;IAED,sBAAI,kCAAc;aAAlB,UAAmB,KAAc;YAC7B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QACjC,CAAC;;;OAAA;IAED,sBAAI,4BAAQ;aAIZ;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAND,UAAa,QAAgB;YACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,CAAC;;;OAAA;IAMM,yCAAwB,GAA/B,UAAgC,IAAoB;QACvD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,0BAAS,GAAhB,UAAiB,GAAkB,EAAE,KAAa;QAC7C,IAAI,CAAC,eAAuB,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;IACrE,CAAC;IAED,sBAAI,+BAAW;aAAf,UAAgB,KAAa;YACzB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3D,CAAC;;;OAAA;IAOM,uBAAM,GAAb,UAAe,IAAS,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACvC,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC5C,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,oEAAoE,CAAC,CAAC;QAC1F,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC;SAChD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAQM,0BAAS,GAAhB,UAAkB,KAAa,EAAE,MAAe,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAC/D,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc;aAC9C,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAED,oBAAoB,CAAC,SAAS,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACzE,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,QAAQ;YAChB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,iCAAgB,GAAvB,UAAyB,MAA+C,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACvF,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,mBAAmB,CAAC;QACzD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,MAAM,KAAK,IAAI,IAAI,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;YAC1C,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;QACtG,CAAC;QAED,EAAE,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;YACvB,uBAAuB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,yCAAyC,CAAC,CAAC;QACtH,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAwD,UAAC,OAAO,EAAE,MAAM;YACtF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;oBACxD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,+BAAc,GAArB,UAAuB,IAAmB,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACzD,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,iBAAiB,CAAC;QACvD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAED,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACrB,uBAAuB,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,eAAe,CAAC,CAAC;QACxF,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAwD,UAAC,OAAO,EAAE,MAAM;YACtF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC;oBACxD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,2BAAU,GAAjB,UAAmB,KAAa,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAC/C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc;aAC9C,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;QAC/F,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAiD,UAAC,OAAO,EAAE,MAAM;YAC/E,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;oBACjD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,0BAAS,GAAhB,UAAkB,IAAS,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAC1C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC5C,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,uEAAuE,CAAC,CAAC;QAC7F,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,CAAC;SAChD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IASM,kCAAiB,GAAxB,UAA0B,KAAa,EAAE,IAAa,EAAE,MAAe,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACtF,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc;aAC9C,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;QACtG,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACrB,kBAAkB,CAAC,MAAM,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC5E,CAAC;QAED,EAAE,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC;YACvB,kBAAkB,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAChF,CAAC;QAED,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IASM,2BAAU,GAAjB,UAAmB,KAAa,EAAE,kBAA2B,EAAE,IAAa,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAC3F,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,0BAA0B;aAC1D,OAAO,CAAC,GAAG,GAAG,OAAO,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,yEAAyE,CAAC,CAAC;QAC/F,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,EAAE,CAAC,CAAC,kBAAkB,KAAK,SAAS,CAAC,CAAC,CAAC;YACnC,kBAAkB,CAAC,oBAAoB,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,kBAAkB,EAAE,QAAQ,CAAC,CAAC;QACxG,CAAC;QAED,EAAE,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACrB,kBAAkB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;QACtC,CAAC;QACD,mBAAmB,GAAG,IAAI,CAAC;QAE3B,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAE1E,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAyD,UAAC,OAAO,EAAE,MAAM;YACvF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;oBACzD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,aAAC;AAAD,CAAC,AAhhBD,IAghBC;AAhhBY,wBAAM;AAihBnB,IAAY,eAEX;AAFD,WAAY,eAAe;IACvB,2DAAO,CAAA;AACX,CAAC,EAFW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAE1B;AAED;IAYI,kBAAY,kBAA0B,EAAE,QAAiB,EAAE,QAAiB;QAXlE,cAAS,GAAG,eAAe,CAAC;QAC5B,mBAAc,GAAS,EAAE,CAAC;QAC1B,oBAAe,GAAa,KAAK,CAAC;QAElC,oBAAe,GAAG;YACxB,SAAS,EAAkB,IAAI,QAAQ,EAAE;YACzC,SAAS,EAAE,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9C,eAAe,EAAE,IAAI,KAAK,EAAE;SAC/B,CAAA;QAIG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACX,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;QACL,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAA;YACtC,CAAC;QACL,CAAC;IACL,CAAC;IAED,sBAAI,oCAAc;aAAlB,UAAmB,KAAc;YAC7B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QACjC,CAAC;;;OAAA;IAED,sBAAI,8BAAQ;aAIZ;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAND,UAAa,QAAgB;YACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,CAAC;;;OAAA;IAMM,2CAAwB,GAA/B,UAAgC,IAAoB;QACvD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,4BAAS,GAAhB,UAAiB,GAAoB,EAAE,KAAa;QAC/C,IAAI,CAAC,eAAuB,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;IACvE,CAAC;IAED,sBAAI,iCAAW;aAAf,UAAgB,KAAa;YACzB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3D,CAAC;;;OAAA;IAOM,8BAAW,GAAlB,UAAoB,OAAe,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAClD,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,wBAAwB;aACxD,OAAO,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,QAAQ;YAChB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,+BAAY,GAAnB,UAAqB,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAClC,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAC;QACxD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAE3B,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAwE,UAAC,OAAO,EAAE,MAAM;YACtG,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,4BAA4B,CAAC,CAAC;oBACxE,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,+BAAY,GAAnB,UAAqB,OAAe,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACnD,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,wBAAwB;aACxD,OAAO,CAAC,GAAG,GAAG,SAAS,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACzE,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC;YAC5C,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAC;QACnG,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAmD,UAAC,OAAO,EAAE,MAAM;YACjF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;oBACnD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,6BAAU,GAAjB,UAAmB,IAAW,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAC7C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;QACpD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC;SAClD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAmD,UAAC,OAAO,EAAE,MAAM;YACjF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;oBACnD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,eAAC;AAAD,CAAC,AArQD,IAqQC;AArQY,4BAAQ;AAsQrB,IAAY,cAEX;AAFD,WAAY,cAAc;IACtB,yDAAO,CAAA;AACX,CAAC,EAFW,cAAc,GAAd,sBAAc,KAAd,sBAAc,QAEzB;AAED;IAYI,iBAAY,kBAA0B,EAAE,QAAiB,EAAE,QAAiB;QAXlE,cAAS,GAAG,eAAe,CAAC;QAC5B,mBAAc,GAAS,EAAE,CAAC;QAC1B,oBAAe,GAAa,KAAK,CAAC;QAElC,oBAAe,GAAG;YACxB,SAAS,EAAkB,IAAI,QAAQ,EAAE;YACzC,SAAS,EAAE,IAAI,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC;YAC9C,eAAe,EAAE,IAAI,KAAK,EAAE;SAC/B,CAAA;QAIG,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;YACX,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;YAC7B,CAAC;QACL,CAAC;QAAC,IAAI,CAAC,CAAC;YACJ,EAAE,CAAC,CAAC,kBAAkB,CAAC,CAAC,CAAC;gBACrB,IAAI,CAAC,QAAQ,GAAG,kBAAkB,CAAA;YACtC,CAAC;QACL,CAAC;IACL,CAAC;IAED,sBAAI,mCAAc;aAAlB,UAAmB,KAAc;YAC7B,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC;QACjC,CAAC;;;OAAA;IAED,sBAAI,6BAAQ;aAIZ;YACI,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC;QAC1B,CAAC;aAND,UAAa,QAAgB;YACzB,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC9B,CAAC;;;OAAA;IAMM,0CAAwB,GAA/B,UAAgC,IAAoB;QACvD,IAAI,CAAC,eAAe,CAAC,OAAO,GAAG,IAAI,CAAC;IACjC,CAAC;IAEM,2BAAS,GAAhB,UAAiB,GAAmB,EAAE,KAAa;QAC9C,IAAI,CAAC,eAAuB,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC;IACtE,CAAC;IAED,sBAAI,gCAAW;aAAf,UAAgB,KAAa;YACzB,IAAI,CAAC,eAAe,CAAC,aAAa,CAAC,WAAW,GAAG,KAAK,CAAC;QAC3D,CAAC;;;OAAA;IAOM,4BAAU,GAAjB,UAAmB,IAAU,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAC5C,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QAC7C,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;SACjD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,2CAAyB,GAAhC,UAAkC,IAAiB,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAClE,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,uBAAuB,CAAC;QAC7D,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAC;QAC7G,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;SACxD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,0CAAwB,GAA/B,UAAiC,IAAiB,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACjE,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,sBAAsB,CAAC;QAC5D,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,sFAAsF,CAAC,CAAC;QAC5G,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,MAAM;YACd,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,aAAa,CAAC;SACxD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,4BAAU,GAAjB,UAAmB,QAAgB,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAClD,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB;aAClD,OAAO,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,QAAQ;YAChB,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAOM,+BAAa,GAApB,UAAsB,QAAgB,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACrD,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB;aAClD,OAAO,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAC;QACrG,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;oBAClD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAQM,2BAAS,GAAhB,UAAkB,QAAgB,EAAE,QAAgB,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QACnE,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,aAAa,CAAC;QACnD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QACjG,CAAC;QAGD,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,2EAA2E,CAAC,CAAC;QACjG,CAAC;QAED,EAAE,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YACzB,uBAAuB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzF,CAAC;QAED,EAAE,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YACzB,uBAAuB,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAAC,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACzF,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAoD,UAAC,OAAO,EAAE,MAAM;YAClF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,IAAI,GAAG,gBAAgB,CAAC,WAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;oBACpD,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAMM,4BAAU,GAAjB,UAAmB,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAChC,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,cAAc,CAAC;QACpD,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAE3B,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;SACb,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IAQM,4BAAU,GAAjB,UAAmB,QAAgB,EAAE,IAAU,EAAE,OAAiB;QAAjB,wBAAA,EAAA,YAAiB;QAC9D,IAAM,YAAY,GAAG,IAAI,CAAC,QAAQ,GAAG,kBAAkB;aAClD,OAAO,CAAC,GAAG,GAAG,UAAU,GAAG,GAAG,EAAE,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAC3E,IAAI,uBAAuB,GAAQ,EAAE,CAAC;QACtC,IAAI,oBAAoB,GAAc,MAAO,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,cAAc,CAAC,CAAC;QAC9E,IAAI,kBAAkB,GAAQ,EAAE,CAAC;QAGjC,EAAE,CAAC,CAAC,QAAQ,KAAK,IAAI,IAAI,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;YAC9C,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;QAClG,CAAC;QAGD,EAAE,CAAC,CAAC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC;YACtC,MAAM,IAAI,KAAK,CAAC,wEAAwE,CAAC,CAAC;QAC9F,CAAC;QAEK,MAAO,CAAC,MAAM,CAAC,oBAAoB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,mBAAmB,GAAG,KAAK,CAAC;QAEhC,IAAI,sBAAsB,GAA4B;YAClD,MAAM,EAAE,KAAK;YACb,EAAE,EAAE,uBAAuB;YAC3B,OAAO,EAAE,oBAAoB;YAC7B,GAAG,EAAE,YAAY;YACjB,cAAc,EAAE,IAAI,CAAC,eAAe;YACpC,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,gBAAgB,CAAC,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;SACjD,CAAC;QAEF,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC;QAEpE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;YACzC,EAAE,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC;gBAChB,sBAAuB,CAAC,QAAQ,GAAG,kBAAkB,CAAC;YAChE,CAAC;YAAC,IAAI,CAAC,CAAC;gBACJ,sBAAsB,CAAC,IAAI,GAAG,kBAAkB,CAAC;YACrD,CAAC;QACL,CAAC;QACD,MAAM,CAAC,IAAI,OAAO,CAAkD,UAAC,OAAO,EAAE,MAAM;YAChF,eAAe,CAAC,sBAAsB,EAAE,UAAC,KAAK,EAAE,QAAQ,EAAE,IAAI;gBAC1D,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;oBACR,MAAM,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC;gBAAC,IAAI,CAAC,CAAC;oBACJ,EAAE,CAAC,CAAC,QAAQ,CAAC,UAAU,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,IAAI,QAAQ,CAAC,UAAU,IAAI,GAAG,CAAC,CAAC,CAAC;wBAClF,OAAO,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAChD,CAAC;oBAAC,IAAI,CAAC,CAAC;wBACJ,MAAM,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;oBAC/C,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;IACL,cAAC;AAAD,CAAC,AA9eD,IA8eC;AA9eY,0BAAO"} \ No newline at end of file diff --git a/samples/client/petstore/typescript-node/npm/package-lock.json b/samples/client/petstore/typescript-node/npm/package-lock.json index d5178fefb0a..82a8812b773 100644 --- a/samples/client/petstore/typescript-node/npm/package-lock.json +++ b/samples/client/petstore/typescript-node/npm/package-lock.json @@ -601,9 +601,10 @@ } }, "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true }, "mkdirp": { "version": "0.5.1", @@ -611,6 +612,13 @@ "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "requires": { "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + } } }, "ms": { diff --git a/samples/client/petstore/typescript-node/npm/package.json b/samples/client/petstore/typescript-node/npm/package.json index 5a45fc9dd45..0b9e5a2dff3 100644 --- a/samples/client/petstore/typescript-node/npm/package.json +++ b/samples/client/petstore/typescript-node/npm/package.json @@ -13,14 +13,15 @@ "author": "Swagger Codegen Contributors", "license": "Unlicense", "dependencies": { - "@types/bluebird": "*", - "@types/request": "*", "bluebird": "^3.5.0", "request": "^2.81.0", + "@types/bluebird": "*", + "@types/request": "*", "rewire": "^3.0.2" }, "devDependencies": { - "typescript": "^2.4.2" + "typescript": "^2.4.2", + "minimist": "^1.2.5" }, "publishConfig": { "registry": "https://skimdb.npmjs.com/registry" diff --git a/samples/client/petstore/ue4cpp/.swagger-codegen-ignore b/samples/client/petstore/ue4cpp/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/client/petstore/ue4cpp/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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/ue4cpp/.swagger-codegen/VERSION b/samples/client/petstore/ue4cpp/.swagger-codegen/VERSION new file mode 100644 index 00000000000..4b308f2ac9e --- /dev/null +++ b/samples/client/petstore/ue4cpp/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.15-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerAmount.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerAmount.cpp new file mode 100644 index 00000000000..77707794bbd --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerAmount.cpp @@ -0,0 +1,39 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerAmount.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +void SwaggerAmount::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteIdentifierPrefix(TEXT("value")); WriteJsonValue(Writer, Value); + Writer->WriteIdentifierPrefix(TEXT("currency")); WriteJsonValue(Writer, Currency); + Writer->WriteObjectEnd(); +} + +bool SwaggerAmount::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("value"), Value); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("currency"), Currency); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerApiResponse.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerApiResponse.cpp new file mode 100644 index 00000000000..b655992a1e9 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerApiResponse.cpp @@ -0,0 +1,50 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerApiResponse.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +void SwaggerApiResponse::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Code.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("code")); WriteJsonValue(Writer, Code.GetValue()); + } + if (Type.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("type")); WriteJsonValue(Writer, Type.GetValue()); + } + if (Message.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("message")); WriteJsonValue(Writer, Message.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool SwaggerApiResponse::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("code"), Code); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("type"), Type); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("message"), Message); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerBaseModel.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerBaseModel.cpp new file mode 100644 index 00000000000..85be76b73ea --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerBaseModel.cpp @@ -0,0 +1,27 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +void Response::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + ResponseCode = InHttpResponseCode; + SetSuccessful(EHttpResponseCodes::IsOk(InHttpResponseCode)); + if(InHttpResponseCode == EHttpResponseCodes::RequestTimeout) + { + SetResponseString(TEXT("Request Timeout")); + } +} + +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerCategory.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerCategory.cpp new file mode 100644 index 00000000000..16cc255a22c --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerCategory.cpp @@ -0,0 +1,45 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerCategory.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +void SwaggerCategory::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool SwaggerCategory::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("name"), Name); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerCurrency.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerCurrency.cpp new file mode 100644 index 00000000000..15d0271b75c --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerCurrency.cpp @@ -0,0 +1,35 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerCurrency.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +void SwaggerCurrency::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); +} + +bool SwaggerCurrency::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerHelpers.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerHelpers.cpp new file mode 100644 index 00000000000..6cdbc703547 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerHelpers.cpp @@ -0,0 +1,193 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerHelpers.h" + +#include "SwaggerModule.h" + +#include "Interfaces/IHttpRequest.h" +#include "PlatformHttp.h" +#include "Misc/FileHelper.h" + +namespace Swagger +{ + +HttpFileInput::HttpFileInput(const TCHAR* InFilePath) +{ + SetFilePath(InFilePath); +} + +HttpFileInput::HttpFileInput(const FString& InFilePath) +{ + SetFilePath(InFilePath); +} + +void HttpFileInput::SetFilePath(const TCHAR* InFilePath) +{ + FilePath = InFilePath; + if(ContentType.IsEmpty()) + { + ContentType = FPlatformHttp::GetMimeType(InFilePath); + } +} + +void HttpFileInput::SetFilePath(const FString& InFilePath) +{ + SetFilePath(*InFilePath); +} + +void HttpFileInput::SetContentType(const TCHAR* InContentType) +{ + ContentType = InContentType; +} + +FString HttpFileInput::GetFilename() const +{ + return FPaths::GetCleanFilename(FilePath); +} + +////////////////////////////////////////////////////////////////////////// + +const TCHAR* HttpMultipartFormData::Delimiter = TEXT("--"); +const TCHAR* HttpMultipartFormData::Newline = TEXT("\r\n"); + +void HttpMultipartFormData::SetBoundary(const TCHAR* InBoundary) +{ + checkf(Boundary.IsEmpty(), TEXT("Boundary must be set before usage")); + Boundary = InBoundary; +} + +const FString& HttpMultipartFormData::GetBoundary() const +{ + if (Boundary.IsEmpty()) + { + // Generate a random boundary with enough entropy, should avoid occurences of the boundary in the data. + // Since the boundary is generated at every request, in case of failure, retries should succeed. + Boundary = FGuid::NewGuid().ToString(EGuidFormats::Short); + } + + return Boundary; +} + +void HttpMultipartFormData::SetupHttpRequest(const TSharedRef& HttpRequest) +{ + if(HttpRequest->GetVerb() != TEXT("POST")) + { + UE_LOG(LogSwagger, Error, TEXT("Expected POST verb when using multipart form data")); + } + + // Append final boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Delimiter); + + HttpRequest->SetHeader("Content-Type", FString::Printf(TEXT("multipart/form-data; boundary=%s"), *GetBoundary())); + HttpRequest->SetContent(FormData); +} + +void HttpMultipartFormData::AddStringPart(const TCHAR* Name, const TCHAR* Data) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name = \"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: text/plain; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(Data); + AppendString(Newline); +} + +void HttpMultipartFormData::AddJsonPart(const TCHAR* Name, const FString& JsonString) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/json; charset=utf-8"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + AppendString(*JsonString); + AppendString(Newline); +} + +void HttpMultipartFormData::AddBinaryPart(const TCHAR* Name, const TArray& ByteArray) +{ + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\""), Name)); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: application/octet-stream"))); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(ByteArray); + AppendString(Newline); +} + +void HttpMultipartFormData::AddFilePart(const TCHAR* Name, const HttpFileInput& File) +{ + TArray FileContents; + if (!FFileHelper::LoadFileToArray(FileContents, *File.GetFilePath())) + { + UE_LOG(LogSwagger, Error, TEXT("Failed to load file (%s)"), *File.GetFilePath()); + return; + } + + // Add boundary + AppendString(Delimiter); + AppendString(*GetBoundary()); + AppendString(Newline); + + // Add header + AppendString(*FString::Printf(TEXT("Content-Disposition: form-data; name=\"%s\"; filename=\"%s\""), Name, *File.GetFilename())); + AppendString(Newline); + AppendString(*FString::Printf(TEXT("Content-Type: %s"), *File.GetContentType())); + AppendString(Newline); + + // Add header to body splitter + AppendString(Newline); + + // Add Data + FormData.Append(FileContents); + AppendString(Newline); +} + +void HttpMultipartFormData::AppendString(const TCHAR* Str) +{ + FTCHARToUTF8 utf8Str(Str); + FormData.Append((uint8*)utf8Str.Get(), utf8Str.Length()); +} + +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerModule.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerModule.cpp new file mode 100644 index 00000000000..7916f3ffda2 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerModule.cpp @@ -0,0 +1,24 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerModule.h" + +IMPLEMENT_MODULE(SwaggerModule, Swagger); +DEFINE_LOG_CATEGORY(LogSwagger); + +void SwaggerModule::StartupModule() +{ +} + +void SwaggerModule::ShutdownModule() +{ +} + diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerModule.h b/samples/client/petstore/ue4cpp/Private/SwaggerModule.h new file mode 100644 index 00000000000..5f83e9aa1e8 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerModule.h @@ -0,0 +1,25 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "Modules/ModuleInterface.h" +#include "Modules/ModuleManager.h" +#include "Logging/LogMacros.h" + +DECLARE_LOG_CATEGORY_EXTERN(LogSwagger, Log, All); + +class SWAGGER_API SwaggerModule : public IModuleInterface +{ +public: + void StartupModule() final; + void ShutdownModule() final; +}; diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerOrder.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerOrder.cpp new file mode 100644 index 00000000000..e4f0c616ed3 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerOrder.cpp @@ -0,0 +1,108 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerOrder.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +inline FString ToString(const SwaggerOrder::StatusEnum& Value) +{ + switch (Value) + { + case SwaggerOrder::StatusEnum::Placed: + return TEXT("placed"); + case SwaggerOrder::StatusEnum::Approved: + return TEXT("approved"); + case SwaggerOrder::StatusEnum::Delivered: + return TEXT("delivered"); + } + + UE_LOG(LogSwagger, Error, TEXT("Invalid SwaggerOrder::StatusEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const SwaggerOrder::StatusEnum& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const SwaggerOrder::StatusEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, SwaggerOrder::StatusEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +void SwaggerOrder::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (PetId.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("petId")); WriteJsonValue(Writer, PetId.GetValue()); + } + if (Quantity.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("quantity")); WriteJsonValue(Writer, Quantity.GetValue()); + } + if (ShipDate.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("shipDate")); WriteJsonValue(Writer, ShipDate.GetValue()); + } + if (Status.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status.GetValue()); + } + if (Complete.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("complete")); WriteJsonValue(Writer, Complete.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool SwaggerOrder::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("petId"), PetId); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("quantity"), Quantity); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("shipDate"), ShipDate); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("status"), Status); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("complete"), Complete); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerPet.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerPet.cpp new file mode 100644 index 00000000000..f3f73836057 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerPet.cpp @@ -0,0 +1,102 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerPet.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +inline FString ToString(const SwaggerPet::StatusEnum& Value) +{ + switch (Value) + { + case SwaggerPet::StatusEnum::Available: + return TEXT("available"); + case SwaggerPet::StatusEnum::Pending: + return TEXT("pending"); + case SwaggerPet::StatusEnum::Sold: + return TEXT("sold"); + } + + UE_LOG(LogSwagger, Error, TEXT("Invalid SwaggerPet::StatusEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const SwaggerPet::StatusEnum& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const SwaggerPet::StatusEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, SwaggerPet::StatusEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +void SwaggerPet::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Category.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("category")); WriteJsonValue(Writer, Category.GetValue()); + } + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name); + Writer->WriteIdentifierPrefix(TEXT("photoUrls")); WriteJsonValue(Writer, PhotoUrls); + if (Tags.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("tags")); WriteJsonValue(Writer, Tags.GetValue()); + } + if (Status.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("status")); WriteJsonValue(Writer, Status.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool SwaggerPet::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("category"), Category); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("name"), Name); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("photoUrls"), PhotoUrls); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("tags"), Tags); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("status"), Status); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerPetApi.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerPetApi.cpp new file mode 100644 index 00000000000..e07fe36d1de --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerPetApi.cpp @@ -0,0 +1,304 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerPetApi.h" + +#include "SwaggerPetApiOperations.h" +#include "SwaggerModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace Swagger +{ + +SwaggerPetApi::SwaggerPetApi() +: Url(TEXT("http://petstore.swagger.io/v2")) +{ +} + +SwaggerPetApi::~SwaggerPetApi() {} + +void SwaggerPetApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void SwaggerPetApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void SwaggerPetApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool SwaggerPetApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogSwagger, Error, TEXT("SwaggerPetApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void SwaggerPetApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogSwagger, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +bool SwaggerPetApi::AddPet(const AddPetRequest& Request, const FAddPetDelegate& Delegate /*= FAddPetDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnAddPetResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnAddPetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPetDelegate Delegate) const +{ + AddPetResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerPetApi::DeletePet(const DeletePetRequest& Request, const FDeletePetDelegate& Delegate /*= FDeletePetDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnDeletePetResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnDeletePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePetDelegate Delegate) const +{ + DeletePetResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerPetApi::FindPetsByStatus(const FindPetsByStatusRequest& Request, const FFindPetsByStatusDelegate& Delegate /*= FFindPetsByStatusDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnFindPetsByStatusResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnFindPetsByStatusResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByStatusDelegate Delegate) const +{ + FindPetsByStatusResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerPetApi::FindPetsByTags(const FindPetsByTagsRequest& Request, const FFindPetsByTagsDelegate& Delegate /*= FFindPetsByTagsDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnFindPetsByTagsResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnFindPetsByTagsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByTagsDelegate Delegate) const +{ + FindPetsByTagsResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerPetApi::GetPetById(const GetPetByIdRequest& Request, const FGetPetByIdDelegate& Delegate /*= FGetPetByIdDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnGetPetByIdResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnGetPetByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPetByIdDelegate Delegate) const +{ + GetPetByIdResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerPetApi::UpdatePet(const UpdatePetRequest& Request, const FUpdatePetDelegate& Delegate /*= FUpdatePetDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnUpdatePetResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnUpdatePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetDelegate Delegate) const +{ + UpdatePetResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerPetApi::UpdatePetWithForm(const UpdatePetWithFormRequest& Request, const FUpdatePetWithFormDelegate& Delegate /*= FUpdatePetWithFormDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnUpdatePetWithFormResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnUpdatePetWithFormResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetWithFormDelegate Delegate) const +{ + UpdatePetWithFormResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerPetApi::UploadFile(const UploadFileRequest& Request, const FUploadFileDelegate& Delegate /*= FUploadFileDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerPetApi::OnUploadFileResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerPetApi::OnUploadFileResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUploadFileDelegate Delegate) const +{ + UploadFileResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerPetApiOperations.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerPetApiOperations.cpp new file mode 100644 index 00000000000..41a585bc252 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerPetApiOperations.cpp @@ -0,0 +1,554 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerPetApiOperations.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace Swagger +{ + +FString SwaggerPetApi::AddPetRequest::ComputePath() const +{ + FString Path(TEXT("/pet")); + return Path; +} + +void SwaggerPetApi::AddPetRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json"), TEXT("application/xml") }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, Body); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::AddPetResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 405: + SetResponseString(TEXT("Invalid input")); + break; + } +} + +bool SwaggerPetApi::AddPetResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerPetApi::DeletePetRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}"), PathParams); + + return Path; +} + +void SwaggerPetApi::DeletePetRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("DELETE")); + + // Header parameters + if (ApiKey.IsSet()) + { + HttpRequest->SetHeader(TEXT("api_key"), ApiKey.GetValue()); + } + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::DeletePetResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid pet value")); + break; + } +} + +bool SwaggerPetApi::DeletePetResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +inline FString ToString(const SwaggerPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + switch (Value) + { + case SwaggerPetApi::FindPetsByStatusRequest::StatusEnum::Available: + return TEXT("available"); + case SwaggerPetApi::FindPetsByStatusRequest::StatusEnum::Pending: + return TEXT("pending"); + case SwaggerPetApi::FindPetsByStatusRequest::StatusEnum::Sold: + return TEXT("sold"); + } + + UE_LOG(LogSwagger, Error, TEXT("Invalid SwaggerPetApi::FindPetsByStatusRequest::StatusEnum Value (%d)"), (int)Value); + return TEXT(""); +} + +inline FStringFormatArg ToStringFormatArg(const SwaggerPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + return FStringFormatArg(ToString(Value)); +} + +inline void WriteJsonValue(JsonWriter& Writer, const SwaggerPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + WriteJsonValue(Writer, ToString(Value)); +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, SwaggerPetApi::FindPetsByStatusRequest::StatusEnum& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + static TMap StringToEnum = { + { TEXT("available"), SwaggerPetApi::FindPetsByStatusRequest::StatusEnum::Available }, + { TEXT("pending"), SwaggerPetApi::FindPetsByStatusRequest::StatusEnum::Pending }, + { TEXT("sold"), SwaggerPetApi::FindPetsByStatusRequest::StatusEnum::Sold }, }; + + const auto Found = StringToEnum.Find(TmpValue); + if(Found) + { + Value = *Found; + return true; + } + } + return false; +} + +FString SwaggerPetApi::FindPetsByStatusRequest::ComputePath() const +{ + FString Path(TEXT("/pet/findByStatus")); + TArray QueryParams; + QueryParams.Add(FString(TEXT("status=")) + CollectionToUrlString_csv(Status, TEXT("status"))); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void SwaggerPetApi::FindPetsByStatusRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::FindPetsByStatusResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid status value")); + break; + } +} + +bool SwaggerPetApi::FindPetsByStatusResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString SwaggerPetApi::FindPetsByTagsRequest::ComputePath() const +{ + FString Path(TEXT("/pet/findByTags")); + TArray QueryParams; + QueryParams.Add(FString(TEXT("tags=")) + CollectionToUrlString_csv(Tags, TEXT("tags"))); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void SwaggerPetApi::FindPetsByTagsRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::FindPetsByTagsResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid tag value")); + break; + } +} + +bool SwaggerPetApi::FindPetsByTagsResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString SwaggerPetApi::GetPetByIdRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}"), PathParams); + + return Path; +} + +void SwaggerPetApi::GetPetByIdRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::GetPetByIdResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Pet not found")); + break; + } +} + +bool SwaggerPetApi::GetPetByIdResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString SwaggerPetApi::UpdatePetRequest::ComputePath() const +{ + FString Path(TEXT("/pet")); + return Path; +} + +void SwaggerPetApi::UpdatePetRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/json"), TEXT("application/xml") }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("PUT")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, Body); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::UpdatePetResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Pet not found")); + break; + case 405: + SetResponseString(TEXT("Validation exception")); + break; + } +} + +bool SwaggerPetApi::UpdatePetResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerPetApi::UpdatePetWithFormRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}"), PathParams); + + return Path; +} + +void SwaggerPetApi::UpdatePetWithFormRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("application/x-www-form-urlencoded") }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + UE_LOG(LogSwagger, Error, TEXT("Form parameter (name) was ignored, cannot be used in JsonBody")); + UE_LOG(LogSwagger, Error, TEXT("Form parameter (status) was ignored, cannot be used in JsonBody")); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + HttpMultipartFormData FormData; + if(Name.IsSet()) + { + FormData.AddStringPart(TEXT("name"), *ToUrlString(Name.GetValue())); + } + if(Status.IsSet()) + { + FormData.AddStringPart(TEXT("status"), *ToUrlString(Status.GetValue())); + } + + FormData.SetupHttpRequest(HttpRequest); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + TArray FormParams; + if(Name.IsSet()) + { + FormParams.Add(FString(TEXT("name=")) + ToUrlString(Name.GetValue())); + } + if(Status.IsSet()) + { + FormParams.Add(FString(TEXT("status=")) + ToUrlString(Status.GetValue())); + } + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::UpdatePetWithFormResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 405: + SetResponseString(TEXT("Invalid input")); + break; + } +} + +bool SwaggerPetApi::UpdatePetWithFormResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerPetApi::UploadFileRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("petId"), ToStringFormatArg(PetId) } }; + + FString Path = FString::Format(TEXT("/pet/{petId}/uploadImage"), PathParams); + + return Path; +} + +void SwaggerPetApi::UploadFileRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { TEXT("multipart/form-data") }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + UE_LOG(LogSwagger, Error, TEXT("Form parameter (additionalMetadata) was ignored, cannot be used in JsonBody")); + UE_LOG(LogSwagger, Error, TEXT("Form parameter (file) was ignored, cannot be used in JsonBody")); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + HttpMultipartFormData FormData; + if(AdditionalMetadata.IsSet()) + { + FormData.AddStringPart(TEXT("additionalMetadata"), *ToUrlString(AdditionalMetadata.GetValue())); + } + if(File.IsSet()) + { + FormData.AddFilePart(TEXT("file"), File.GetValue()); + } + + FormData.SetupHttpRequest(HttpRequest); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + TArray FormParams; + if(AdditionalMetadata.IsSet()) + { + FormParams.Add(FString(TEXT("additionalMetadata=")) + ToUrlString(AdditionalMetadata.GetValue())); + } + UE_LOG(LogSwagger, Error, TEXT("Form parameter (file) was ignored, Files are not supported in urlencoded requests")); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/x-www-form-urlencoded; charset=utf-8")); + HttpRequest->SetContentAsString(FString::Join(FormParams, TEXT("&"))); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerPetApi::UploadFileResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool SwaggerPetApi::UploadFileResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerStoreApi.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerStoreApi.cpp new file mode 100644 index 00000000000..00fc94d08d9 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerStoreApi.cpp @@ -0,0 +1,200 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerStoreApi.h" + +#include "SwaggerStoreApiOperations.h" +#include "SwaggerModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace Swagger +{ + +SwaggerStoreApi::SwaggerStoreApi() +: Url(TEXT("http://petstore.swagger.io/v2")) +{ +} + +SwaggerStoreApi::~SwaggerStoreApi() {} + +void SwaggerStoreApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void SwaggerStoreApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void SwaggerStoreApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool SwaggerStoreApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogSwagger, Error, TEXT("SwaggerStoreApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void SwaggerStoreApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogSwagger, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +bool SwaggerStoreApi::DeleteOrder(const DeleteOrderRequest& Request, const FDeleteOrderDelegate& Delegate /*= FDeleteOrderDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerStoreApi::OnDeleteOrderResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerStoreApi::OnDeleteOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteOrderDelegate Delegate) const +{ + DeleteOrderResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerStoreApi::GetInventory(const GetInventoryRequest& Request, const FGetInventoryDelegate& Delegate /*= FGetInventoryDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerStoreApi::OnGetInventoryResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerStoreApi::OnGetInventoryResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetInventoryDelegate Delegate) const +{ + GetInventoryResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerStoreApi::GetOrderById(const GetOrderByIdRequest& Request, const FGetOrderByIdDelegate& Delegate /*= FGetOrderByIdDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerStoreApi::OnGetOrderByIdResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerStoreApi::OnGetOrderByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetOrderByIdDelegate Delegate) const +{ + GetOrderByIdResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerStoreApi::PlaceOrder(const PlaceOrderRequest& Request, const FPlaceOrderDelegate& Delegate /*= FPlaceOrderDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerStoreApi::OnPlaceOrderResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerStoreApi::OnPlaceOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlaceOrderDelegate Delegate) const +{ + PlaceOrderResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerStoreApiOperations.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerStoreApiOperations.cpp new file mode 100644 index 00000000000..68d19799dd9 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerStoreApiOperations.cpp @@ -0,0 +1,239 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerStoreApiOperations.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace Swagger +{ + +FString SwaggerStoreApi::DeleteOrderRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("orderId"), ToStringFormatArg(OrderId) } }; + + FString Path = FString::Format(TEXT("/store/order/{orderId}"), PathParams); + + return Path; +} + +void SwaggerStoreApi::DeleteOrderRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("DELETE")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerStoreApi::DeleteOrderResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Order not found")); + break; + } +} + +bool SwaggerStoreApi::DeleteOrderResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerStoreApi::GetInventoryRequest::ComputePath() const +{ + FString Path(TEXT("/store/inventory")); + return Path; +} + +void SwaggerStoreApi::GetInventoryRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerStoreApi::GetInventoryResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool SwaggerStoreApi::GetInventoryResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString SwaggerStoreApi::GetOrderByIdRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("orderId"), ToStringFormatArg(OrderId) } }; + + FString Path = FString::Format(TEXT("/store/order/{orderId}"), PathParams); + + return Path; +} + +void SwaggerStoreApi::GetOrderByIdRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerStoreApi::GetOrderByIdResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid ID supplied")); + break; + case 404: + SetResponseString(TEXT("Order not found")); + break; + } +} + +bool SwaggerStoreApi::GetOrderByIdResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString SwaggerStoreApi::PlaceOrderRequest::ComputePath() const +{ + FString Path(TEXT("/store/order")); + return Path; +} + +void SwaggerStoreApi::PlaceOrderRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, Body); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerStoreApi::PlaceOrderResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid Order")); + break; + } +} + +bool SwaggerStoreApi::PlaceOrderResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerTag.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerTag.cpp new file mode 100644 index 00000000000..3eadd1eba03 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerTag.cpp @@ -0,0 +1,45 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerTag.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +void SwaggerTag::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Name.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("name")); WriteJsonValue(Writer, Name.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool SwaggerTag::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("name"), Name); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerUser.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerUser.cpp new file mode 100644 index 00000000000..452b5098cc9 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerUser.cpp @@ -0,0 +1,75 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerUser.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Templates/SharedPointer.h" + +namespace Swagger +{ + +void SwaggerUser::WriteJson(JsonWriter& Writer) const +{ + Writer->WriteObjectStart(); + if (Id.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("id")); WriteJsonValue(Writer, Id.GetValue()); + } + if (Username.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("username")); WriteJsonValue(Writer, Username.GetValue()); + } + if (FirstName.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("firstName")); WriteJsonValue(Writer, FirstName.GetValue()); + } + if (LastName.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("lastName")); WriteJsonValue(Writer, LastName.GetValue()); + } + if (Email.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("email")); WriteJsonValue(Writer, Email.GetValue()); + } + if (Password.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("password")); WriteJsonValue(Writer, Password.GetValue()); + } + if (Phone.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("phone")); WriteJsonValue(Writer, Phone.GetValue()); + } + if (UserStatus.IsSet()) + { + Writer->WriteIdentifierPrefix(TEXT("userStatus")); WriteJsonValue(Writer, UserStatus.GetValue()); + } + Writer->WriteObjectEnd(); +} + +bool SwaggerUser::FromJson(const TSharedPtr& JsonObject) +{ + bool ParseSuccess = true; + + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("id"), Id); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("username"), Username); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("firstName"), FirstName); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("lastName"), LastName); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("email"), Email); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("password"), Password); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("phone"), Phone); + ParseSuccess &= TryGetJsonValue(JsonObject, TEXT("userStatus"), UserStatus); + + return ParseSuccess; +} +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerUserApi.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerUserApi.cpp new file mode 100644 index 00000000000..c3a46e0fd86 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerUserApi.cpp @@ -0,0 +1,304 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerUserApi.h" + +#include "SwaggerUserApiOperations.h" +#include "SwaggerModule.h" + +#include "HttpModule.h" +#include "Serialization/JsonSerializer.h" + +namespace Swagger +{ + +SwaggerUserApi::SwaggerUserApi() +: Url(TEXT("http://petstore.swagger.io/v2")) +{ +} + +SwaggerUserApi::~SwaggerUserApi() {} + +void SwaggerUserApi::SetURL(const FString& InUrl) +{ + Url = InUrl; +} + +void SwaggerUserApi::AddHeaderParam(const FString& Key, const FString& Value) +{ + AdditionalHeaderParams.Add(Key, Value); +} + +void SwaggerUserApi::ClearHeaderParams() +{ + AdditionalHeaderParams.Reset(); +} + +bool SwaggerUserApi::IsValid() const +{ + if (Url.IsEmpty()) + { + UE_LOG(LogSwagger, Error, TEXT("SwaggerUserApi: Endpoint Url is not set, request cannot be performed")); + return false; + } + + return true; +} + +void SwaggerUserApi::HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const +{ + InOutResponse.SetHttpResponse(HttpResponse); + InOutResponse.SetSuccessful(bSucceeded); + + if (bSucceeded && HttpResponse.IsValid()) + { + InOutResponse.SetHttpResponseCode((EHttpResponseCodes::Type)HttpResponse->GetResponseCode()); + FString ContentType = HttpResponse->GetContentType(); + FString Content; + + if (ContentType == TEXT("application/json")) + { + Content = HttpResponse->GetContentAsString(); + + TSharedPtr JsonValue; + auto Reader = TJsonReaderFactory<>::Create(Content); + + if (FJsonSerializer::Deserialize(Reader, JsonValue) && JsonValue.IsValid()) + { + if (InOutResponse.FromJson(JsonValue)) + return; // Successfully parsed + } + } + else if(ContentType == TEXT("text/plain")) + { + Content = HttpResponse->GetContentAsString(); + InOutResponse.SetResponseString(Content); + return; // Successfully parsed + } + + // Report the parse error but do not mark the request as unsuccessful. Data could be partial or malformed, but the request succeeded. + UE_LOG(LogSwagger, Error, TEXT("Failed to deserialize Http response content (type:%s):\n%s"), *ContentType , *Content); + return; + } + + // By default, assume we failed to establish connection + InOutResponse.SetHttpResponseCode(EHttpResponseCodes::RequestTimeout); +} + +bool SwaggerUserApi::CreateUser(const CreateUserRequest& Request, const FCreateUserDelegate& Delegate /*= FCreateUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnCreateUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnCreateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUserDelegate Delegate) const +{ + CreateUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerUserApi::CreateUsersWithArrayInput(const CreateUsersWithArrayInputRequest& Request, const FCreateUsersWithArrayInputDelegate& Delegate /*= FCreateUsersWithArrayInputDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnCreateUsersWithArrayInputResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnCreateUsersWithArrayInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithArrayInputDelegate Delegate) const +{ + CreateUsersWithArrayInputResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerUserApi::CreateUsersWithListInput(const CreateUsersWithListInputRequest& Request, const FCreateUsersWithListInputDelegate& Delegate /*= FCreateUsersWithListInputDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnCreateUsersWithListInputResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnCreateUsersWithListInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithListInputDelegate Delegate) const +{ + CreateUsersWithListInputResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerUserApi::DeleteUser(const DeleteUserRequest& Request, const FDeleteUserDelegate& Delegate /*= FDeleteUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnDeleteUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnDeleteUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUserDelegate Delegate) const +{ + DeleteUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerUserApi::GetUserByName(const GetUserByNameRequest& Request, const FGetUserByNameDelegate& Delegate /*= FGetUserByNameDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnGetUserByNameResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnGetUserByNameResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserByNameDelegate Delegate) const +{ + GetUserByNameResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerUserApi::LoginUser(const LoginUserRequest& Request, const FLoginUserDelegate& Delegate /*= FLoginUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnLoginUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnLoginUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginUserDelegate Delegate) const +{ + LoginUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerUserApi::LogoutUser(const LogoutUserRequest& Request, const FLogoutUserDelegate& Delegate /*= FLogoutUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnLogoutUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnLogoutUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLogoutUserDelegate Delegate) const +{ + LogoutUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +bool SwaggerUserApi::UpdateUser(const UpdateUserRequest& Request, const FUpdateUserDelegate& Delegate /*= FUpdateUserDelegate()*/) const +{ + if (!IsValid()) + return false; + + TSharedRef HttpRequest = FHttpModule::Get().CreateRequest(); + HttpRequest->SetURL(*(Url + Request.ComputePath())); + + for(const auto& It : AdditionalHeaderParams) + { + HttpRequest->SetHeader(It.Key, It.Value); + } + + Request.SetupHttpRequest(HttpRequest); + + HttpRequest->OnProcessRequestComplete().BindRaw(this, &SwaggerUserApi::OnUpdateUserResponse, Delegate); + return HttpRequest->ProcessRequest(); +} + +void SwaggerUserApi::OnUpdateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDelegate Delegate) const +{ + UpdateUserResponse Response; + HandleResponse(HttpResponse, bSucceeded, Response); + Delegate.ExecuteIfBound(Response); +} + +} diff --git a/samples/client/petstore/ue4cpp/Private/SwaggerUserApiOperations.cpp b/samples/client/petstore/ue4cpp/Private/SwaggerUserApiOperations.cpp new file mode 100644 index 00000000000..79142b9f794 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Private/SwaggerUserApiOperations.cpp @@ -0,0 +1,468 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#include "SwaggerUserApiOperations.h" + +#include "SwaggerModule.h" +#include "SwaggerHelpers.h" + +#include "Dom/JsonObject.h" +#include "Templates/SharedPointer.h" +#include "HttpModule.h" +#include "PlatformHttp.h" + +namespace Swagger +{ + +FString SwaggerUserApi::CreateUserRequest::ComputePath() const +{ + FString Path(TEXT("/user")); + return Path; +} + +void SwaggerUserApi::CreateUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, Body); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::CreateUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool SwaggerUserApi::CreateUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerUserApi::CreateUsersWithArrayInputRequest::ComputePath() const +{ + FString Path(TEXT("/user/createWithArray")); + return Path; +} + +void SwaggerUserApi::CreateUsersWithArrayInputRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, Body); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::CreateUsersWithArrayInputResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool SwaggerUserApi::CreateUsersWithArrayInputResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerUserApi::CreateUsersWithListInputRequest::ComputePath() const +{ + FString Path(TEXT("/user/createWithList")); + return Path; +} + +void SwaggerUserApi::CreateUsersWithListInputRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("POST")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, Body); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::CreateUsersWithListInputResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool SwaggerUserApi::CreateUsersWithListInputResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerUserApi::DeleteUserRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("username"), ToStringFormatArg(Username) } }; + + FString Path = FString::Format(TEXT("/user/{username}"), PathParams); + + return Path; +} + +void SwaggerUserApi::DeleteUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("DELETE")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::DeleteUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid username supplied")); + break; + case 404: + SetResponseString(TEXT("User not found")); + break; + } +} + +bool SwaggerUserApi::DeleteUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerUserApi::GetUserByNameRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("username"), ToStringFormatArg(Username) } }; + + FString Path = FString::Format(TEXT("/user/{username}"), PathParams); + + return Path; +} + +void SwaggerUserApi::GetUserByNameRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::GetUserByNameResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid username supplied")); + break; + case 404: + SetResponseString(TEXT("User not found")); + break; + } +} + +bool SwaggerUserApi::GetUserByNameResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString SwaggerUserApi::LoginUserRequest::ComputePath() const +{ + FString Path(TEXT("/user/login")); + TArray QueryParams; + QueryParams.Add(FString(TEXT("username=")) + ToUrlString(Username)); + QueryParams.Add(FString(TEXT("password=")) + ToUrlString(Password)); + Path += TCHAR('?'); + Path += FString::Join(QueryParams, TEXT("&")); + + return Path; +} + +void SwaggerUserApi::LoginUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::LoginUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 200: + default: + SetResponseString(TEXT("successful operation")); + break; + case 400: + SetResponseString(TEXT("Invalid username/password supplied")); + break; + } +} + +bool SwaggerUserApi::LoginUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return TryGetJsonValue(JsonValue, Content); +} + +FString SwaggerUserApi::LogoutUserRequest::ComputePath() const +{ + FString Path(TEXT("/user/logout")); + return Path; +} + +void SwaggerUserApi::LogoutUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("GET")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::LogoutUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 0: + default: + SetResponseString(TEXT("successful operation")); + break; + } +} + +bool SwaggerUserApi::LogoutUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +FString SwaggerUserApi::UpdateUserRequest::ComputePath() const +{ + TMap PathParams = { + { TEXT("username"), ToStringFormatArg(Username) } }; + + FString Path = FString::Format(TEXT("/user/{username}"), PathParams); + + return Path; +} + +void SwaggerUserApi::UpdateUserRequest::SetupHttpRequest(const TSharedRef& HttpRequest) const +{ + static const TArray Consumes = { }; + //static const TArray Produces = { TEXT("application/xml"), TEXT("application/json") }; + + HttpRequest->SetVerb(TEXT("PUT")); + + // Default to Json Body request + if (Consumes.Num() == 0 || Consumes.Contains(TEXT("application/json"))) + { + // Body parameters + FString JsonBody; + JsonWriter Writer = TJsonWriterFactory<>::Create(&JsonBody); + + WriteJsonValue(Writer, Body); + Writer->Close(); + + HttpRequest->SetHeader(TEXT("Content-Type"), TEXT("application/json; charset=utf-8")); + HttpRequest->SetContentAsString(JsonBody); + } + else if (Consumes.Contains(TEXT("multipart/form-data"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in multipart form")); + } + else if (Consumes.Contains(TEXT("application/x-www-form-urlencoded"))) + { + UE_LOG(LogSwagger, Error, TEXT("Body parameter (body) was ignored, not supported in urlencoded requests")); + } + else + { + UE_LOG(LogSwagger, Error, TEXT("Request ContentType not supported (%s)"), *FString::Join(Consumes, TEXT(","))); + } +} + +void SwaggerUserApi::UpdateUserResponse::SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) +{ + Response::SetHttpResponseCode(InHttpResponseCode); + switch ((int)InHttpResponseCode) + { + case 400: + SetResponseString(TEXT("Invalid user supplied")); + break; + case 404: + SetResponseString(TEXT("User not found")); + break; + } +} + +bool SwaggerUserApi::UpdateUserResponse::FromJson(const TSharedPtr& JsonValue) +{ + return true; +} + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerAmount.h b/samples/client/petstore/ue4cpp/Public/SwaggerAmount.h new file mode 100644 index 00000000000..a411c93f903 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerAmount.h @@ -0,0 +1,37 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" +#include "SwaggerCurrency.h" + +namespace Swagger +{ + +/* + * SwaggerAmount + * + * some description + */ +class SWAGGER_API SwaggerAmount : public Model +{ +public: + virtual ~SwaggerAmount() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + /* some description */ + double Value = 0.0; + SwaggerCurrency Currency; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerApiResponse.h b/samples/client/petstore/ue4cpp/Public/SwaggerApiResponse.h new file mode 100644 index 00000000000..5be29f14063 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerApiResponse.h @@ -0,0 +1,36 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +/* + * SwaggerApiResponse + * + * Describes the result of uploading an image resource + */ +class SWAGGER_API SwaggerApiResponse : public Model +{ +public: + virtual ~SwaggerApiResponse() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Code; + TOptional Type; + TOptional Message; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerBaseModel.h b/samples/client/petstore/ue4cpp/Public/SwaggerBaseModel.h new file mode 100644 index 00000000000..c8a7d58556d --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerBaseModel.h @@ -0,0 +1,65 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "Interfaces/IHttpRequest.h" +#include "Interfaces/IHttpResponse.h" +#include "Serialization/JsonWriter.h" +#include "Dom/JsonObject.h" + +namespace Swagger +{ + +typedef TSharedRef> JsonWriter; + +class SWAGGER_API Model +{ +public: + virtual ~Model() {} + virtual void WriteJson(JsonWriter& Writer) const = 0; + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; +}; + +class SWAGGER_API Request +{ +public: + virtual ~Request() {} + virtual void SetupHttpRequest(const TSharedRef& HttpRequest) const = 0; + virtual FString ComputePath() const = 0; +}; + +class SWAGGER_API Response +{ +public: + virtual ~Response() {} + virtual bool FromJson(const TSharedPtr& JsonObject) = 0; + + void SetSuccessful(bool InSuccessful) { Successful = InSuccessful; } + bool IsSuccessful() const { return Successful; } + + virtual void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode); + EHttpResponseCodes::Type GetHttpResponseCode() const { return ResponseCode; } + + void SetResponseString(const FString& InResponseString) { ResponseString = InResponseString; } + const FString& GetResponseString() const { return ResponseString; } + + void SetHttpResponse(const FHttpResponsePtr& InHttpResponse) { HttpResponse = InHttpResponse; } + const FHttpResponsePtr& GetHttpResponse() const { return HttpResponse; } + +private: + bool Successful; + EHttpResponseCodes::Type ResponseCode; + FString ResponseString; + FHttpResponsePtr HttpResponse; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerCategory.h b/samples/client/petstore/ue4cpp/Public/SwaggerCategory.h new file mode 100644 index 00000000000..11b1234f123 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerCategory.h @@ -0,0 +1,35 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +/* + * SwaggerCategory + * + * A category for a pet + */ +class SWAGGER_API SwaggerCategory : public Model +{ +public: + virtual ~SwaggerCategory() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Name; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerCurrency.h b/samples/client/petstore/ue4cpp/Public/SwaggerCurrency.h new file mode 100644 index 00000000000..7c7e6619e51 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerCurrency.h @@ -0,0 +1,33 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +/* + * SwaggerCurrency + * + * some description + */ +class SWAGGER_API SwaggerCurrency : public Model +{ +public: + virtual ~SwaggerCurrency() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerHelpers.h b/samples/client/petstore/ue4cpp/Public/SwaggerHelpers.h new file mode 100644 index 00000000000..793a785b10e --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerHelpers.h @@ -0,0 +1,411 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +#include "Serialization/JsonSerializer.h" +#include "Dom/JsonObject.h" +#include "Misc/Base64.h" + +class IHttpRequest; + +namespace Swagger +{ + +typedef TSharedRef> JsonWriter; + +////////////////////////////////////////////////////////////////////////// + +class SWAGGER_API HttpFileInput +{ +public: + HttpFileInput(const TCHAR* InFilePath); + HttpFileInput(const FString& InFilePath); + + // This will automatically set the content type if not already set + void SetFilePath(const TCHAR* InFilePath); + void SetFilePath(const FString& InFilePath); + + // Optional if it can be deduced from the FilePath + void SetContentType(const TCHAR* ContentType); + + HttpFileInput& operator=(const HttpFileInput& Other) = default; + HttpFileInput& operator=(const FString& InFilePath) { SetFilePath(*InFilePath); return*this; } + HttpFileInput& operator=(const TCHAR* InFilePath) { SetFilePath(InFilePath); return*this; } + + const FString& GetFilePath() const { return FilePath; } + const FString& GetContentType() const { return ContentType; } + + // Returns the filename with extension + FString GetFilename() const; + +private: + FString FilePath; + FString ContentType; +}; + +////////////////////////////////////////////////////////////////////////// + +class HttpMultipartFormData +{ +public: + void SetBoundary(const TCHAR* InBoundary); + void SetupHttpRequest(const TSharedRef& HttpRequest); + + void AddStringPart(const TCHAR* Name, const TCHAR* Data); + void AddJsonPart(const TCHAR* Name, const FString& JsonString); + void AddBinaryPart(const TCHAR* Name, const TArray& ByteArray); + void AddFilePart(const TCHAR* Name, const HttpFileInput& File); + +private: + void AppendString(const TCHAR* Str); + const FString& GetBoundary() const; + + mutable FString Boundary; + TArray FormData; + + static const TCHAR* Delimiter; + static const TCHAR* Newline; +}; + +////////////////////////////////////////////////////////////////////////// + +// Decodes Base64Url encoded strings, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +bool Base64UrlDecode(const FString& Base64String, T& Value) +{ + FString TmpCopy(Base64String); + TmpCopy.ReplaceInline(TEXT("-"), TEXT("+")); + TmpCopy.ReplaceInline(TEXT("_"), TEXT("/")); + + return FBase64::Decode(TmpCopy, Value); +} + +// Encodes strings in Base64Url, see https://en.wikipedia.org/wiki/Base64#Variants_summary_table +template +FString Base64UrlEncode(const T& Value) +{ + FString Base64String = FBase64::Encode(Value); + Base64String.ReplaceInline(TEXT("+"), TEXT("-")); + Base64String.ReplaceInline(TEXT("/"), TEXT("_")); + return Base64String; +} + +template +inline FStringFormatArg ToStringFormatArg(const T& Value) +{ + return FStringFormatArg(Value); +} + +inline FStringFormatArg ToStringFormatArg(const FDateTime& Value) +{ + return FStringFormatArg(Value.ToIso8601()); +} + +inline FStringFormatArg ToStringFormatArg(const TArray& Value) +{ + return FStringFormatArg(Base64UrlEncode(Value)); +} + +template::value, int>::type = 0> +inline FString ToString(const T& Value) +{ + return FString::Format(TEXT("{0}"), { ToStringFormatArg(Value) }); +} + +inline FString ToString(const FString& Value) +{ + return Value; +} + +inline FString ToString(const TArray& Value) +{ + return Base64UrlEncode(Value); +} + +inline FString ToString(const Model& Value) +{ + FString String; + JsonWriter Writer = TJsonWriterFactory<>::Create(&String); + Value.WriteJson(Writer); + Writer->Close(); + return String; +} + +template +inline FString ToUrlString(const T& Value) +{ + return FPlatformHttp::UrlEncode(ToString(Value)); +} + +template +inline FString CollectionToUrlString(const TArray& Collection, const TCHAR* Separator) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += ToUrlString(Collection[0]); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("{0}{1}"), { Separator, *ToUrlString(Collection[i]) }); + } + return Output; +} + +template +inline FString CollectionToUrlString_csv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(",")); +} + +template +inline FString CollectionToUrlString_ssv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT(" ")); +} + +template +inline FString CollectionToUrlString_tsv(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("\t")); +} + +template +inline FString CollectionToUrlString_pipes(const TArray& Collection, const TCHAR* BaseName) +{ + return CollectionToUrlString(Collection, TEXT("|")); +} + +template +inline FString CollectionToUrlString_multi(const TArray& Collection, const TCHAR* BaseName) +{ + FString Output; + if(Collection.Num() == 0) + return Output; + + Output += FString::Format(TEXT("{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[0]) }); + for(int i = 1; i < Collection.Num(); i++) + { + Output += FString::Format(TEXT("&{0}={1}"), { FStringFormatArg(BaseName), ToUrlString(Collection[i]) }); + } + return Output; +} + +////////////////////////////////////////////////////////////////////////// + +template::value, int>::type = 0> +inline void WriteJsonValue(JsonWriter& Writer, const T& Value) +{ + Writer->WriteValue(Value); +} + +inline void WriteJsonValue(JsonWriter& Writer, const FDateTime& Value) +{ + Writer->WriteValue(Value.ToIso8601()); +} + +inline void WriteJsonValue(JsonWriter& Writer, const Model& Value) +{ + Value.WriteJson(Writer); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteArrayStart(); + for (const auto& Element : Value) + { + WriteJsonValue(Writer, Element); + } + Writer->WriteArrayEnd(); +} + +template +inline void WriteJsonValue(JsonWriter& Writer, const TMap& Value) +{ + Writer->WriteObjectStart(); + for (const auto& It : Value) + { + Writer->WriteIdentifierPrefix(It.Key); + WriteJsonValue(Writer, It.Value); + } + Writer->WriteObjectEnd(); +} + +inline void WriteJsonValue(JsonWriter& Writer, const TSharedPtr& Value) +{ + if (Value.IsValid()) + { + FJsonSerializer::Serialize(Value.ToSharedRef(), Writer, false); + } + else + { + Writer->WriteObjectStart(); + Writer->WriteObjectEnd(); + } +} + +inline void WriteJsonValue(JsonWriter& Writer, const TArray& Value) +{ + Writer->WriteValue(ToString(Value)); +} + +////////////////////////////////////////////////////////////////////////// + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, T& Value) +{ + const TSharedPtr JsonValue = JsonObject->TryGetField(Key); + if (JsonValue.IsValid() && !JsonValue->IsNull()) + { + return TryGetJsonValue(JsonValue, Value); + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonObject, const FString& Key, TOptional& OptionalValue) +{ + if(JsonObject->HasField(Key)) + { + T Value; + if (TryGetJsonValue(JsonObject, Key, Value)) + { + OptionalValue = Value; + return true; + } + else + return false; + } + return true; // Absence of optional value is not a parsing error +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FString& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, FDateTime& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + return FDateTime::Parse(TmpValue, Value); + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, bool& Value) +{ + bool TmpValue; + if (JsonValue->TryGetBool(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +template::value, int>::type = 0> +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, T& Value) +{ + T TmpValue; + if (JsonValue->TryGetNumber(TmpValue)) + { + Value = TmpValue; + return true; + } + else + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, Model& Value) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + return Value.FromJson(*Object); + else + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& ArrayValue) +{ + const TArray>* JsonArray; + if (JsonValue->TryGetArray(JsonArray)) + { + bool ParseSuccess = true; + const int32 Count = JsonArray->Num(); + ArrayValue.Reset(Count); + for (int i = 0; i < Count; i++) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue((*JsonArray)[i], TmpValue); + ArrayValue.Emplace(MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +template +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TMap& MapValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + MapValue.Reset(); + bool ParseSuccess = true; + for (const auto& It : (*Object)->Values) + { + T TmpValue; + ParseSuccess &= TryGetJsonValue(It.Value, TmpValue); + MapValue.Emplace(It.Key, MoveTemp(TmpValue)); + } + return ParseSuccess; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TSharedPtr& JsonObjectValue) +{ + const TSharedPtr* Object; + if (JsonValue->TryGetObject(Object)) + { + JsonObjectValue = *Object; + return true; + } + return false; +} + +inline bool TryGetJsonValue(const TSharedPtr& JsonValue, TArray& Value) +{ + FString TmpValue; + if (JsonValue->TryGetString(TmpValue)) + { + Base64UrlDecode(TmpValue, Value); + return true; + } + else + return false; +} + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerOrder.h b/samples/client/petstore/ue4cpp/Public/SwaggerOrder.h new file mode 100644 index 00000000000..849ca17b99e --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerOrder.h @@ -0,0 +1,46 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +/* + * SwaggerOrder + * + * An order for a pets from the pet store + */ +class SWAGGER_API SwaggerOrder : public Model +{ +public: + virtual ~SwaggerOrder() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional PetId; + TOptional Quantity; + TOptional ShipDate; + enum class StatusEnum + { + Placed, + Approved, + Delivered, + }; + /* Order Status */ + TOptional Status; + TOptional Complete; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerPet.h b/samples/client/petstore/ue4cpp/Public/SwaggerPet.h new file mode 100644 index 00000000000..5dddeb39b6e --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerPet.h @@ -0,0 +1,48 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" +#include "SwaggerCategory.h" +#include "SwaggerTag.h" + +namespace Swagger +{ + +/* + * SwaggerPet + * + * A pet for sale in the pet store + */ +class SWAGGER_API SwaggerPet : public Model +{ +public: + virtual ~SwaggerPet() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Category; + FString Name; + TArray PhotoUrls; + TOptional> Tags; + enum class StatusEnum + { + Available, + Pending, + Sold, + }; + /* pet status in the store */ + TOptional Status; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerPetApi.h b/samples/client/petstore/ue4cpp/Public/SwaggerPetApi.h new file mode 100644 index 00000000000..682add3d9af --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerPetApi.h @@ -0,0 +1,82 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "CoreMinimal.h" +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +class SWAGGER_API SwaggerPetApi +{ +public: + SwaggerPetApi(); + ~SwaggerPetApi(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + class AddPetRequest; + class AddPetResponse; + class DeletePetRequest; + class DeletePetResponse; + class FindPetsByStatusRequest; + class FindPetsByStatusResponse; + class FindPetsByTagsRequest; + class FindPetsByTagsResponse; + class GetPetByIdRequest; + class GetPetByIdResponse; + class UpdatePetRequest; + class UpdatePetResponse; + class UpdatePetWithFormRequest; + class UpdatePetWithFormResponse; + class UploadFileRequest; + class UploadFileResponse; + + DECLARE_DELEGATE_OneParam(FAddPetDelegate, const AddPetResponse&); + DECLARE_DELEGATE_OneParam(FDeletePetDelegate, const DeletePetResponse&); + DECLARE_DELEGATE_OneParam(FFindPetsByStatusDelegate, const FindPetsByStatusResponse&); + DECLARE_DELEGATE_OneParam(FFindPetsByTagsDelegate, const FindPetsByTagsResponse&); + DECLARE_DELEGATE_OneParam(FGetPetByIdDelegate, const GetPetByIdResponse&); + DECLARE_DELEGATE_OneParam(FUpdatePetDelegate, const UpdatePetResponse&); + DECLARE_DELEGATE_OneParam(FUpdatePetWithFormDelegate, const UpdatePetWithFormResponse&); + DECLARE_DELEGATE_OneParam(FUploadFileDelegate, const UploadFileResponse&); + + bool AddPet(const AddPetRequest& Request, const FAddPetDelegate& Delegate = FAddPetDelegate()) const; + bool DeletePet(const DeletePetRequest& Request, const FDeletePetDelegate& Delegate = FDeletePetDelegate()) const; + bool FindPetsByStatus(const FindPetsByStatusRequest& Request, const FFindPetsByStatusDelegate& Delegate = FFindPetsByStatusDelegate()) const; + bool FindPetsByTags(const FindPetsByTagsRequest& Request, const FFindPetsByTagsDelegate& Delegate = FFindPetsByTagsDelegate()) const; + bool GetPetById(const GetPetByIdRequest& Request, const FGetPetByIdDelegate& Delegate = FGetPetByIdDelegate()) const; + bool UpdatePet(const UpdatePetRequest& Request, const FUpdatePetDelegate& Delegate = FUpdatePetDelegate()) const; + bool UpdatePetWithForm(const UpdatePetWithFormRequest& Request, const FUpdatePetWithFormDelegate& Delegate = FUpdatePetWithFormDelegate()) const; + bool UploadFile(const UploadFileRequest& Request, const FUploadFileDelegate& Delegate = FUploadFileDelegate()) const; + +private: + void OnAddPetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FAddPetDelegate Delegate) const; + void OnDeletePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeletePetDelegate Delegate) const; + void OnFindPetsByStatusResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByStatusDelegate Delegate) const; + void OnFindPetsByTagsResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FFindPetsByTagsDelegate Delegate) const; + void OnGetPetByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetPetByIdDelegate Delegate) const; + void OnUpdatePetResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetDelegate Delegate) const; + void OnUpdatePetWithFormResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdatePetWithFormDelegate Delegate) const; + void OnUploadFileResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUploadFileDelegate Delegate) const; + + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerPetApiOperations.h b/samples/client/petstore/ue4cpp/Public/SwaggerPetApiOperations.h new file mode 100644 index 00000000000..90050658ccb --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerPetApiOperations.h @@ -0,0 +1,239 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" +#include "SwaggerPetApi.h" + +#include "SwaggerHelpers.h" +#include "SwaggerApiResponse.h" +#include "SwaggerPet.h" + +namespace Swagger +{ + +/* Add a new pet to the store + * + * +*/ +class SWAGGER_API SwaggerPetApi::AddPetRequest : public Request +{ +public: + virtual ~AddPetRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Pet object that needs to be added to the store */ + SwaggerPet Body; +}; + +class SWAGGER_API SwaggerPetApi::AddPetResponse : public Response +{ +public: + virtual ~AddPetResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Deletes a pet + * + * +*/ +class SWAGGER_API SwaggerPetApi::DeletePetRequest : public Request +{ +public: + virtual ~DeletePetRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Pet id to delete */ + int64 PetId; + TOptional ApiKey; +}; + +class SWAGGER_API SwaggerPetApi::DeletePetResponse : public Response +{ +public: + virtual ~DeletePetResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Finds Pets by status + * + * Multiple status values can be provided with comma separated strings +*/ +class SWAGGER_API SwaggerPetApi::FindPetsByStatusRequest : public Request +{ +public: + virtual ~FindPetsByStatusRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + enum class StatusEnum + { + Available, + Pending, + Sold, + }; + /* Status values that need to be considered for filter */ + TArray Status; +}; + +class SWAGGER_API SwaggerPetApi::FindPetsByStatusResponse : public Response +{ +public: + virtual ~FindPetsByStatusResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + TArray Content; +}; + +/* Finds Pets by tags + * + * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. +*/ +class SWAGGER_API SwaggerPetApi::FindPetsByTagsRequest : public Request +{ +public: + virtual ~FindPetsByTagsRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Tags to filter by */ + TArray Tags; +}; + +class SWAGGER_API SwaggerPetApi::FindPetsByTagsResponse : public Response +{ +public: + virtual ~FindPetsByTagsResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + TArray Content; +}; + +/* Find pet by ID + * + * Returns a single pet +*/ +class SWAGGER_API SwaggerPetApi::GetPetByIdRequest : public Request +{ +public: + virtual ~GetPetByIdRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet to return */ + int64 PetId; +}; + +class SWAGGER_API SwaggerPetApi::GetPetByIdResponse : public Response +{ +public: + virtual ~GetPetByIdResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + SwaggerPet Content; +}; + +/* Update an existing pet + * + * +*/ +class SWAGGER_API SwaggerPetApi::UpdatePetRequest : public Request +{ +public: + virtual ~UpdatePetRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Pet object that needs to be added to the store */ + SwaggerPet Body; +}; + +class SWAGGER_API SwaggerPetApi::UpdatePetResponse : public Response +{ +public: + virtual ~UpdatePetResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Updates a pet in the store with form data + * + * +*/ +class SWAGGER_API SwaggerPetApi::UpdatePetWithFormRequest : public Request +{ +public: + virtual ~UpdatePetWithFormRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet that needs to be updated */ + int64 PetId; + /* Updated name of the pet */ + TOptional Name; + /* Updated status of the pet */ + TOptional Status; +}; + +class SWAGGER_API SwaggerPetApi::UpdatePetWithFormResponse : public Response +{ +public: + virtual ~UpdatePetWithFormResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* uploads an image + * + * +*/ +class SWAGGER_API SwaggerPetApi::UploadFileRequest : public Request +{ +public: + virtual ~UploadFileRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet to update */ + int64 PetId; + /* Additional data to pass to server */ + TOptional AdditionalMetadata; + /* file to upload */ + TOptional File; +}; + +class SWAGGER_API SwaggerPetApi::UploadFileResponse : public Response +{ +public: + virtual ~UploadFileResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + SwaggerApiResponse Content; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerStoreApi.h b/samples/client/petstore/ue4cpp/Public/SwaggerStoreApi.h new file mode 100644 index 00000000000..8e29399d200 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerStoreApi.h @@ -0,0 +1,62 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "CoreMinimal.h" +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +class SWAGGER_API SwaggerStoreApi +{ +public: + SwaggerStoreApi(); + ~SwaggerStoreApi(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + class DeleteOrderRequest; + class DeleteOrderResponse; + class GetInventoryRequest; + class GetInventoryResponse; + class GetOrderByIdRequest; + class GetOrderByIdResponse; + class PlaceOrderRequest; + class PlaceOrderResponse; + + DECLARE_DELEGATE_OneParam(FDeleteOrderDelegate, const DeleteOrderResponse&); + DECLARE_DELEGATE_OneParam(FGetInventoryDelegate, const GetInventoryResponse&); + DECLARE_DELEGATE_OneParam(FGetOrderByIdDelegate, const GetOrderByIdResponse&); + DECLARE_DELEGATE_OneParam(FPlaceOrderDelegate, const PlaceOrderResponse&); + + bool DeleteOrder(const DeleteOrderRequest& Request, const FDeleteOrderDelegate& Delegate = FDeleteOrderDelegate()) const; + bool GetInventory(const GetInventoryRequest& Request, const FGetInventoryDelegate& Delegate = FGetInventoryDelegate()) const; + bool GetOrderById(const GetOrderByIdRequest& Request, const FGetOrderByIdDelegate& Delegate = FGetOrderByIdDelegate()) const; + bool PlaceOrder(const PlaceOrderRequest& Request, const FPlaceOrderDelegate& Delegate = FPlaceOrderDelegate()) const; + +private: + void OnDeleteOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteOrderDelegate Delegate) const; + void OnGetInventoryResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetInventoryDelegate Delegate) const; + void OnGetOrderByIdResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetOrderByIdDelegate Delegate) const; + void OnPlaceOrderResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FPlaceOrderDelegate Delegate) const; + + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerStoreApiOperations.h b/samples/client/petstore/ue4cpp/Public/SwaggerStoreApiOperations.h new file mode 100644 index 00000000000..422a45fa5cb --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerStoreApiOperations.h @@ -0,0 +1,120 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" +#include "SwaggerStoreApi.h" + +#include "SwaggerOrder.h" + +namespace Swagger +{ + +/* Delete purchase order by ID + * + * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors +*/ +class SWAGGER_API SwaggerStoreApi::DeleteOrderRequest : public Request +{ +public: + virtual ~DeleteOrderRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of the order that needs to be deleted */ + FString OrderId; +}; + +class SWAGGER_API SwaggerStoreApi::DeleteOrderResponse : public Response +{ +public: + virtual ~DeleteOrderResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Returns pet inventories by status + * + * Returns a map of status codes to quantities +*/ +class SWAGGER_API SwaggerStoreApi::GetInventoryRequest : public Request +{ +public: + virtual ~GetInventoryRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + +}; + +class SWAGGER_API SwaggerStoreApi::GetInventoryResponse : public Response +{ +public: + virtual ~GetInventoryResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + TMap Content; +}; + +/* Find purchase order by ID + * + * For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions +*/ +class SWAGGER_API SwaggerStoreApi::GetOrderByIdRequest : public Request +{ +public: + virtual ~GetOrderByIdRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* ID of pet that needs to be fetched */ + int64 OrderId; +}; + +class SWAGGER_API SwaggerStoreApi::GetOrderByIdResponse : public Response +{ +public: + virtual ~GetOrderByIdResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + SwaggerOrder Content; +}; + +/* Place an order for a pet + * + * +*/ +class SWAGGER_API SwaggerStoreApi::PlaceOrderRequest : public Request +{ +public: + virtual ~PlaceOrderRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* order placed for purchasing the pet */ + SwaggerOrder Body; +}; + +class SWAGGER_API SwaggerStoreApi::PlaceOrderResponse : public Response +{ +public: + virtual ~PlaceOrderResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + SwaggerOrder Content; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerTag.h b/samples/client/petstore/ue4cpp/Public/SwaggerTag.h new file mode 100644 index 00000000000..95c93201771 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerTag.h @@ -0,0 +1,35 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +/* + * SwaggerTag + * + * A tag for a pet + */ +class SWAGGER_API SwaggerTag : public Model +{ +public: + virtual ~SwaggerTag() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Name; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerUser.h b/samples/client/petstore/ue4cpp/Public/SwaggerUser.h new file mode 100644 index 00000000000..ac45e37fc88 --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerUser.h @@ -0,0 +1,42 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +/* + * SwaggerUser + * + * A User who is purchasing from the pet store + */ +class SWAGGER_API SwaggerUser : public Model +{ +public: + virtual ~SwaggerUser() {} + bool FromJson(const TSharedPtr& JsonObject) final; + void WriteJson(JsonWriter& Writer) const final; + + TOptional Id; + TOptional Username; + TOptional FirstName; + TOptional LastName; + TOptional Email; + TOptional Password; + TOptional Phone; + /* User Status */ + TOptional UserStatus; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerUserApi.h b/samples/client/petstore/ue4cpp/Public/SwaggerUserApi.h new file mode 100644 index 00000000000..2784a04f53c --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerUserApi.h @@ -0,0 +1,82 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "CoreMinimal.h" +#include "SwaggerBaseModel.h" + +namespace Swagger +{ + +class SWAGGER_API SwaggerUserApi +{ +public: + SwaggerUserApi(); + ~SwaggerUserApi(); + + void SetURL(const FString& Url); + void AddHeaderParam(const FString& Key, const FString& Value); + void ClearHeaderParams(); + + class CreateUserRequest; + class CreateUserResponse; + class CreateUsersWithArrayInputRequest; + class CreateUsersWithArrayInputResponse; + class CreateUsersWithListInputRequest; + class CreateUsersWithListInputResponse; + class DeleteUserRequest; + class DeleteUserResponse; + class GetUserByNameRequest; + class GetUserByNameResponse; + class LoginUserRequest; + class LoginUserResponse; + class LogoutUserRequest; + class LogoutUserResponse; + class UpdateUserRequest; + class UpdateUserResponse; + + DECLARE_DELEGATE_OneParam(FCreateUserDelegate, const CreateUserResponse&); + DECLARE_DELEGATE_OneParam(FCreateUsersWithArrayInputDelegate, const CreateUsersWithArrayInputResponse&); + DECLARE_DELEGATE_OneParam(FCreateUsersWithListInputDelegate, const CreateUsersWithListInputResponse&); + DECLARE_DELEGATE_OneParam(FDeleteUserDelegate, const DeleteUserResponse&); + DECLARE_DELEGATE_OneParam(FGetUserByNameDelegate, const GetUserByNameResponse&); + DECLARE_DELEGATE_OneParam(FLoginUserDelegate, const LoginUserResponse&); + DECLARE_DELEGATE_OneParam(FLogoutUserDelegate, const LogoutUserResponse&); + DECLARE_DELEGATE_OneParam(FUpdateUserDelegate, const UpdateUserResponse&); + + bool CreateUser(const CreateUserRequest& Request, const FCreateUserDelegate& Delegate = FCreateUserDelegate()) const; + bool CreateUsersWithArrayInput(const CreateUsersWithArrayInputRequest& Request, const FCreateUsersWithArrayInputDelegate& Delegate = FCreateUsersWithArrayInputDelegate()) const; + bool CreateUsersWithListInput(const CreateUsersWithListInputRequest& Request, const FCreateUsersWithListInputDelegate& Delegate = FCreateUsersWithListInputDelegate()) const; + bool DeleteUser(const DeleteUserRequest& Request, const FDeleteUserDelegate& Delegate = FDeleteUserDelegate()) const; + bool GetUserByName(const GetUserByNameRequest& Request, const FGetUserByNameDelegate& Delegate = FGetUserByNameDelegate()) const; + bool LoginUser(const LoginUserRequest& Request, const FLoginUserDelegate& Delegate = FLoginUserDelegate()) const; + bool LogoutUser(const LogoutUserRequest& Request, const FLogoutUserDelegate& Delegate = FLogoutUserDelegate()) const; + bool UpdateUser(const UpdateUserRequest& Request, const FUpdateUserDelegate& Delegate = FUpdateUserDelegate()) const; + +private: + void OnCreateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUserDelegate Delegate) const; + void OnCreateUsersWithArrayInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithArrayInputDelegate Delegate) const; + void OnCreateUsersWithListInputResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FCreateUsersWithListInputDelegate Delegate) const; + void OnDeleteUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FDeleteUserDelegate Delegate) const; + void OnGetUserByNameResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FGetUserByNameDelegate Delegate) const; + void OnLoginUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLoginUserDelegate Delegate) const; + void OnLogoutUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FLogoutUserDelegate Delegate) const; + void OnUpdateUserResponse(FHttpRequestPtr HttpRequest, FHttpResponsePtr HttpResponse, bool bSucceeded, FUpdateUserDelegate Delegate) const; + + bool IsValid() const; + void HandleResponse(FHttpResponsePtr HttpResponse, bool bSucceeded, Response& InOutResponse) const; + + FString Url; + TMap AdditionalHeaderParams; +}; + +} diff --git a/samples/client/petstore/ue4cpp/Public/SwaggerUserApiOperations.h b/samples/client/petstore/ue4cpp/Public/SwaggerUserApiOperations.h new file mode 100644 index 00000000000..f451d4b947a --- /dev/null +++ b/samples/client/petstore/ue4cpp/Public/SwaggerUserApiOperations.h @@ -0,0 +1,224 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +#pragma once + +#include "SwaggerBaseModel.h" +#include "SwaggerUserApi.h" + +#include "SwaggerUser.h" + +namespace Swagger +{ + +/* Create user + * + * This can only be done by the logged in user. +*/ +class SWAGGER_API SwaggerUserApi::CreateUserRequest : public Request +{ +public: + virtual ~CreateUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* Created user object */ + SwaggerUser Body; +}; + +class SWAGGER_API SwaggerUserApi::CreateUserResponse : public Response +{ +public: + virtual ~CreateUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Creates list of users with given input array + * + * +*/ +class SWAGGER_API SwaggerUserApi::CreateUsersWithArrayInputRequest : public Request +{ +public: + virtual ~CreateUsersWithArrayInputRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* List of user object */ + TArray Body; +}; + +class SWAGGER_API SwaggerUserApi::CreateUsersWithArrayInputResponse : public Response +{ +public: + virtual ~CreateUsersWithArrayInputResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Creates list of users with given input array + * + * +*/ +class SWAGGER_API SwaggerUserApi::CreateUsersWithListInputRequest : public Request +{ +public: + virtual ~CreateUsersWithListInputRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* List of user object */ + TArray Body; +}; + +class SWAGGER_API SwaggerUserApi::CreateUsersWithListInputResponse : public Response +{ +public: + virtual ~CreateUsersWithListInputResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Delete user + * + * This can only be done by the logged in user. +*/ +class SWAGGER_API SwaggerUserApi::DeleteUserRequest : public Request +{ +public: + virtual ~DeleteUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name that needs to be deleted */ + FString Username; +}; + +class SWAGGER_API SwaggerUserApi::DeleteUserResponse : public Response +{ +public: + virtual ~DeleteUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Get user by user name + * + * +*/ +class SWAGGER_API SwaggerUserApi::GetUserByNameRequest : public Request +{ +public: + virtual ~GetUserByNameRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The name that needs to be fetched. Use user1 for testing. */ + FString Username; +}; + +class SWAGGER_API SwaggerUserApi::GetUserByNameResponse : public Response +{ +public: + virtual ~GetUserByNameResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + SwaggerUser Content; +}; + +/* Logs user into the system + * + * +*/ +class SWAGGER_API SwaggerUserApi::LoginUserRequest : public Request +{ +public: + virtual ~LoginUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* The user name for login */ + FString Username; + /* The password for login in clear text */ + FString Password; +}; + +class SWAGGER_API SwaggerUserApi::LoginUserResponse : public Response +{ +public: + virtual ~LoginUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + FString Content; +}; + +/* Logs out current logged in user session + * + * +*/ +class SWAGGER_API SwaggerUserApi::LogoutUserRequest : public Request +{ +public: + virtual ~LogoutUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + +}; + +class SWAGGER_API SwaggerUserApi::LogoutUserResponse : public Response +{ +public: + virtual ~LogoutUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +/* Updated user + * + * This can only be done by the logged in user. +*/ +class SWAGGER_API SwaggerUserApi::UpdateUserRequest : public Request +{ +public: + virtual ~UpdateUserRequest() {} + void SetupHttpRequest(const TSharedRef& HttpRequest) const final; + FString ComputePath() const final; + + /* name that need to be deleted */ + FString Username; + /* Updated user object */ + SwaggerUser Body; +}; + +class SWAGGER_API SwaggerUserApi::UpdateUserResponse : public Response +{ +public: + virtual ~UpdateUserResponse() {} + void SetHttpResponseCode(EHttpResponseCodes::Type InHttpResponseCode) final; + bool FromJson(const TSharedPtr& JsonObject) final; + + +}; + +} diff --git a/samples/client/petstore/ue4cpp/Swagger.Build.cs b/samples/client/petstore/ue4cpp/Swagger.Build.cs new file mode 100644 index 00000000000..9c3119d195b --- /dev/null +++ b/samples/client/petstore/ue4cpp/Swagger.Build.cs @@ -0,0 +1,29 @@ +/** + * Swagger Petstore + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ +using System; +using System.IO; +using UnrealBuildTool; + +public class Swagger : ModuleRules +{ + public Swagger(ReadOnlyTargetRules Target) : base(Target) + { + PublicDependencyModuleNames.AddRange( + new string[] + { + "Core", + "Http", + "Json", + } + ); + } +} \ No newline at end of file diff --git a/samples/client/test/swift5/default/.swagger-codegen/VERSION b/samples/client/test/swift5/default/.swagger-codegen/VERSION index a4533be7fa8..8c7754221a4 100644 --- a/samples/client/test/swift5/default/.swagger-codegen/VERSION +++ b/samples/client/test/swift5/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.11-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/dynamic-html/.swagger-codegen/VERSION b/samples/dynamic-html/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/dynamic-html/.swagger-codegen/VERSION +++ b/samples/dynamic-html/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/html/.swagger-codegen/VERSION b/samples/html/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/html/.swagger-codegen/VERSION +++ b/samples/html/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/html/index.html b/samples/html/index.html index c2386658a09..7395ad1e060 100644 --- a/samples/html/index.html +++ b/samples/html/index.html @@ -291,7 +291,9 @@

Path parameters

Request headers

- +
api_key (optional)
+ +
Header Parameter
@@ -1379,6 +1381,7 @@

Pet - a Pet Up
id (optional)
Long format: int64
category (optional)
name
+
example: doggie
photoUrls
tags (optional)
status (optional)
String pet status in the store
diff --git a/samples/html2/.swagger-codegen/VERSION b/samples/html2/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/html2/.swagger-codegen/VERSION +++ b/samples/html2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/html2/index.html b/samples/html2/index.html index 4ecad93366f..506ee3c1ff9 100644 --- a/samples/html2/index.html +++ b/samples/html2/index.html @@ -8261,6 +8261,12 @@

Status: 404 - User not found

return this.element; } + if (this.schema && this.schema.example) { + var exampleDiv = document.createElement('div'); + exampleDiv.innerHTML = '
\n example: ' + this.schema.example + '\n
'; + this.element.appendChild(exampleDiv.querySelector('.example')); + } + if (!this.isCollapsed) { this.appendChildren(this.element); } diff --git a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md index d21ebf928f8..8c4eb28baae 100644 --- a/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md +++ b/samples/server/petstore-security-test/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md @@ -62,7 +62,7 @@ If the entry is not part of the container, an exception should be thrown (as req - Calls to the `has` method should only return *true* if the entry is part of the container. If the entry is not part of the container, *false* should be returned. - Finally, the important part: if the entry we are fetching has dependencies, -**instead** of perfoming the dependency lookup in the container, the lookup is performed on the *delegate container*. +**instead** of performing the dependency lookup in the container, the lookup is performed on the *delegate container*. Important! By default, the lookup should be performed on the delegate container **only**, not on the container itself. @@ -178,7 +178,7 @@ class CompositeContainer { Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777). Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments, -and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweights the benefits of the interface. +and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweighs the benefits of the interface. ### 4.4 Alternative: no exception case for delegate lookups diff --git a/samples/server/petstore/aspnetcore-interface-controller/.swagger-codegen/VERSION b/samples/server/petstore/aspnetcore-interface-controller/.swagger-codegen/VERSION index 6cecc1a68f3..8c7754221a4 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/.swagger-codegen/VERSION +++ b/samples/server/petstore/aspnetcore-interface-controller/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.6-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-interface-controller/IO.Swagger.sln b/samples/server/petstore/aspnetcore-interface-controller/IO.Swagger.sln index 045f3a11a74..912ff2e61ba 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/IO.Swagger.sln +++ b/samples/server/petstore/aspnetcore-interface-controller/IO.Swagger.sln @@ -1,21 +1,22 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26114.2 +VisualStudioVersion = 15.0.27428.2043 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.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 + 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-interface-controller/README.md b/samples/server/petstore/aspnetcore-interface-controller/README.md index 07aa834ff03..eb0d56deed5 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/README.md +++ b/samples/server/petstore/aspnetcore-interface-controller/README.md @@ -1,4 +1,4 @@ -# IO.Swagger - ASP.NET Core 2.0 Server +# IO.Swagger - ASP.NET Core 3.0 Server This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/IPetApi.cs b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/IPetApi.cs index a876ffff478..2518b3c76d8 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/IPetApi.cs +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/IPetApi.cs @@ -93,8 +93,8 @@ public interface IPetApiController /// ID of pet to update /// Additional data to pass to server - /// file to upload + /// file to upload /// successful operation - IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file); + IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _file); } } diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/PetApi.cs index 1210bce34eb..5986bcf59e3 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/PetApi.cs @@ -219,14 +219,14 @@ public virtual IActionResult UpdatePetWithForm([FromRoute][Required]long? petId, /// ID of pet to update /// Additional data to pass to server - /// file to upload + /// file to upload /// successful operation [HttpPost] [Route("/v2/pet/{petId}/uploadImage")] [ValidateModelState] [SwaggerOperation("UploadFile")] [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] - public virtual IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file) + public virtual IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _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)); diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/UserApi.cs index 67703ff0cff..20600c41d71 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Controllers/UserApi.cs @@ -16,7 +16,7 @@ using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; using IO.Swagger.Attributes; -using IO.Swagger.Security; + using Microsoft.AspNetCore.Authorization; using IO.Swagger.Models; diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Dockerfile b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Dockerfile index 6b07232e561..2fc62d322e0 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Dockerfile +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Dockerfile @@ -1,4 +1,4 @@ -FROM microsoft/aspnetcore-build:2.0 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env WORKDIR /app ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 @@ -12,7 +12,7 @@ COPY . ./ RUN dotnet publish -c Release -o out # build runtime image -FROM microsoft/aspnetcore:2.0 +FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/BasePathFilter.cs index f3c528eada2..c9d95d6d189 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/BasePathFilter.cs +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/BasePathFilter.cs @@ -2,6 +2,7 @@ using System.Text.RegularExpressions; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { @@ -28,11 +29,11 @@ public BasePathFilter(string basePath) /// /// Apply the filter /// - /// SwaggerDocument + /// OpenApiDocument /// FilterContext - public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) { - swaggerDoc.BasePath = this.BasePath; + swaggerDoc.Servers.Add(new OpenApiServer() { Url = this.BasePath }); var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs index a0e2cb6871d..a16d303b32a 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc.Controllers; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { @@ -16,7 +17,7 @@ public class GeneratePathParamsValidationFilter : IOperationFilter /// /// Operation /// OperationFilterContext - public void Apply(Operation operation, OperationFilterContext context) + public void Apply(OpenApiOperation operation, OperationFilterContext context) { var pars = context.ApiDescription.ParameterDescriptions; @@ -40,9 +41,9 @@ public void Apply(Operation operation, OperationFilterContext context) if (regexAttr != null) { string regex = (string)regexAttr.ConstructorArguments[0].Value; - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).Pattern = regex; + ((OpenApiParameter)swaggerParam).Schema.Pattern = regex; } } @@ -70,10 +71,10 @@ public void Apply(Operation operation, OperationFilterContext context) maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; } - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).MinLength = minLenght; - ((NonBodyParameter)swaggerParam).MaxLength = maxLength; + ((OpenApiParameter)swaggerParam).Schema.MinLength = minLenght; + ((OpenApiParameter)swaggerParam).Schema.MaxLength = maxLength; } // Range [Range] @@ -83,10 +84,10 @@ public void Apply(Operation operation, OperationFilterContext context) int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).Minimum = rangeMin; - ((NonBodyParameter)swaggerParam).Maximum = rangeMax; + ((OpenApiParameter)swaggerParam).Schema.Minimum = rangeMin; + ((OpenApiParameter)swaggerParam).Schema.Maximum = rangeMax; } } } diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/IO.Swagger.csproj index 616076b6078..b864e584350 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/IO.Swagger.csproj @@ -2,18 +2,19 @@ IO.Swagger IO.Swagger - netcoreapp2.2 + netcoreapp3.0 true true IO.Swagger IO.Swagger - - - + + + + - + diff --git a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Startup.cs b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Startup.cs index 73dc4b97234..3cb7c12d86a 100644 --- a/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Startup.cs +++ b/samples/server/petstore/aspnetcore-interface-controller/src/IO.Swagger/Startup.cs @@ -10,11 +10,14 @@ using System; using System.IO; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.Swagger; @@ -22,8 +25,6 @@ using IO.Swagger.Filters; using IO.Swagger.Security; -using Microsoft.AspNetCore.Authentication; - namespace IO.Swagger { /// @@ -31,7 +32,7 @@ namespace IO.Swagger /// public class Startup { - private readonly IHostingEnvironment _hostingEnv; + private readonly IWebHostEnvironment _hostingEnv; private IConfiguration Configuration { get; } @@ -40,7 +41,7 @@ public class Startup /// /// /// - public Startup(IHostingEnvironment env, IConfiguration configuration) + public Startup(IWebHostEnvironment env, IConfiguration configuration) { _hostingEnv = env; Configuration = configuration; @@ -54,13 +55,15 @@ public void ConfigureServices(IServiceCollection services) { // Add framework services. services - .AddMvc() - .AddJsonOptions(opts => + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => { opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - opts.SerializerSettings.Converters.Add(new StringEnumConverter { - CamelCaseText = true - }); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); }) .AddXmlSerializerFormatters(); @@ -71,21 +74,20 @@ public void ConfigureServices(IServiceCollection services) services .AddSwaggerGen(c => { - c.SwaggerDoc("1.0.0", new Info + c.SwaggerDoc("1.0.0", new OpenApiInfo { Version = "1.0.0", Title = "Swagger Petstore", - Description = "Swagger Petstore (ASP.NET Core 2.0)", - Contact = new Contact() + Description = "Swagger Petstore (ASP.NET Core 3.0)", + Contact = new OpenApiContact() { Name = "Swagger Codegen Contributors", - Url = "https://github.com/swagger-api/swagger-codegen", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), Email = "apiteam@swagger.io" }, - TermsOfService = "http://swagger.io/terms/" + TermsOfService = new Uri("http://swagger.io/terms/") }); - c.CustomSchemaIds(type => type.FriendlyId(true)); - c.DescribeAllEnumsAsStrings(); + c.CustomSchemaIds(type => type.FullName); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); // Sets the basePath property in the Swagger document generated c.DocumentFilter("/v2"); @@ -102,21 +104,32 @@ public void ConfigureServices(IServiceCollection services) /// /// /// - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { - app - .UseMvc() - .UseDefaultFiles() - .UseStaticFiles() - .UseSwagger() - .UseSwaggerUI(c => - { - //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + app.UseRouting(); - //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); - }); + //TODO: Uncomment this if you need wwwroot folder + // app.UseStaticFiles(); + + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); + }); + + //TODO: Use Https Redirection + // app.UseHttpsRedirection(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); if (env.IsDevelopment()) { @@ -125,7 +138,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF else { //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) - // app.UseExceptionHandler("/Home/Error"); + app.UseExceptionHandler("/Error"); + + app.UseHsts(); } } } diff --git a/samples/server/petstore/aspnetcore-interface-only/.swagger-codegen/VERSION b/samples/server/petstore/aspnetcore-interface-only/.swagger-codegen/VERSION index 6cecc1a68f3..8c7754221a4 100644 --- a/samples/server/petstore/aspnetcore-interface-only/.swagger-codegen/VERSION +++ b/samples/server/petstore/aspnetcore-interface-only/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.6-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-interface-only/IO.Swagger.sln b/samples/server/petstore/aspnetcore-interface-only/IO.Swagger.sln index 045f3a11a74..912ff2e61ba 100644 --- a/samples/server/petstore/aspnetcore-interface-only/IO.Swagger.sln +++ b/samples/server/petstore/aspnetcore-interface-only/IO.Swagger.sln @@ -1,21 +1,22 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26114.2 +VisualStudioVersion = 15.0.27428.2043 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.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 + 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-interface-only/README.md b/samples/server/petstore/aspnetcore-interface-only/README.md index 07aa834ff03..eb0d56deed5 100644 --- a/samples/server/petstore/aspnetcore-interface-only/README.md +++ b/samples/server/petstore/aspnetcore-interface-only/README.md @@ -1,4 +1,4 @@ -# IO.Swagger - ASP.NET Core 2.0 Server +# IO.Swagger - ASP.NET Core 3.0 Server This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Controllers/IPetApi.cs b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Controllers/IPetApi.cs index a876ffff478..2518b3c76d8 100644 --- a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Controllers/IPetApi.cs +++ b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Controllers/IPetApi.cs @@ -93,8 +93,8 @@ public interface IPetApiController /// ID of pet to update /// Additional data to pass to server - /// file to upload + /// file to upload /// successful operation - IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file); + IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _file); } } diff --git a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Dockerfile b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Dockerfile index 6b07232e561..2fc62d322e0 100644 --- a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Dockerfile +++ b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Dockerfile @@ -1,4 +1,4 @@ -FROM microsoft/aspnetcore-build:2.0 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env WORKDIR /app ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 @@ -12,7 +12,7 @@ COPY . ./ RUN dotnet publish -c Release -o out # build runtime image -FROM microsoft/aspnetcore:2.0 +FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/BasePathFilter.cs index f3c528eada2..c9d95d6d189 100644 --- a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/BasePathFilter.cs +++ b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/BasePathFilter.cs @@ -2,6 +2,7 @@ using System.Text.RegularExpressions; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { @@ -28,11 +29,11 @@ public BasePathFilter(string basePath) /// /// Apply the filter /// - /// SwaggerDocument + /// OpenApiDocument /// FilterContext - public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) { - swaggerDoc.BasePath = this.BasePath; + swaggerDoc.Servers.Add(new OpenApiServer() { Url = this.BasePath }); var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); diff --git a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs index a0e2cb6871d..a16d303b32a 100644 --- a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs +++ b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc.Controllers; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { @@ -16,7 +17,7 @@ public class GeneratePathParamsValidationFilter : IOperationFilter /// /// Operation /// OperationFilterContext - public void Apply(Operation operation, OperationFilterContext context) + public void Apply(OpenApiOperation operation, OperationFilterContext context) { var pars = context.ApiDescription.ParameterDescriptions; @@ -40,9 +41,9 @@ public void Apply(Operation operation, OperationFilterContext context) if (regexAttr != null) { string regex = (string)regexAttr.ConstructorArguments[0].Value; - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).Pattern = regex; + ((OpenApiParameter)swaggerParam).Schema.Pattern = regex; } } @@ -70,10 +71,10 @@ public void Apply(Operation operation, OperationFilterContext context) maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; } - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).MinLength = minLenght; - ((NonBodyParameter)swaggerParam).MaxLength = maxLength; + ((OpenApiParameter)swaggerParam).Schema.MinLength = minLenght; + ((OpenApiParameter)swaggerParam).Schema.MaxLength = maxLength; } // Range [Range] @@ -83,10 +84,10 @@ public void Apply(Operation operation, OperationFilterContext context) int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).Minimum = rangeMin; - ((NonBodyParameter)swaggerParam).Maximum = rangeMax; + ((OpenApiParameter)swaggerParam).Schema.Minimum = rangeMin; + ((OpenApiParameter)swaggerParam).Schema.Maximum = rangeMax; } } } diff --git a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/IO.Swagger.csproj index 616076b6078..b864e584350 100644 --- a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/IO.Swagger.csproj @@ -2,18 +2,19 @@ IO.Swagger IO.Swagger - netcoreapp2.2 + netcoreapp3.0 true true IO.Swagger IO.Swagger - - - + + + + - + diff --git a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Startup.cs b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Startup.cs index 73dc4b97234..3cb7c12d86a 100644 --- a/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Startup.cs +++ b/samples/server/petstore/aspnetcore-interface-only/src/IO.Swagger/Startup.cs @@ -10,11 +10,14 @@ using System; using System.IO; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.Swagger; @@ -22,8 +25,6 @@ using IO.Swagger.Filters; using IO.Swagger.Security; -using Microsoft.AspNetCore.Authentication; - namespace IO.Swagger { /// @@ -31,7 +32,7 @@ namespace IO.Swagger /// public class Startup { - private readonly IHostingEnvironment _hostingEnv; + private readonly IWebHostEnvironment _hostingEnv; private IConfiguration Configuration { get; } @@ -40,7 +41,7 @@ public class Startup /// /// /// - public Startup(IHostingEnvironment env, IConfiguration configuration) + public Startup(IWebHostEnvironment env, IConfiguration configuration) { _hostingEnv = env; Configuration = configuration; @@ -54,13 +55,15 @@ public void ConfigureServices(IServiceCollection services) { // Add framework services. services - .AddMvc() - .AddJsonOptions(opts => + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => { opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - opts.SerializerSettings.Converters.Add(new StringEnumConverter { - CamelCaseText = true - }); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); }) .AddXmlSerializerFormatters(); @@ -71,21 +74,20 @@ public void ConfigureServices(IServiceCollection services) services .AddSwaggerGen(c => { - c.SwaggerDoc("1.0.0", new Info + c.SwaggerDoc("1.0.0", new OpenApiInfo { Version = "1.0.0", Title = "Swagger Petstore", - Description = "Swagger Petstore (ASP.NET Core 2.0)", - Contact = new Contact() + Description = "Swagger Petstore (ASP.NET Core 3.0)", + Contact = new OpenApiContact() { Name = "Swagger Codegen Contributors", - Url = "https://github.com/swagger-api/swagger-codegen", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), Email = "apiteam@swagger.io" }, - TermsOfService = "http://swagger.io/terms/" + TermsOfService = new Uri("http://swagger.io/terms/") }); - c.CustomSchemaIds(type => type.FriendlyId(true)); - c.DescribeAllEnumsAsStrings(); + c.CustomSchemaIds(type => type.FullName); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); // Sets the basePath property in the Swagger document generated c.DocumentFilter("/v2"); @@ -102,21 +104,32 @@ public void ConfigureServices(IServiceCollection services) /// /// /// - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { - app - .UseMvc() - .UseDefaultFiles() - .UseStaticFiles() - .UseSwagger() - .UseSwaggerUI(c => - { - //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + app.UseRouting(); - //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); - }); + //TODO: Uncomment this if you need wwwroot folder + // app.UseStaticFiles(); + + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); + }); + + //TODO: Use Https Redirection + // app.UseHttpsRedirection(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); if (env.IsDevelopment()) { @@ -125,7 +138,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF else { //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) - // app.UseExceptionHandler("/Home/Error"); + app.UseExceptionHandler("/Error"); + + app.UseHsts(); } } } diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/.swagger-codegen-ignore b/samples/server/petstore/aspnetcore-v2.2-interface-controller/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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-v2.2-interface-controller/.swagger-codegen/VERSION b/samples/server/petstore/aspnetcore-v2.2-interface-controller/.swagger-codegen/VERSION new file mode 100644 index 00000000000..8c7754221a4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/IO.Swagger.sln b/samples/server/petstore/aspnetcore-v2.2-interface-controller/IO.Swagger.sln new file mode 100644 index 00000000000..912ff2e61ba --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/IO.Swagger.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}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.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-v2.2-interface-controller/NuGet.Config b/samples/server/petstore/aspnetcore-v2.2-interface-controller/NuGet.Config new file mode 100644 index 00000000000..01f3d1f203f --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/NuGet.Config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/README.md b/samples/server/petstore/aspnetcore-v2.2-interface-controller/README.md new file mode 100644 index 00000000000..730f1daffcd --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/README.md @@ -0,0 +1,25 @@ +# IO.Swagger - ASP.NET Core 2.2 Server + +This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` + +## Run in Docker + +``` +cd src/IO.Swagger +docker build -t io.swagger . +docker run -p 5000:5000 io.swagger +``` diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/build.bat b/samples/server/petstore/aspnetcore-v2.2-interface-controller/build.bat new file mode 100644 index 00000000000..2e041233a06 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://github.com/swagger-api/swagger-codegen.git +:: + +@echo off + +dotnet restore src\IO.Swagger +dotnet build src\IO.Swagger +echo Now, run the following to start the project: dotnet run -p src\IO.Swagger\IO.Swagger.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/build.sh b/samples/server/petstore/aspnetcore-v2.2-interface-controller/build.sh new file mode 100644 index 00000000000..ce6063a2f49 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +dotnet restore src/IO.Swagger/ && \ + dotnet build src/IO.Swagger/ && \ + echo "Now, run the following to start the project: dotnet run -p src/IO.Swagger/IO.Swagger.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/.gitignore b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/.gitignore new file mode 100644 index 00000000000..cd9b840e549 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/.gitignore @@ -0,0 +1,208 @@ +PID + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# 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 +# TODO: 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 + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# 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/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ +orleans.codegen.cs + +# 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 + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..07cfabe83cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +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 IO.Swagger.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/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + 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); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IPetApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IPetApi.cs new file mode 100644 index 00000000000..2518b3c76d8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IPetApi.cs @@ -0,0 +1,100 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Models; + + namespace IO.Swagger.Controllers +{ + /// + /// + /// + public interface IPetApiController + { + /// + /// Add a new pet to the store + /// + + /// Pet object that needs to be added to the store + /// Invalid input + IActionResult AddPet([FromBody]Pet body); + + /// + /// Deletes a pet + /// + + /// Pet id to delete + /// + /// Invalid pet value + IActionResult DeletePet([FromRoute][Required]long? petId, [FromHeader]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 + /// successful operation + /// Invalid status value + IActionResult FindPetsByStatus([FromQuery][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 + IActionResult FindPetsByTags([FromQuery][Required()]List tags); + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + IActionResult GetPetById([FromRoute][Required]long? petId); + + /// + /// Update an existing pet + /// + + /// Pet object that needs to be added to the store + /// Invalid ID supplied + /// Pet not found + /// Validation exception + IActionResult UpdatePet([FromBody]Pet body); + + /// + /// 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 + IActionResult UpdatePetWithForm([FromRoute][Required]long? petId, [FromForm]string name, [FromForm]string status); + + /// + /// uploads an image + /// + + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _file); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IStoreApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IStoreApi.cs new file mode 100644 index 00000000000..2b62c7b372c --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IStoreApi.cs @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Models; + + namespace IO.Swagger.Controllers +{ + /// + /// + /// + public interface IStoreApiController + { + /// + /// 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 + IActionResult DeleteOrder([FromRoute][Required]string orderId); + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + IActionResult GetInventory(); + + /// + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// ID of pet that needs to be fetched + /// successful operation + /// Invalid ID supplied + /// Order not found + IActionResult GetOrderById([FromRoute][Required][Range(1, 5)]long? orderId); + + /// + /// Place an order for a pet + /// + + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + IActionResult PlaceOrder([FromBody]Order body); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IUserApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IUserApi.cs new file mode 100644 index 00000000000..a01e5b3a8cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/IUserApi.cs @@ -0,0 +1,95 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Models; + + namespace IO.Swagger.Controllers +{ + /// + /// + /// + public interface IUserApiController + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + IActionResult CreateUser([FromBody]User body); + + /// + /// Creates list of users with given input array + /// + + /// List of user object + /// successful operation + IActionResult CreateUsersWithArrayInput([FromBody]List body); + + /// + /// Creates list of users with given input array + /// + + /// List of user object + /// successful operation + IActionResult CreateUsersWithListInput([FromBody]List body); + + /// + /// 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 + IActionResult DeleteUser([FromRoute][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 + IActionResult GetUserByName([FromRoute][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 + IActionResult LoginUser([FromQuery][Required()]string username, [FromQuery][Required()]string password); + + /// + /// Logs out current logged in user session + /// + + /// successful operation + 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 + IActionResult UpdateUser([FromRoute][Required]string username, [FromBody]User body); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/PetApi.cs new file mode 100644 index 00000000000..5986bcf59e3 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/PetApi.cs @@ -0,0 +1,244 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; +using IO.Swagger.Security; +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase, IPetApiController + { + /// + /// Add a new pet to the store + /// + + /// Pet object that needs to be added to the store + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + public virtual IActionResult AddPet([FromBody]Pet body) + { + //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(); + } + + /// + /// Deletes a pet + /// + + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute][Required]long? petId, [FromHeader]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 + /// 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][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 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + 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} ]"; + + 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")] + public virtual IActionResult FindPetsByTags([FromQuery][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 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + 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} ]"; + + 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(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute][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 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + 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}"; + + 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 + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + public virtual IActionResult UpdatePet([FromBody]Pet body) + { + //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); + + + throw new NotImplementedException(); + } + + /// + /// 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}")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute][Required]long? petId, [FromForm]string name, [FromForm]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")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _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-v2.2-interface-controller/src/IO.Swagger/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/StoreApi.cs new file mode 100644 index 00000000000..f888dbb4e58 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/StoreApi.cs @@ -0,0 +1,146 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; +using IO.Swagger.Security; +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + [ApiController] + public class StoreApiController : ControllerBase, IStoreApiController + { + /// + /// 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][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(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [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; + exampleJson = "{\n \"key\" : 0\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(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 generated 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][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 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + 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}"; + + 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")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order body) + { + //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 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + 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}"; + + 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-v2.2-interface-controller/src/IO.Swagger/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/UserApi.cs new file mode 100644 index 00000000000..67703ff0cff --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Controllers/UserApi.cs @@ -0,0 +1,220 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; +using IO.Swagger.Security; +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + [ApiController] + public class UserApiController : ControllerBase, IUserApiController + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + [HttpPost] + [Route("/v2/user")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User body) + { + //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")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List body) + { + //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")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List body) + { + //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}")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute][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][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 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + 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}"; + + 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][Required()]string username, [FromQuery][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; + exampleJson = "aeiou"; + exampleJson = "\"\""; + + 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")] + [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}")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute][Required]string username, [FromBody]User body) + { + //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-v2.2-interface-controller/src/IO.Swagger/Dockerfile b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Dockerfile new file mode 100644 index 00000000000..967c8195c2b --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env +WORKDIR /app + +ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 + +# copy csproj and restore as distinct layers +COPY *.csproj ./ +RUN dotnet restore + +# copy everything else and build +COPY . ./ +RUN dotnet publish -c Release -o out + +# build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..f3c528eada2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Filters/BasePathFilter.cs @@ -0,0 +1,50 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of Swagger 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 Swagger Doc + /// + /// The BasePath of the Swagger Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// SwaggerDocument + /// FilterContext + public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) + { + swaggerDoc.BasePath = this.BasePath; + + var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); + + foreach (var path in pathsToModify) + { + if (path.Key.StartsWith(this.BasePath)) + { + string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty); + swaggerDoc.Paths.Remove(path.Key); + swaggerDoc.Paths.Add(newKey, path.Value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..a0e2cb6871d --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(Operation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes; + + if (attributes != null && attributes.Count() > 0 && swaggerParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + swaggerParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + string regex = (string)regexAttr.ConstructorArguments[0].Value; + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Pattern = regex; + } + } + + // String Length [StringLength] + int? minLenght = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLenght = (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) + { + minLenght = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).MinLength = minLenght; + ((NonBodyParameter)swaggerParam).MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Minimum = rangeMin; + ((NonBodyParameter)swaggerParam).Maximum = rangeMax; + } + } + } + } + } + } +} + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 00000000000..616076b6078 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,19 @@ + + + IO.Swagger + IO.Swagger + netcoreapp2.2 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Amount.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Amount.cs new file mode 100644 index 00000000000..63839c2f8a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Amount.cs @@ -0,0 +1,137 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// some description + /// + [DataContract] + public partial class Amount : IEquatable + { + /// + /// some description + /// + /// some description + [Required] + [DataMember(Name="value")] + public double? Value { get; set; } + + /// + /// Gets or Sets Currency + /// + [Required] + [DataMember(Name="currency")] + public Currency Currency { 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 Amount {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Currency: ").Append(Currency).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 (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Amount)obj); + } + + /// + /// Returns true if Amount instances are equal + /// + /// Instance of Amount to be compared + /// Boolean + public bool Equals(Amount other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + Currency == other.Currency || + Currency != null && + Currency.Equals(other.Currency) + ); + } + + /// + /// 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 (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (Currency != null) + hashCode = hashCode * 59 + Currency.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Amount left, Amount right) + { + return Equals(left, right); + } + + public static bool operator !=(Amount left, Amount right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/ApiResponse.cs new file mode 100644 index 00000000000..eb444479ec4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/ApiResponse.cs @@ -0,0 +1,148 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code")] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type")] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + Code != null && + 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 :) + if (Code != null) + 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-v2.2-interface-controller/src/IO.Swagger/Models/Category.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Category.cs new file mode 100644 index 00000000000..0f9df0830c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 :) + if (Id != null) + 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-v2.2-interface-controller/src/IO.Swagger/Models/Currency.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Currency.cs new file mode 100644 index 00000000000..a5a499265cb --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Currency.cs @@ -0,0 +1,106 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// some description + /// + [DataContract] + public partial class Currency : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Currency {\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 (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Currency)obj); + } + + /// + /// Returns true if Currency instances are equal + /// + /// Instance of Currency to be compared + /// Boolean + public bool Equals(Currency other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// 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 :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Currency left, Currency right) + { + return Equals(left, right); + } + + public static bool operator !=(Currency left, Currency right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Order.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Order.cs new file mode 100644 index 00000000000..1e617fdf089 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Order.cs @@ -0,0 +1,218 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId")] + public long? PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity")] + public int? Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate")] + public DateTime? ShipDate { get; set; } + + /// + /// Order Status + /// + /// Order Status + [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")] + public StatusEnum? Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete")] + public bool? Complete { 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 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + PetId != null && + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + Quantity != null && + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + ShipDate != null && + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + Status != null && + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + Complete != null && + 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 :) + if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); + if (PetId != null) + hashCode = hashCode * 59 + PetId.GetHashCode(); + if (Quantity != null) + hashCode = hashCode * 59 + Quantity.GetHashCode(); + if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + if (Status != null) + hashCode = hashCode * 59 + Status.GetHashCode(); + if (Complete != null) + 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-v2.2-interface-controller/src/IO.Swagger/Models/Pet.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Pet.cs new file mode 100644 index 00000000000..fc9884836f0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Pet.cs @@ -0,0 +1,220 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category")] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [Required] + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls")] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags")] + public List Tags { get; set; } + + /// + /// pet status in the store + /// + /// pet status in the store + [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")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + Status != null && + 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 :) + if (Id != null) + 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(); + if (Status != null) + 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-v2.2-interface-controller/src/IO.Swagger/Models/Tag.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Tag.cs new file mode 100644 index 00000000000..d0cd5b744be --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/Tag.cs @@ -0,0 +1,134 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 :) + if (Id != null) + 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-v2.2-interface-controller/src/IO.Swagger/Models/User.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/User.cs new file mode 100644 index 00000000000..4c9df2fd429 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Models/User.cs @@ -0,0 +1,219 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username")] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName")] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName")] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email")] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password")] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone")] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 != null && + 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 :) + if (Id != null) + 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(); + if (UserStatus != null) + 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-v2.2-interface-controller/src/IO.Swagger/Program.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Program.cs new file mode 100644 index 00000000000..ae409c1ecb8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Program.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore; + +namespace IO.Swagger +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + /// + /// Create the web host builder. + /// + /// + /// IWebHostBuilder + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Properties/launchSettings.json new file mode 100644 index 00000000000..21acfed207b --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50352/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "web": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000/swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs new file mode 100644 index 00000000000..57b5fd5dfd9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs @@ -0,0 +1,50 @@ +using System; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text; +using System.Text.Encodings.Web; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace IO.Swagger.Security +{ + /// + /// class to handle api_key security. + /// + public class ApiKeyAuthenticationHandler : AuthenticationHandler + { + /// + /// scheme name for authentication handler. + /// + public const string SchemeName = "ApiKey"; + + public ApiKeyAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) + { + } + + /// + /// verify that require api key header exist and handle authorization. + /// + protected override async Task HandleAuthenticateAsync() + { + if (!Request.Headers.ContainsKey("api_key")) + { + return AuthenticateResult.Fail("Missing Authorization Header"); + } + + // do magic here! + + var claims = new[] { + new Claim(ClaimTypes.NameIdentifier, "changeme"), + new Claim(ClaimTypes.Name, "changeme"), + }; + var identity = new ClaimsIdentity(claims, Scheme.Name); + var principal = new ClaimsPrincipal(identity); + var ticket = new AuthenticationTicket(principal, Scheme.Name); + + return AuthenticateResult.Success(ticket); + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Startup.cs b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Startup.cs new file mode 100644 index 00000000000..73dc4b97234 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/Startup.cs @@ -0,0 +1,132 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using IO.Swagger.Filters; +using IO.Swagger.Security; + +using Microsoft.AspNetCore.Authentication; + +namespace IO.Swagger +{ + /// + /// Startup + /// + public class Startup + { + private readonly IHostingEnvironment _hostingEnv; + + private IConfiguration Configuration { get; } + + /// + /// Constructor + /// + /// + /// + public Startup(IHostingEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services + .AddMvc() + .AddJsonOptions(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter { + CamelCaseText = true + }); + }) + .AddXmlSerializerFormatters(); + + services.AddAuthentication(ApiKeyAuthenticationHandler.SchemeName) + .AddScheme(ApiKeyAuthenticationHandler.SchemeName, null); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("1.0.0", new Info + { + Version = "1.0.0", + Title = "Swagger Petstore", + Description = "Swagger Petstore (ASP.NET Core 2.0)", + Contact = new Contact() + { + Name = "Swagger Codegen Contributors", + Url = "https://github.com/swagger-api/swagger-codegen", + Email = "apiteam@swagger.io" + }, + TermsOfService = "http://swagger.io/terms/" + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.DescribeAllEnumsAsStrings(); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + // Sets the basePath property in the Swagger document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger 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, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + app + .UseMvc() + .UseDefaultFiles() + .UseStaticFiles() + .UseSwagger() + .UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) + // app.UseExceptionHandler("/Home/Error"); + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/appsettings.json b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/appsettings.json new file mode 100644 index 00000000000..c6af7d9b069 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Information", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/web.config b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/web.config new file mode 100644 index 00000000000..a3b9f6add9c --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/index.html b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/index.html new file mode 100644 index 00000000000..cde1f2f90b9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/swagger-original.json b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/swagger-original.json new file mode 100644 index 00000000000..95505bae5e2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/swagger-original.json @@ -0,0 +1,901 @@ +{ + "swagger" : "2.0", + "info" : { + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version" : "1.0.0", + "title" : "Swagger Petstore", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache-2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host" : "petstore.swagger.io", + "basePath" : "/v2", + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "schemes" : [ "http" ], + "paths" : { + "/pet" : { + "post" : { + "tags" : [ "pet" ], + "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" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "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" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "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", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/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", + "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", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "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" + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "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" + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "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", + "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" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ApiResponse" + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "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" + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ] + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "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" + } + }, + "400" : { + "description" : "Invalid Order" + } + } + } + }, + "/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 generated 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" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "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", + "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" + } + } + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "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" + } + } + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "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" + } + } + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "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" + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "type" : "integer", + "format" : "int32", + "description" : "calls per hour allowed by the user" + }, + "X-Expires-After" : { + "type" : "string", + "format" : "date-time", + "description" : "date in UTC when toekn expires" + } + }, + "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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "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.", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "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" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "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" + } ], + "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" : { + "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 + } + }, + "title" : "Pet Order", + "xml" : { + "name" : "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" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "xml" : { + "name" : "Category" + }, + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + } + }, + "User" : { + "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" + } + }, + "title" : "a User", + "xml" : { + "name" : "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" + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "xml" : { + "name" : "Tag" + }, + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + } + }, + "Pet" : { + "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" : { + "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" ] + } + }, + "title" : "a Pet", + "xml" : { + "name" : "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" + } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + } + }, + "Amount" : { + "type" : "object", + "required" : [ "currency", "value" ], + "properties" : { + "value" : { + "type" : "number", + "format" : "double", + "description" : "some description\n", + "minimum" : 0.01, + "maximum" : 1000000000000000 + }, + "currency" : { + "$ref" : "#/definitions/Currency" + } + }, + "description" : "some description\n" + }, + "Currency" : { + "type" : "string", + "pattern" : "^[A-Z]{3,3}$", + "description" : "some description\n" + } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/web.config b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/web.config new file mode 100644 index 00000000000..e70a7778d60 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-controller/src/IO.Swagger/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/.swagger-codegen-ignore b/samples/server/petstore/aspnetcore-v2.2-interface-only/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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-v2.2-interface-only/.swagger-codegen/VERSION b/samples/server/petstore/aspnetcore-v2.2-interface-only/.swagger-codegen/VERSION new file mode 100644 index 00000000000..8c7754221a4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/IO.Swagger.sln b/samples/server/petstore/aspnetcore-v2.2-interface-only/IO.Swagger.sln new file mode 100644 index 00000000000..912ff2e61ba --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/IO.Swagger.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}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.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-v2.2-interface-only/NuGet.Config b/samples/server/petstore/aspnetcore-v2.2-interface-only/NuGet.Config new file mode 100644 index 00000000000..01f3d1f203f --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/NuGet.Config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/README.md b/samples/server/petstore/aspnetcore-v2.2-interface-only/README.md new file mode 100644 index 00000000000..730f1daffcd --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/README.md @@ -0,0 +1,25 @@ +# IO.Swagger - ASP.NET Core 2.2 Server + +This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` + +## Run in Docker + +``` +cd src/IO.Swagger +docker build -t io.swagger . +docker run -p 5000:5000 io.swagger +``` diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/build.bat b/samples/server/petstore/aspnetcore-v2.2-interface-only/build.bat new file mode 100644 index 00000000000..2e041233a06 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://github.com/swagger-api/swagger-codegen.git +:: + +@echo off + +dotnet restore src\IO.Swagger +dotnet build src\IO.Swagger +echo Now, run the following to start the project: dotnet run -p src\IO.Swagger\IO.Swagger.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/build.sh b/samples/server/petstore/aspnetcore-v2.2-interface-only/build.sh new file mode 100644 index 00000000000..ce6063a2f49 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +dotnet restore src/IO.Swagger/ && \ + dotnet build src/IO.Swagger/ && \ + echo "Now, run the following to start the project: dotnet run -p src/IO.Swagger/IO.Swagger.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/.gitignore b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/.gitignore new file mode 100644 index 00000000000..cd9b840e549 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/.gitignore @@ -0,0 +1,208 @@ +PID + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# 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 +# TODO: 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 + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# 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/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ +orleans.codegen.cs + +# 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 + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..07cfabe83cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +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 IO.Swagger.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/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + 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); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IPetApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IPetApi.cs new file mode 100644 index 00000000000..2518b3c76d8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IPetApi.cs @@ -0,0 +1,100 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Models; + + namespace IO.Swagger.Controllers +{ + /// + /// + /// + public interface IPetApiController + { + /// + /// Add a new pet to the store + /// + + /// Pet object that needs to be added to the store + /// Invalid input + IActionResult AddPet([FromBody]Pet body); + + /// + /// Deletes a pet + /// + + /// Pet id to delete + /// + /// Invalid pet value + IActionResult DeletePet([FromRoute][Required]long? petId, [FromHeader]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 + /// successful operation + /// Invalid status value + IActionResult FindPetsByStatus([FromQuery][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 + IActionResult FindPetsByTags([FromQuery][Required()]List tags); + + /// + /// Find pet by ID + /// + /// Returns a single pet + /// ID of pet to return + /// successful operation + /// Invalid ID supplied + /// Pet not found + IActionResult GetPetById([FromRoute][Required]long? petId); + + /// + /// Update an existing pet + /// + + /// Pet object that needs to be added to the store + /// Invalid ID supplied + /// Pet not found + /// Validation exception + IActionResult UpdatePet([FromBody]Pet body); + + /// + /// 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 + IActionResult UpdatePetWithForm([FromRoute][Required]long? petId, [FromForm]string name, [FromForm]string status); + + /// + /// uploads an image + /// + + /// ID of pet to update + /// Additional data to pass to server + /// file to upload + /// successful operation + IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _file); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IStoreApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IStoreApi.cs new file mode 100644 index 00000000000..2b62c7b372c --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IStoreApi.cs @@ -0,0 +1,60 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Models; + + namespace IO.Swagger.Controllers +{ + /// + /// + /// + public interface IStoreApiController + { + /// + /// 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 + IActionResult DeleteOrder([FromRoute][Required]string orderId); + + /// + /// Returns pet inventories by status + /// + /// Returns a map of status codes to quantities + /// successful operation + IActionResult GetInventory(); + + /// + /// Find purchase order by ID + /// + /// For valid response try integer IDs with value <= 5 or > 10. Other values will generated exceptions + /// ID of pet that needs to be fetched + /// successful operation + /// Invalid ID supplied + /// Order not found + IActionResult GetOrderById([FromRoute][Required][Range(1, 5)]long? orderId); + + /// + /// Place an order for a pet + /// + + /// order placed for purchasing the pet + /// successful operation + /// Invalid Order + IActionResult PlaceOrder([FromBody]Order body); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IUserApi.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IUserApi.cs new file mode 100644 index 00000000000..a01e5b3a8cd --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Controllers/IUserApi.cs @@ -0,0 +1,95 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Models; + + namespace IO.Swagger.Controllers +{ + /// + /// + /// + public interface IUserApiController + { + /// + /// Create user + /// + /// This can only be done by the logged in user. + /// Created user object + /// successful operation + IActionResult CreateUser([FromBody]User body); + + /// + /// Creates list of users with given input array + /// + + /// List of user object + /// successful operation + IActionResult CreateUsersWithArrayInput([FromBody]List body); + + /// + /// Creates list of users with given input array + /// + + /// List of user object + /// successful operation + IActionResult CreateUsersWithListInput([FromBody]List body); + + /// + /// 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 + IActionResult DeleteUser([FromRoute][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 + IActionResult GetUserByName([FromRoute][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 + IActionResult LoginUser([FromQuery][Required()]string username, [FromQuery][Required()]string password); + + /// + /// Logs out current logged in user session + /// + + /// successful operation + 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 + IActionResult UpdateUser([FromRoute][Required]string username, [FromBody]User body); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Dockerfile b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Dockerfile new file mode 100644 index 00000000000..967c8195c2b --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env +WORKDIR /app + +ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 + +# copy csproj and restore as distinct layers +COPY *.csproj ./ +RUN dotnet restore + +# copy everything else and build +COPY . ./ +RUN dotnet publish -c Release -o out + +# build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..f3c528eada2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Filters/BasePathFilter.cs @@ -0,0 +1,50 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of Swagger 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 Swagger Doc + /// + /// The BasePath of the Swagger Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// SwaggerDocument + /// FilterContext + public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) + { + swaggerDoc.BasePath = this.BasePath; + + var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); + + foreach (var path in pathsToModify) + { + if (path.Key.StartsWith(this.BasePath)) + { + string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty); + swaggerDoc.Paths.Remove(path.Key); + swaggerDoc.Paths.Add(newKey, path.Value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..a0e2cb6871d --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(Operation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes; + + if (attributes != null && attributes.Count() > 0 && swaggerParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + swaggerParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + string regex = (string)regexAttr.ConstructorArguments[0].Value; + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Pattern = regex; + } + } + + // String Length [StringLength] + int? minLenght = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLenght = (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) + { + minLenght = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).MinLength = minLenght; + ((NonBodyParameter)swaggerParam).MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Minimum = rangeMin; + ((NonBodyParameter)swaggerParam).Maximum = rangeMax; + } + } + } + } + } + } +} + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 00000000000..616076b6078 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,19 @@ + + + IO.Swagger + IO.Swagger + netcoreapp2.2 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Amount.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Amount.cs new file mode 100644 index 00000000000..63839c2f8a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Amount.cs @@ -0,0 +1,137 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// some description + /// + [DataContract] + public partial class Amount : IEquatable + { + /// + /// some description + /// + /// some description + [Required] + [DataMember(Name="value")] + public double? Value { get; set; } + + /// + /// Gets or Sets Currency + /// + [Required] + [DataMember(Name="currency")] + public Currency Currency { 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 Amount {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Currency: ").Append(Currency).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 (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Amount)obj); + } + + /// + /// Returns true if Amount instances are equal + /// + /// Instance of Amount to be compared + /// Boolean + public bool Equals(Amount other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + Currency == other.Currency || + Currency != null && + Currency.Equals(other.Currency) + ); + } + + /// + /// 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 (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (Currency != null) + hashCode = hashCode * 59 + Currency.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Amount left, Amount right) + { + return Equals(left, right); + } + + public static bool operator !=(Amount left, Amount right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/ApiResponse.cs new file mode 100644 index 00000000000..eb444479ec4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/ApiResponse.cs @@ -0,0 +1,148 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code")] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type")] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + Code != null && + 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 :) + if (Code != null) + 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-v2.2-interface-only/src/IO.Swagger/Models/Category.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Category.cs new file mode 100644 index 00000000000..0f9df0830c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 :) + if (Id != null) + 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-v2.2-interface-only/src/IO.Swagger/Models/Currency.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Currency.cs new file mode 100644 index 00000000000..a5a499265cb --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Currency.cs @@ -0,0 +1,106 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// some description + /// + [DataContract] + public partial class Currency : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Currency {\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 (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Currency)obj); + } + + /// + /// Returns true if Currency instances are equal + /// + /// Instance of Currency to be compared + /// Boolean + public bool Equals(Currency other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// 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 :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Currency left, Currency right) + { + return Equals(left, right); + } + + public static bool operator !=(Currency left, Currency right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Order.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Order.cs new file mode 100644 index 00000000000..1e617fdf089 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Order.cs @@ -0,0 +1,218 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId")] + public long? PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity")] + public int? Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate")] + public DateTime? ShipDate { get; set; } + + /// + /// Order Status + /// + /// Order Status + [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")] + public StatusEnum? Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete")] + public bool? Complete { 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 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + PetId != null && + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + Quantity != null && + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + ShipDate != null && + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + Status != null && + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + Complete != null && + 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 :) + if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); + if (PetId != null) + hashCode = hashCode * 59 + PetId.GetHashCode(); + if (Quantity != null) + hashCode = hashCode * 59 + Quantity.GetHashCode(); + if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + if (Status != null) + hashCode = hashCode * 59 + Status.GetHashCode(); + if (Complete != null) + 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-v2.2-interface-only/src/IO.Swagger/Models/Pet.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Pet.cs new file mode 100644 index 00000000000..fc9884836f0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Pet.cs @@ -0,0 +1,220 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category")] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [Required] + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls")] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags")] + public List Tags { get; set; } + + /// + /// pet status in the store + /// + /// pet status in the store + [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")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + Status != null && + 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 :) + if (Id != null) + 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(); + if (Status != null) + 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-v2.2-interface-only/src/IO.Swagger/Models/Tag.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Tag.cs new file mode 100644 index 00000000000..d0cd5b744be --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/Tag.cs @@ -0,0 +1,134 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 :) + if (Id != null) + 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-v2.2-interface-only/src/IO.Swagger/Models/User.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/User.cs new file mode 100644 index 00000000000..4c9df2fd429 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Models/User.cs @@ -0,0 +1,219 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username")] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName")] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName")] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email")] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password")] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone")] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 != null && + 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 :) + if (Id != null) + 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(); + if (UserStatus != null) + 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-v2.2-interface-only/src/IO.Swagger/Program.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Program.cs new file mode 100644 index 00000000000..ae409c1ecb8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Program.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore; + +namespace IO.Swagger +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + /// + /// Create the web host builder. + /// + /// + /// IWebHostBuilder + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Properties/launchSettings.json new file mode 100644 index 00000000000..21acfed207b --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50352/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "web": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000/swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs new file mode 100644 index 00000000000..57b5fd5dfd9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs @@ -0,0 +1,50 @@ +using System; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text; +using System.Text.Encodings.Web; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace IO.Swagger.Security +{ + /// + /// class to handle api_key security. + /// + public class ApiKeyAuthenticationHandler : AuthenticationHandler + { + /// + /// scheme name for authentication handler. + /// + public const string SchemeName = "ApiKey"; + + public ApiKeyAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) + { + } + + /// + /// verify that require api key header exist and handle authorization. + /// + protected override async Task HandleAuthenticateAsync() + { + if (!Request.Headers.ContainsKey("api_key")) + { + return AuthenticateResult.Fail("Missing Authorization Header"); + } + + // do magic here! + + var claims = new[] { + new Claim(ClaimTypes.NameIdentifier, "changeme"), + new Claim(ClaimTypes.Name, "changeme"), + }; + var identity = new ClaimsIdentity(claims, Scheme.Name); + var principal = new ClaimsPrincipal(identity); + var ticket = new AuthenticationTicket(principal, Scheme.Name); + + return AuthenticateResult.Success(ticket); + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Startup.cs b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Startup.cs new file mode 100644 index 00000000000..73dc4b97234 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/Startup.cs @@ -0,0 +1,132 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using IO.Swagger.Filters; +using IO.Swagger.Security; + +using Microsoft.AspNetCore.Authentication; + +namespace IO.Swagger +{ + /// + /// Startup + /// + public class Startup + { + private readonly IHostingEnvironment _hostingEnv; + + private IConfiguration Configuration { get; } + + /// + /// Constructor + /// + /// + /// + public Startup(IHostingEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services + .AddMvc() + .AddJsonOptions(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter { + CamelCaseText = true + }); + }) + .AddXmlSerializerFormatters(); + + services.AddAuthentication(ApiKeyAuthenticationHandler.SchemeName) + .AddScheme(ApiKeyAuthenticationHandler.SchemeName, null); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("1.0.0", new Info + { + Version = "1.0.0", + Title = "Swagger Petstore", + Description = "Swagger Petstore (ASP.NET Core 2.0)", + Contact = new Contact() + { + Name = "Swagger Codegen Contributors", + Url = "https://github.com/swagger-api/swagger-codegen", + Email = "apiteam@swagger.io" + }, + TermsOfService = "http://swagger.io/terms/" + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.DescribeAllEnumsAsStrings(); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + // Sets the basePath property in the Swagger document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger 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, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + app + .UseMvc() + .UseDefaultFiles() + .UseStaticFiles() + .UseSwagger() + .UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) + // app.UseExceptionHandler("/Home/Error"); + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/appsettings.json b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/appsettings.json new file mode 100644 index 00000000000..c6af7d9b069 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Information", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/web.config b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/web.config new file mode 100644 index 00000000000..a3b9f6add9c --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/index.html b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/index.html new file mode 100644 index 00000000000..cde1f2f90b9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/swagger-original.json b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/swagger-original.json new file mode 100644 index 00000000000..95505bae5e2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/swagger-original.json @@ -0,0 +1,901 @@ +{ + "swagger" : "2.0", + "info" : { + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version" : "1.0.0", + "title" : "Swagger Petstore", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache-2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host" : "petstore.swagger.io", + "basePath" : "/v2", + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "schemes" : [ "http" ], + "paths" : { + "/pet" : { + "post" : { + "tags" : [ "pet" ], + "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" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "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" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "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", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/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", + "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", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "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" + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "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" + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "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", + "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" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ApiResponse" + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "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" + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ] + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "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" + } + }, + "400" : { + "description" : "Invalid Order" + } + } + } + }, + "/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 generated 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" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "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", + "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" + } + } + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "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" + } + } + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "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" + } + } + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "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" + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "type" : "integer", + "format" : "int32", + "description" : "calls per hour allowed by the user" + }, + "X-Expires-After" : { + "type" : "string", + "format" : "date-time", + "description" : "date in UTC when toekn expires" + } + }, + "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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "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.", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "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" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "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" + } ], + "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" : { + "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 + } + }, + "title" : "Pet Order", + "xml" : { + "name" : "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" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "xml" : { + "name" : "Category" + }, + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + } + }, + "User" : { + "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" + } + }, + "title" : "a User", + "xml" : { + "name" : "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" + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "xml" : { + "name" : "Tag" + }, + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + } + }, + "Pet" : { + "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" : { + "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" ] + } + }, + "title" : "a Pet", + "xml" : { + "name" : "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" + } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + } + }, + "Amount" : { + "type" : "object", + "required" : [ "currency", "value" ], + "properties" : { + "value" : { + "type" : "number", + "format" : "double", + "description" : "some description\n", + "minimum" : 0.01, + "maximum" : 1000000000000000 + }, + "currency" : { + "$ref" : "#/definitions/Currency" + } + }, + "description" : "some description\n" + }, + "Currency" : { + "type" : "string", + "pattern" : "^[A-Z]{3,3}$", + "description" : "some description\n" + } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/web.config b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/web.config new file mode 100644 index 00000000000..e70a7778d60 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2-interface-only/src/IO.Swagger/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2/.swagger-codegen-ignore b/samples/server/petstore/aspnetcore-v2.2/.swagger-codegen-ignore new file mode 100644 index 00000000000..c5fa491b4c5 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/.swagger-codegen-ignore @@ -0,0 +1,23 @@ +# Swagger Codegen Ignore +# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen + +# 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 Swagger Codgen 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-v2.2/.swagger-codegen/VERSION b/samples/server/petstore/aspnetcore-v2.2/.swagger-codegen/VERSION new file mode 100644 index 00000000000..8c7754221a4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/.swagger-codegen/VERSION @@ -0,0 +1 @@ +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2/IO.Swagger.sln b/samples/server/petstore/aspnetcore-v2.2/IO.Swagger.sln new file mode 100644 index 00000000000..912ff2e61ba --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/IO.Swagger.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}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.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-v2.2/NuGet.Config b/samples/server/petstore/aspnetcore-v2.2/NuGet.Config new file mode 100644 index 00000000000..01f3d1f203f --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/NuGet.Config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2/README.md b/samples/server/petstore/aspnetcore-v2.2/README.md new file mode 100644 index 00000000000..730f1daffcd --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/README.md @@ -0,0 +1,25 @@ +# IO.Swagger - ASP.NET Core 2.2 Server + +This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + +## Run + +Linux/OS X: + +``` +sh build.sh +``` + +Windows: + +``` +build.bat +``` + +## Run in Docker + +``` +cd src/IO.Swagger +docker build -t io.swagger . +docker run -p 5000:5000 io.swagger +``` diff --git a/samples/server/petstore/aspnetcore-v2.2/build.bat b/samples/server/petstore/aspnetcore-v2.2/build.bat new file mode 100644 index 00000000000..2e041233a06 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/build.bat @@ -0,0 +1,9 @@ +:: Generated by: https://github.com/swagger-api/swagger-codegen.git +:: + +@echo off + +dotnet restore src\IO.Swagger +dotnet build src\IO.Swagger +echo Now, run the following to start the project: dotnet run -p src\IO.Swagger\IO.Swagger.csproj --launch-profile web. +echo. diff --git a/samples/server/petstore/aspnetcore-v2.2/build.sh b/samples/server/petstore/aspnetcore-v2.2/build.sh new file mode 100644 index 00000000000..ce6063a2f49 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +# +# Generated by: https://github.com/swagger-api/swagger-codegen.git +# + +dotnet restore src/IO.Swagger/ && \ + dotnet build src/IO.Swagger/ && \ + echo "Now, run the following to start the project: dotnet run -p src/IO.Swagger/IO.Swagger.csproj --launch-profile web" diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/.gitignore b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/.gitignore new file mode 100644 index 00000000000..cd9b840e549 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/.gitignore @@ -0,0 +1,208 @@ +PID + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +build/ +bld/ +[Bb]in/ +[Oo]bj/ + +# Visual Studio 2015 cache/options directory +.vs/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opensdf +*.sdf +*.cachefile + +# Visual Studio profiler +*.psess +*.vsp +*.vspx + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml + +# 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 +# TODO: 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 + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config + +# Windows Azure Build Output +csx/ +*.build.csdef + +# Windows Store app package directory +AppPackages/ + +# 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/ +[Ss]tyle[Cc]op.* +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.pfx +*.publishsettings +node_modules/ +bower_components/ +orleans.codegen.cs + +# 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 + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs new file mode 100644 index 00000000000..07cfabe83cf --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Attributes/ValidateModelStateAttribute.cs @@ -0,0 +1,61 @@ +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 IO.Swagger.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/ + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + if (descriptor != null) + { + 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); + + var validationAttribute = attributeInstance as ValidationAttribute; + if (validationAttribute != null) + { + var isValid = validationAttribute.IsValid(args); + if (!isValid) + { + modelState.AddModelError(parameter.Name, validationAttribute.FormatErrorMessage(parameter.Name)); + } + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Controllers/PetApi.cs new file mode 100644 index 00000000000..8a4a9e71928 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Controllers/PetApi.cs @@ -0,0 +1,244 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; +using IO.Swagger.Security; +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; + +namespace IO.Swagger.Controllers +{ + /// + /// + /// + [ApiController] + public class PetApiController : ControllerBase + { + /// + /// Add a new pet to the store + /// + + /// Pet object that needs to be added to the store + /// Invalid input + [HttpPost] + [Route("/v2/pet")] + [ValidateModelState] + [SwaggerOperation("AddPet")] + public virtual IActionResult AddPet([FromBody]Pet body) + { + //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(); + } + + /// + /// Deletes a pet + /// + + /// Pet id to delete + /// + /// Invalid pet value + [HttpDelete] + [Route("/v2/pet/{petId}")] + [ValidateModelState] + [SwaggerOperation("DeletePet")] + public virtual IActionResult DeletePet([FromRoute][Required]long? petId, [FromHeader]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 + /// 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][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 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + 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} ]"; + + 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")] + public virtual IActionResult FindPetsByTags([FromQuery][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 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + 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} ]"; + + 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(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [ValidateModelState] + [SwaggerOperation("GetPetById")] + [SwaggerResponse(statusCode: 200, type: typeof(Pet), description: "successful operation")] + public virtual IActionResult GetPetById([FromRoute][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 123456789\n doggie\n \n aeiou\n \n \n \n aeiou\n"; + 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}"; + + 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 + /// Invalid ID supplied + /// Pet not found + /// Validation exception + [HttpPut] + [Route("/v2/pet")] + [ValidateModelState] + [SwaggerOperation("UpdatePet")] + public virtual IActionResult UpdatePet([FromBody]Pet body) + { + //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); + + + throw new NotImplementedException(); + } + + /// + /// 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}")] + [ValidateModelState] + [SwaggerOperation("UpdatePetWithForm")] + public virtual IActionResult UpdatePetWithForm([FromRoute][Required]long? petId, [FromForm]string name, [FromForm]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")] + [ValidateModelState] + [SwaggerOperation("UploadFile")] + [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] + public virtual IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _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-v2.2/src/IO.Swagger/Controllers/StoreApi.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Controllers/StoreApi.cs new file mode 100644 index 00000000000..306edc31d52 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Controllers/StoreApi.cs @@ -0,0 +1,146 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; +using IO.Swagger.Security; +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; + +namespace IO.Swagger.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][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(AuthenticationSchemes = ApiKeyAuthenticationHandler.SchemeName)] + [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; + exampleJson = "{\n \"key\" : 0\n}"; + + var example = exampleJson != null + ? JsonConvert.DeserializeObject>(exampleJson) + : default(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 generated 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][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 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + 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}"; + + 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")] + [ValidateModelState] + [SwaggerOperation("PlaceOrder")] + [SwaggerResponse(statusCode: 200, type: typeof(Order), description: "successful operation")] + public virtual IActionResult PlaceOrder([FromBody]Order body) + { + //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 123456789\n 123456789\n 123\n 2000-01-23T04:56:07.000Z\n aeiou\n true\n"; + 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}"; + + 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-v2.2/src/IO.Swagger/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Controllers/UserApi.cs new file mode 100644 index 00000000000..29e97a7b35e --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Controllers/UserApi.cs @@ -0,0 +1,220 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Collections.Generic; +using Microsoft.AspNetCore.Mvc; +using Swashbuckle.AspNetCore.Annotations; +using Swashbuckle.AspNetCore.SwaggerGen; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using IO.Swagger.Attributes; +using IO.Swagger.Security; +using Microsoft.AspNetCore.Authorization; +using IO.Swagger.Models; + +namespace IO.Swagger.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")] + [ValidateModelState] + [SwaggerOperation("CreateUser")] + public virtual IActionResult CreateUser([FromBody]User body) + { + //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")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithArrayInput")] + public virtual IActionResult CreateUsersWithArrayInput([FromBody]List body) + { + //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")] + [ValidateModelState] + [SwaggerOperation("CreateUsersWithListInput")] + public virtual IActionResult CreateUsersWithListInput([FromBody]List body) + { + //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}")] + [ValidateModelState] + [SwaggerOperation("DeleteUser")] + public virtual IActionResult DeleteUser([FromRoute][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][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 123456789\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n aeiou\n 123\n"; + 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}"; + + 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][Required()]string username, [FromQuery][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; + exampleJson = "aeiou"; + exampleJson = "\"\""; + + 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")] + [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}")] + [ValidateModelState] + [SwaggerOperation("UpdateUser")] + public virtual IActionResult UpdateUser([FromRoute][Required]string username, [FromBody]User body) + { + //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-v2.2/src/IO.Swagger/Dockerfile b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Dockerfile new file mode 100644 index 00000000000..967c8195c2b --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Dockerfile @@ -0,0 +1,18 @@ +FROM mcr.microsoft.com/dotnet/core/sdk:2.2 AS build-env +WORKDIR /app + +ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 + +# copy csproj and restore as distinct layers +COPY *.csproj ./ +RUN dotnet restore + +# copy everything else and build +COPY . ./ +RUN dotnet publish -c Release -o out + +# build runtime image +FROM mcr.microsoft.com/dotnet/core/aspnet:2.2 +WORKDIR /app +COPY --from=build-env /app/out . +ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Filters/BasePathFilter.cs new file mode 100644 index 00000000000..f3c528eada2 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Filters/BasePathFilter.cs @@ -0,0 +1,50 @@ +using System.Linq; +using System.Text.RegularExpressions; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// BasePath Document Filter sets BasePath property of Swagger 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 Swagger Doc + /// + /// The BasePath of the Swagger Doc + public string BasePath { get; } + + /// + /// Apply the filter + /// + /// SwaggerDocument + /// FilterContext + public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) + { + swaggerDoc.BasePath = this.BasePath; + + var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); + + foreach (var path in pathsToModify) + { + if (path.Key.StartsWith(this.BasePath)) + { + string newKey = Regex.Replace(path.Key, $"^{this.BasePath}", string.Empty); + swaggerDoc.Paths.Remove(path.Key); + swaggerDoc.Paths.Add(newKey, path.Value); + } + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs new file mode 100644 index 00000000000..a0e2cb6871d --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -0,0 +1,97 @@ +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNetCore.Mvc.Controllers; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; + +namespace IO.Swagger.Filters +{ + /// + /// Path Parameter Validation Rules Filter + /// + public class GeneratePathParamsValidationFilter : IOperationFilter + { + /// + /// Constructor + /// + /// Operation + /// OperationFilterContext + public void Apply(Operation operation, OperationFilterContext context) + { + var pars = context.ApiDescription.ParameterDescriptions; + + foreach (var par in pars) + { + var swaggerParam = operation.Parameters.SingleOrDefault(p => p.Name == par.Name); + + var attributes = ((ControllerParameterDescriptor)par.ParameterDescriptor).ParameterInfo.CustomAttributes; + + if (attributes != null && attributes.Count() > 0 && swaggerParam != null) + { + // Required - [Required] + var requiredAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RequiredAttribute)); + if (requiredAttr != null) + { + swaggerParam.Required = true; + } + + // Regex Pattern [RegularExpression] + var regexAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RegularExpressionAttribute)); + if (regexAttr != null) + { + string regex = (string)regexAttr.ConstructorArguments[0].Value; + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Pattern = regex; + } + } + + // String Length [StringLength] + int? minLenght = null, maxLength = null; + var stringLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(StringLengthAttribute)); + if (stringLengthAttr != null) + { + if (stringLengthAttr.NamedArguments.Count == 1) + { + minLenght = (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) + { + minLenght = (int)minLengthAttr.ConstructorArguments[0].Value; + } + + var maxLengthAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(MaxLengthAttribute)); + if (maxLengthAttr != null) + { + maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; + } + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).MinLength = minLenght; + ((NonBodyParameter)swaggerParam).MaxLength = maxLength; + } + + // Range [Range] + var rangeAttr = attributes.FirstOrDefault(p => p.AttributeType == typeof(RangeAttribute)); + if (rangeAttr != null) + { + int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; + int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; + + if (swaggerParam is NonBodyParameter) + { + ((NonBodyParameter)swaggerParam).Minimum = rangeMin; + ((NonBodyParameter)swaggerParam).Maximum = rangeMax; + } + } + } + } + } + } +} + diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/IO.Swagger.csproj new file mode 100644 index 00000000000..616076b6078 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/IO.Swagger.csproj @@ -0,0 +1,19 @@ + + + IO.Swagger + IO.Swagger + netcoreapp2.2 + true + true + IO.Swagger + IO.Swagger + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Amount.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Amount.cs new file mode 100644 index 00000000000..63839c2f8a1 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Amount.cs @@ -0,0 +1,137 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// some description + /// + [DataContract] + public partial class Amount : IEquatable + { + /// + /// some description + /// + /// some description + [Required] + [DataMember(Name="value")] + public double? Value { get; set; } + + /// + /// Gets or Sets Currency + /// + [Required] + [DataMember(Name="currency")] + public Currency Currency { 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 Amount {\n"); + sb.Append(" Value: ").Append(Value).Append("\n"); + sb.Append(" Currency: ").Append(Currency).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 (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Amount)obj); + } + + /// + /// Returns true if Amount instances are equal + /// + /// Instance of Amount to be compared + /// Boolean + public bool Equals(Amount other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Value == other.Value || + Value != null && + Value.Equals(other.Value) + ) && + ( + Currency == other.Currency || + Currency != null && + Currency.Equals(other.Currency) + ); + } + + /// + /// 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 (Value != null) + hashCode = hashCode * 59 + Value.GetHashCode(); + if (Currency != null) + hashCode = hashCode * 59 + Currency.GetHashCode(); + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Amount left, Amount right) + { + return Equals(left, right); + } + + public static bool operator !=(Amount left, Amount right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/ApiResponse.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/ApiResponse.cs new file mode 100644 index 00000000000..eb444479ec4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/ApiResponse.cs @@ -0,0 +1,148 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// Describes the result of uploading an image resource + /// + [DataContract] + public partial class ApiResponse : IEquatable + { + /// + /// Gets or Sets Code + /// + [DataMember(Name="code")] + public int? Code { get; set; } + + /// + /// Gets or Sets Type + /// + [DataMember(Name="type")] + public string Type { get; set; } + + /// + /// Gets or Sets Message + /// + [DataMember(Name="message")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Code == other.Code || + Code != null && + 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 :) + if (Code != null) + 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-v2.2/src/IO.Swagger/Models/Category.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Category.cs new file mode 100644 index 00000000000..0f9df0830c4 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Category.cs @@ -0,0 +1,134 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A category for a pet + /// + [DataContract] + public partial class Category : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 :) + if (Id != null) + 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-v2.2/src/IO.Swagger/Models/Currency.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Currency.cs new file mode 100644 index 00000000000..a5a499265cb --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Currency.cs @@ -0,0 +1,106 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// some description + /// + [DataContract] + public partial class Currency : IEquatable + { + /// + /// Returns the string presentation of the object + /// + /// String presentation of the object + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append("class Currency {\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 (ReferenceEquals(null, obj)) return false; + if (ReferenceEquals(this, obj)) return true; + return obj.GetType() == GetType() && Equals((Currency)obj); + } + + /// + /// Returns true if Currency instances are equal + /// + /// Instance of Currency to be compared + /// Boolean + public bool Equals(Currency other) + { + if (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return false; + } + + /// + /// 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 :) + return hashCode; + } + } + + #region Operators + #pragma warning disable 1591 + + public static bool operator ==(Currency left, Currency right) + { + return Equals(left, right); + } + + public static bool operator !=(Currency left, Currency right) + { + return !Equals(left, right); + } + + #pragma warning restore 1591 + #endregion Operators + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Order.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Order.cs new file mode 100644 index 00000000000..1e617fdf089 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Order.cs @@ -0,0 +1,218 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// An order for a pets from the pet store + /// + [DataContract] + public partial class Order : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets PetId + /// + [DataMember(Name="petId")] + public long? PetId { get; set; } + + /// + /// Gets or Sets Quantity + /// + [DataMember(Name="quantity")] + public int? Quantity { get; set; } + + /// + /// Gets or Sets ShipDate + /// + [DataMember(Name="shipDate")] + public DateTime? ShipDate { get; set; } + + /// + /// Order Status + /// + /// Order Status + [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")] + public StatusEnum? Status { get; set; } + + /// + /// Gets or Sets Complete + /// + [DataMember(Name="complete")] + public bool? Complete { 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 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + Id.Equals(other.Id) + ) && + ( + PetId == other.PetId || + PetId != null && + PetId.Equals(other.PetId) + ) && + ( + Quantity == other.Quantity || + Quantity != null && + Quantity.Equals(other.Quantity) + ) && + ( + ShipDate == other.ShipDate || + ShipDate != null && + ShipDate.Equals(other.ShipDate) + ) && + ( + Status == other.Status || + Status != null && + Status.Equals(other.Status) + ) && + ( + Complete == other.Complete || + Complete != null && + 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 :) + if (Id != null) + hashCode = hashCode * 59 + Id.GetHashCode(); + if (PetId != null) + hashCode = hashCode * 59 + PetId.GetHashCode(); + if (Quantity != null) + hashCode = hashCode * 59 + Quantity.GetHashCode(); + if (ShipDate != null) + hashCode = hashCode * 59 + ShipDate.GetHashCode(); + if (Status != null) + hashCode = hashCode * 59 + Status.GetHashCode(); + if (Complete != null) + 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-v2.2/src/IO.Swagger/Models/Pet.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Pet.cs new file mode 100644 index 00000000000..fc9884836f0 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Pet.cs @@ -0,0 +1,220 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A pet for sale in the pet store + /// + [DataContract] + public partial class Pet : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Category + /// + [DataMember(Name="category")] + public Category Category { get; set; } + + /// + /// Gets or Sets Name + /// + [Required] + [DataMember(Name="name")] + public string Name { get; set; } + + /// + /// Gets or Sets PhotoUrls + /// + [Required] + [DataMember(Name="photoUrls")] + public List PhotoUrls { get; set; } + + /// + /// Gets or Sets Tags + /// + [DataMember(Name="tags")] + public List Tags { get; set; } + + /// + /// pet status in the store + /// + /// pet status in the store + [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")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 && + PhotoUrls.SequenceEqual(other.PhotoUrls) + ) && + ( + Tags == other.Tags || + Tags != null && + Tags.SequenceEqual(other.Tags) + ) && + ( + Status == other.Status || + Status != null && + 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 :) + if (Id != null) + 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(); + if (Status != null) + 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-v2.2/src/IO.Swagger/Models/Tag.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Tag.cs new file mode 100644 index 00000000000..d0cd5b744be --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/Tag.cs @@ -0,0 +1,134 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A tag for a pet + /// + [DataContract] + public partial class Tag : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Name + /// + [DataMember(Name="name")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 :) + if (Id != null) + 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-v2.2/src/IO.Swagger/Models/User.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/User.cs new file mode 100644 index 00000000000..4c9df2fd429 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Models/User.cs @@ -0,0 +1,219 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.Linq; +using System.IO; +using System.Text; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.ComponentModel.DataAnnotations; +using System.Runtime.Serialization; +using Newtonsoft.Json; + +namespace IO.Swagger.Models +{ + /// + /// A User who is purchasing from the pet store + /// + [DataContract] + public partial class User : IEquatable + { + /// + /// Gets or Sets Id + /// + [DataMember(Name="id")] + public long? Id { get; set; } + + /// + /// Gets or Sets Username + /// + [DataMember(Name="username")] + public string Username { get; set; } + + /// + /// Gets or Sets FirstName + /// + [DataMember(Name="firstName")] + public string FirstName { get; set; } + + /// + /// Gets or Sets LastName + /// + [DataMember(Name="lastName")] + public string LastName { get; set; } + + /// + /// Gets or Sets Email + /// + [DataMember(Name="email")] + public string Email { get; set; } + + /// + /// Gets or Sets Password + /// + [DataMember(Name="password")] + public string Password { get; set; } + + /// + /// Gets or Sets Phone + /// + [DataMember(Name="phone")] + public string Phone { get; set; } + + /// + /// User Status + /// + /// User Status + [DataMember(Name="userStatus")] + 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 (ReferenceEquals(null, obj)) 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 (ReferenceEquals(null, other)) return false; + if (ReferenceEquals(this, other)) return true; + + return + ( + Id == other.Id || + Id != null && + 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 != null && + 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 :) + if (Id != null) + 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(); + if (UserStatus != null) + 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-v2.2/src/IO.Swagger/Program.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Program.cs new file mode 100644 index 00000000000..ae409c1ecb8 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Program.cs @@ -0,0 +1,29 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore; + +namespace IO.Swagger +{ + /// + /// Program + /// + public class Program + { + /// + /// Main + /// + /// + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + /// + /// Create the web host builder. + /// + /// + /// IWebHostBuilder + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Properties/launchSettings.json b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Properties/launchSettings.json new file mode 100644 index 00000000000..21acfed207b --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Properties/launchSettings.json @@ -0,0 +1,28 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:50352/", + "sslPort": 0 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "web": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "http://localhost:5000/swagger/", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs new file mode 100644 index 00000000000..57b5fd5dfd9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Security/ApiKeyAuthenticationHandler.cs @@ -0,0 +1,50 @@ +using System; +using System.Net.Http.Headers; +using System.Security.Claims; +using System.Text; +using System.Text.Encodings.Web; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; + +namespace IO.Swagger.Security +{ + /// + /// class to handle api_key security. + /// + public class ApiKeyAuthenticationHandler : AuthenticationHandler + { + /// + /// scheme name for authentication handler. + /// + public const string SchemeName = "ApiKey"; + + public ApiKeyAuthenticationHandler(IOptionsMonitor options, ILoggerFactory logger, UrlEncoder encoder, ISystemClock clock) : base(options, logger, encoder, clock) + { + } + + /// + /// verify that require api key header exist and handle authorization. + /// + protected override async Task HandleAuthenticateAsync() + { + if (!Request.Headers.ContainsKey("api_key")) + { + return AuthenticateResult.Fail("Missing Authorization Header"); + } + + // do magic here! + + var claims = new[] { + new Claim(ClaimTypes.NameIdentifier, "changeme"), + new Claim(ClaimTypes.Name, "changeme"), + }; + var identity = new ClaimsIdentity(claims, Scheme.Name); + var principal = new ClaimsPrincipal(identity); + var ticket = new AuthenticationTicket(principal, Scheme.Name); + + return AuthenticateResult.Success(ticket); + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Startup.cs b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Startup.cs new file mode 100644 index 00000000000..73dc4b97234 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/Startup.cs @@ -0,0 +1,132 @@ +/* + * Swagger Petstore + * + * This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + * + * OpenAPI spec version: 1.0.0 + * Contact: apiteam@swagger.io + * Generated by: https://github.com/swagger-api/swagger-codegen.git + */ + +using System; +using System.IO; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Newtonsoft.Json.Converters; +using Newtonsoft.Json.Serialization; +using Swashbuckle.AspNetCore.Swagger; +using Swashbuckle.AspNetCore.SwaggerGen; +using IO.Swagger.Filters; +using IO.Swagger.Security; + +using Microsoft.AspNetCore.Authentication; + +namespace IO.Swagger +{ + /// + /// Startup + /// + public class Startup + { + private readonly IHostingEnvironment _hostingEnv; + + private IConfiguration Configuration { get; } + + /// + /// Constructor + /// + /// + /// + public Startup(IHostingEnvironment env, IConfiguration configuration) + { + _hostingEnv = env; + Configuration = configuration; + } + + /// + /// This method gets called by the runtime. Use this method to add services to the container. + /// + /// + public void ConfigureServices(IServiceCollection services) + { + // Add framework services. + services + .AddMvc() + .AddJsonOptions(opts => + { + opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); + opts.SerializerSettings.Converters.Add(new StringEnumConverter { + CamelCaseText = true + }); + }) + .AddXmlSerializerFormatters(); + + services.AddAuthentication(ApiKeyAuthenticationHandler.SchemeName) + .AddScheme(ApiKeyAuthenticationHandler.SchemeName, null); + + + services + .AddSwaggerGen(c => + { + c.SwaggerDoc("1.0.0", new Info + { + Version = "1.0.0", + Title = "Swagger Petstore", + Description = "Swagger Petstore (ASP.NET Core 2.0)", + Contact = new Contact() + { + Name = "Swagger Codegen Contributors", + Url = "https://github.com/swagger-api/swagger-codegen", + Email = "apiteam@swagger.io" + }, + TermsOfService = "http://swagger.io/terms/" + }); + c.CustomSchemaIds(type => type.FriendlyId(true)); + c.DescribeAllEnumsAsStrings(); + c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); + // Sets the basePath property in the Swagger document generated + c.DocumentFilter("/v2"); + + // Include DataAnnotation attributes on Controller Action parameters as Swagger 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, IHostingEnvironment env, ILoggerFactory loggerFactory) + { + app + .UseMvc() + .UseDefaultFiles() + .UseStaticFiles() + .UseSwagger() + .UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); + }); + + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) + // app.UseExceptionHandler("/Home/Error"); + } + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/appsettings.json b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/appsettings.json new file mode 100644 index 00000000000..c6af7d9b069 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "IncludeScopes": false, + "LogLevel": { + "Default": "Information", + "System": "Information", + "Microsoft": "Information" + } + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/web.config b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/web.config new file mode 100644 index 00000000000..a3b9f6add9c --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/web.config @@ -0,0 +1,14 @@ + + + + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/index.html b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/index.html new file mode 100644 index 00000000000..cde1f2f90b9 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/index.html @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/swagger-original.json b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/swagger-original.json new file mode 100644 index 00000000000..55fa5c40e20 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/swagger-original.json @@ -0,0 +1,901 @@ +{ + "swagger" : "2.0", + "info" : { + "description" : "This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters.", + "version" : "1.0.0", + "title" : "Swagger Petstore", + "termsOfService" : "http://swagger.io/terms/", + "contact" : { + "email" : "apiteam@swagger.io" + }, + "license" : { + "name" : "Apache-2.0", + "url" : "http://www.apache.org/licenses/LICENSE-2.0.html" + } + }, + "host" : "petstore.swagger.io", + "basePath" : "/v2", + "tags" : [ { + "name" : "pet", + "description" : "Everything about your Pets", + "externalDocs" : { + "description" : "Find out more", + "url" : "http://swagger.io" + } + }, { + "name" : "store", + "description" : "Access to Petstore orders" + }, { + "name" : "user", + "description" : "Operations about user", + "externalDocs" : { + "description" : "Find out more about our store", + "url" : "http://swagger.io" + } + } ], + "schemes" : [ "http" ], + "paths" : { + "/pet" : { + "post" : { + "tags" : [ "pet" ], + "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" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "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" : { + "400" : { + "description" : "Invalid ID supplied" + }, + "404" : { + "description" : "Pet not found" + }, + "405" : { + "description" : "Validation exception" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/pet/findByStatus" : { + "get" : { + "tags" : [ "pet" ], + "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", + "default" : "available", + "enum" : [ "available", "pending", "sold" ] + }, + "collectionFormat" : "csv" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/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", + "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", + "schema" : { + "type" : "array", + "items" : { + "$ref" : "#/definitions/Pet" + } + } + }, + "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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "petId", + "in" : "path", + "description" : "ID of pet to return", + "required" : true, + "type" : "integer", + "format" : "int64" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "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" + } ], + "responses" : { + "405" : { + "description" : "Invalid input" + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + }, + "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" + }, { + "name" : "petId", + "in" : "path", + "description" : "Pet id to delete", + "required" : true, + "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", + "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" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/ApiResponse" + } + } + }, + "security" : [ { + "petstore_auth" : [ "write:pets", "read:pets" ] + } ] + } + }, + "/store/inventory" : { + "get" : { + "tags" : [ "store" ], + "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" + } + } + } + }, + "security" : [ { + "api_key" : [ ] + } ] + } + }, + "/store/order" : { + "post" : { + "tags" : [ "store" ], + "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" + } + }, + "400" : { + "description" : "Invalid Order" + } + } + } + }, + "/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 generated 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" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ { + "name" : "orderId", + "in" : "path", + "description" : "ID of the order that needs to be deleted", + "required" : true, + "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", + "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" + } + } + } + }, + "/user/createWithArray" : { + "post" : { + "tags" : [ "user" ], + "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" + } + } + } + }, + "/user/createWithList" : { + "post" : { + "tags" : [ "user" ], + "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" + } + } + } + }, + "/user/login" : { + "get" : { + "tags" : [ "user" ], + "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" + }, { + "name" : "password", + "in" : "query", + "description" : "The password for login in clear text", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "headers" : { + "X-Rate-Limit" : { + "type" : "integer", + "format" : "int32", + "description" : "calls per hour allowed by the user" + }, + "X-Expires-After" : { + "type" : "string", + "format" : "date-time", + "description" : "date in UTC when toekn expires" + } + }, + "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", + "produces" : [ "application/xml", "application/json" ], + "parameters" : [ ], + "responses" : { + "default" : { + "description" : "successful operation" + } + } + } + }, + "/user/{username}" : { + "get" : { + "tags" : [ "user" ], + "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.", + "required" : true, + "type" : "string" + } ], + "responses" : { + "200" : { + "description" : "successful operation", + "schema" : { + "$ref" : "#/definitions/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", + "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" + } + } ], + "responses" : { + "400" : { + "description" : "Invalid user supplied" + }, + "404" : { + "description" : "User not found" + } + } + }, + "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" + } ], + "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" : { + "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 + } + }, + "title" : "Pet Order", + "xml" : { + "name" : "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" + } + }, + "Category" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet category", + "xml" : { + "name" : "Category" + }, + "description" : "A category for a pet", + "example" : { + "name" : "name", + "id" : 6 + } + }, + "User" : { + "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" + } + }, + "title" : "a User", + "xml" : { + "name" : "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" + } + }, + "Tag" : { + "type" : "object", + "properties" : { + "id" : { + "type" : "integer", + "format" : "int64" + }, + "name" : { + "type" : "string" + } + }, + "title" : "Pet Tag", + "xml" : { + "name" : "Tag" + }, + "description" : "A tag for a pet", + "example" : { + "name" : "name", + "id" : 1 + } + }, + "Pet" : { + "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" : { + "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" ] + } + }, + "title" : "a Pet", + "xml" : { + "name" : "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" + } + }, + "ApiResponse" : { + "type" : "object", + "properties" : { + "code" : { + "type" : "integer", + "format" : "int32" + }, + "type" : { + "type" : "string" + }, + "message" : { + "type" : "string" + } + }, + "title" : "An uploaded response", + "description" : "Describes the result of uploading an image resource", + "example" : { + "code" : 0, + "type" : "type", + "message" : "message" + } + }, + "Amount" : { + "type" : "object", + "required" : [ "currency", "value" ], + "properties" : { + "value" : { + "type" : "number", + "format" : "double", + "description" : "some description\n", + "minimum" : 0.01, + "maximum" : 1000000000000000 + }, + "currency" : { + "$ref" : "#/definitions/Currency" + } + }, + "description" : "some description\n" + }, + "Currency" : { + "type" : "string", + "pattern" : "^[A-Z]{3,3}$", + "description" : "some description\n" + } + }, + "externalDocs" : { + "description" : "Find out more about Swagger", + "url" : "http://swagger.io" + } +} diff --git a/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/web.config b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/web.config new file mode 100644 index 00000000000..e70a7778d60 --- /dev/null +++ b/samples/server/petstore/aspnetcore-v2.2/src/IO.Swagger/wwwroot/web.config @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/samples/server/petstore/aspnetcore/.swagger-codegen/VERSION b/samples/server/petstore/aspnetcore/.swagger-codegen/VERSION index 6cecc1a68f3..8c7754221a4 100644 --- a/samples/server/petstore/aspnetcore/.swagger-codegen/VERSION +++ b/samples/server/petstore/aspnetcore/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.6-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/aspnetcore/IO.Swagger.sln b/samples/server/petstore/aspnetcore/IO.Swagger.sln index 045f3a11a74..912ff2e61ba 100644 --- a/samples/server/petstore/aspnetcore/IO.Swagger.sln +++ b/samples/server/petstore/aspnetcore/IO.Swagger.sln @@ -1,21 +1,22 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 + +Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26114.2 +VisualStudioVersion = 15.0.27428.2043 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.csproj", "{3C799344-F285-4669-8FD5-7ED9B795D5C5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IO.Swagger", "src\IO.Swagger\IO.Swagger.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 + 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/README.md b/samples/server/petstore/aspnetcore/README.md index 07aa834ff03..eb0d56deed5 100644 --- a/samples/server/petstore/aspnetcore/README.md +++ b/samples/server/petstore/aspnetcore/README.md @@ -1,4 +1,4 @@ -# IO.Swagger - ASP.NET Core 2.0 Server +# IO.Swagger - ASP.NET Core 3.0 Server This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs index e490fccc50b..8a4a9e71928 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/PetApi.cs @@ -219,14 +219,14 @@ public virtual IActionResult UpdatePetWithForm([FromRoute][Required]long? petId, /// ID of pet to update /// Additional data to pass to server - /// file to upload + /// file to upload /// successful operation [HttpPost] [Route("/v2/pet/{petId}/uploadImage")] [ValidateModelState] [SwaggerOperation("UploadFile")] [SwaggerResponse(statusCode: 200, type: typeof(ApiResponse), description: "successful operation")] - public virtual IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream file) + public virtual IActionResult UploadFile([FromRoute][Required]long? petId, [FromForm]string additionalMetadata, [FromForm]System.IO.Stream _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)); diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs index 29e97a7b35e..a7dc4d78e2e 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Controllers/UserApi.cs @@ -16,7 +16,7 @@ using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; using IO.Swagger.Attributes; -using IO.Swagger.Security; + using Microsoft.AspNetCore.Authorization; using IO.Swagger.Models; diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Dockerfile b/samples/server/petstore/aspnetcore/src/IO.Swagger/Dockerfile index 6b07232e561..2fc62d322e0 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Dockerfile +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Dockerfile @@ -1,4 +1,4 @@ -FROM microsoft/aspnetcore-build:2.0 AS build-env +FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build-env WORKDIR /app ENV DOTNET_CLI_TELEMETRY_OPTOUT 1 @@ -12,7 +12,7 @@ COPY . ./ RUN dotnet publish -c Release -o out # build runtime image -FROM microsoft/aspnetcore:2.0 +FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 WORKDIR /app COPY --from=build-env /app/out . ENTRYPOINT ["dotnet", "IO.Swagger.dll"] diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/BasePathFilter.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/BasePathFilter.cs index f3c528eada2..c9d95d6d189 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/BasePathFilter.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/BasePathFilter.cs @@ -2,6 +2,7 @@ using System.Text.RegularExpressions; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { @@ -28,11 +29,11 @@ public BasePathFilter(string basePath) /// /// Apply the filter /// - /// SwaggerDocument + /// OpenApiDocument /// FilterContext - public void Apply(SwaggerDocument swaggerDoc, DocumentFilterContext context) + public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) { - swaggerDoc.BasePath = this.BasePath; + swaggerDoc.Servers.Add(new OpenApiServer() { Url = this.BasePath }); var pathsToModify = swaggerDoc.Paths.Where(p => p.Key.StartsWith(this.BasePath)).ToList(); diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs index a0e2cb6871d..a16d303b32a 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Filters/GeneratePathParamsValidationFilter.cs @@ -3,6 +3,7 @@ using Microsoft.AspNetCore.Mvc.Controllers; using Swashbuckle.AspNetCore.Swagger; using Swashbuckle.AspNetCore.SwaggerGen; +using Microsoft.OpenApi.Models; namespace IO.Swagger.Filters { @@ -16,7 +17,7 @@ public class GeneratePathParamsValidationFilter : IOperationFilter /// /// Operation /// OperationFilterContext - public void Apply(Operation operation, OperationFilterContext context) + public void Apply(OpenApiOperation operation, OperationFilterContext context) { var pars = context.ApiDescription.ParameterDescriptions; @@ -40,9 +41,9 @@ public void Apply(Operation operation, OperationFilterContext context) if (regexAttr != null) { string regex = (string)regexAttr.ConstructorArguments[0].Value; - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).Pattern = regex; + ((OpenApiParameter)swaggerParam).Schema.Pattern = regex; } } @@ -70,10 +71,10 @@ public void Apply(Operation operation, OperationFilterContext context) maxLength = (int)maxLengthAttr.ConstructorArguments[0].Value; } - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).MinLength = minLenght; - ((NonBodyParameter)swaggerParam).MaxLength = maxLength; + ((OpenApiParameter)swaggerParam).Schema.MinLength = minLenght; + ((OpenApiParameter)swaggerParam).Schema.MaxLength = maxLength; } // Range [Range] @@ -83,10 +84,10 @@ public void Apply(Operation operation, OperationFilterContext context) int rangeMin = (int)rangeAttr.ConstructorArguments[0].Value; int rangeMax = (int)rangeAttr.ConstructorArguments[1].Value; - if (swaggerParam is NonBodyParameter) + if (swaggerParam is OpenApiParameter) { - ((NonBodyParameter)swaggerParam).Minimum = rangeMin; - ((NonBodyParameter)swaggerParam).Maximum = rangeMax; + ((OpenApiParameter)swaggerParam).Schema.Minimum = rangeMin; + ((OpenApiParameter)swaggerParam).Schema.Maximum = rangeMax; } } } diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/IO.Swagger.csproj b/samples/server/petstore/aspnetcore/src/IO.Swagger/IO.Swagger.csproj index 616076b6078..b864e584350 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/IO.Swagger.csproj +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/IO.Swagger.csproj @@ -2,18 +2,19 @@ IO.Swagger IO.Swagger - netcoreapp2.2 + netcoreapp3.0 true true IO.Swagger IO.Swagger - - - + + + + - + diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs b/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs index 73dc4b97234..3cb7c12d86a 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/Startup.cs @@ -10,11 +10,14 @@ using System; using System.IO; +using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.OpenApi.Models; using Newtonsoft.Json.Converters; using Newtonsoft.Json.Serialization; using Swashbuckle.AspNetCore.Swagger; @@ -22,8 +25,6 @@ using IO.Swagger.Filters; using IO.Swagger.Security; -using Microsoft.AspNetCore.Authentication; - namespace IO.Swagger { /// @@ -31,7 +32,7 @@ namespace IO.Swagger /// public class Startup { - private readonly IHostingEnvironment _hostingEnv; + private readonly IWebHostEnvironment _hostingEnv; private IConfiguration Configuration { get; } @@ -40,7 +41,7 @@ public class Startup /// /// /// - public Startup(IHostingEnvironment env, IConfiguration configuration) + public Startup(IWebHostEnvironment env, IConfiguration configuration) { _hostingEnv = env; Configuration = configuration; @@ -54,13 +55,15 @@ public void ConfigureServices(IServiceCollection services) { // Add framework services. services - .AddMvc() - .AddJsonOptions(opts => + .AddMvc(options => + { + options.InputFormatters.RemoveType(); + options.OutputFormatters.RemoveType(); + }) + .AddNewtonsoftJson(opts => { opts.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); - opts.SerializerSettings.Converters.Add(new StringEnumConverter { - CamelCaseText = true - }); + opts.SerializerSettings.Converters.Add(new StringEnumConverter(new CamelCaseNamingStrategy())); }) .AddXmlSerializerFormatters(); @@ -71,21 +74,20 @@ public void ConfigureServices(IServiceCollection services) services .AddSwaggerGen(c => { - c.SwaggerDoc("1.0.0", new Info + c.SwaggerDoc("1.0.0", new OpenApiInfo { Version = "1.0.0", Title = "Swagger Petstore", - Description = "Swagger Petstore (ASP.NET Core 2.0)", - Contact = new Contact() + Description = "Swagger Petstore (ASP.NET Core 3.0)", + Contact = new OpenApiContact() { Name = "Swagger Codegen Contributors", - Url = "https://github.com/swagger-api/swagger-codegen", + Url = new Uri("https://github.com/swagger-api/swagger-codegen"), Email = "apiteam@swagger.io" }, - TermsOfService = "http://swagger.io/terms/" + TermsOfService = new Uri("http://swagger.io/terms/") }); - c.CustomSchemaIds(type => type.FriendlyId(true)); - c.DescribeAllEnumsAsStrings(); + c.CustomSchemaIds(type => type.FullName); c.IncludeXmlComments($"{AppContext.BaseDirectory}{Path.DirectorySeparatorChar}{_hostingEnv.ApplicationName}.xml"); // Sets the basePath property in the Swagger document generated c.DocumentFilter("/v2"); @@ -102,21 +104,32 @@ public void ConfigureServices(IServiceCollection services) /// /// /// - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) + public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory) { - app - .UseMvc() - .UseDefaultFiles() - .UseStaticFiles() - .UseSwagger() - .UseSwaggerUI(c => - { - //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) - c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + app.UseRouting(); - //TODO: Or alternatively use the original Swagger contract that's included in the static files - // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); - }); + //TODO: Uncomment this if you need wwwroot folder + // app.UseStaticFiles(); + + app.UseAuthorization(); + + app.UseSwagger(); + app.UseSwaggerUI(c => + { + //TODO: Either use the SwaggerGen generated Swagger contract (generated from C# classes) + c.SwaggerEndpoint("/swagger/1.0.0/swagger.json", "Swagger Petstore"); + + //TODO: Or alternatively use the original Swagger contract that's included in the static files + // c.SwaggerEndpoint("/swagger-original.json", "Swagger Petstore Original"); + }); + + //TODO: Use Https Redirection + // app.UseHttpsRedirection(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); if (env.IsDevelopment()) { @@ -125,7 +138,9 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF else { //TODO: Enable production exception handling (https://docs.microsoft.com/en-us/aspnet/core/fundamentals/error-handling) - // app.UseExceptionHandler("/Home/Error"); + app.UseExceptionHandler("/Error"); + + app.UseHsts(); } } } diff --git a/samples/server/petstore/aspnetcore/src/IO.Swagger/wwwroot/swagger-original.json b/samples/server/petstore/aspnetcore/src/IO.Swagger/wwwroot/swagger-original.json index 55fa5c40e20..95505bae5e2 100644 --- a/samples/server/petstore/aspnetcore/src/IO.Swagger/wwwroot/swagger-original.json +++ b/samples/server/petstore/aspnetcore/src/IO.Swagger/wwwroot/swagger-original.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala index 3f35d7b0123..2a277fed1a1 100644 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/PetApi.scala @@ -17,6 +17,7 @@ import com.twitter.util.Future import com.twitter.io.Buf import io.finch._, items._ import java.io.File +import java.nio.file.Files import java.time._ object PetApi { @@ -56,11 +57,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a Unit */ private def addPet(da: DataAccessor): Endpoint[Unit] = - post("pet" :: jsonBody[Pet]) { (body: Pet) => + post("pet" :: jsonBody[Pet]) { (body: Pet) => da.Pet_addPet(body) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -70,11 +71,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a Unit */ private def deletePet(da: DataAccessor): Endpoint[Unit] = - delete("pet" :: long :: headerOption("api_key")) { (petId: Long, apiKey: Option[String]) => + delete("pet" :: long :: headerOption("api_key")) { (petId: Long, apiKey: Option[String]) => da.Pet_deletePet(petId, apiKey) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -84,11 +85,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a Seq[Pet] */ private def findPetsByStatus(da: DataAccessor): Endpoint[Seq[Pet]] = - get("pet" :: "findByStatus" :: params("status")) { (status: Seq[String]) => + get("pet" :: "findByStatus" :: params("status")) { (status: Seq[String]) => da.Pet_findPetsByStatus(status) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -98,11 +99,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a Seq[Pet] */ private def findPetsByTags(da: DataAccessor): Endpoint[Seq[Pet]] = - get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => + get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => da.Pet_findPetsByTags(tags) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -112,11 +113,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a Pet */ private def getPetById(da: DataAccessor): Endpoint[Pet] = - get("pet" :: long :: header("api_key")) { (petId: Long, authParamapi_key: String) => + get("pet" :: long :: header("api_key")) { (petId: Long, authParamapi_key: String) => da.Pet_getPetById(petId, authParamapi_key) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -126,11 +127,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a Unit */ private def updatePet(da: DataAccessor): Endpoint[Unit] = - put("pet" :: jsonBody[Pet]) { (body: Pet) => + put("pet" :: jsonBody[Pet]) { (body: Pet) => da.Pet_updatePet(body) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -140,11 +141,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a Unit */ private def updatePetWithForm(da: DataAccessor): Endpoint[Unit] = - post("pet" :: long :: string :: string) { (petId: Long, name: Option[String], status: Option[String]) => + post("pet" :: long :: string :: string) { (petId: Long, name: Option[String], status: Option[String]) => da.Pet_updatePetWithForm(petId, name, status) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -154,11 +155,11 @@ object PetApi { } /** - * + * * @return An endpoint representing a ApiResponse */ private def uploadFile(da: DataAccessor): Endpoint[ApiResponse] = - post("pet" :: long :: "uploadImage" :: string :: fileUpload("file")) { (petId: Long, additionalMetadata: Option[String], file: FileUpload) => + post("pet" :: long :: "uploadImage" :: string :: fileUpload("file")) { (petId: Long, additionalMetadata: Option[String], file: FileUpload) => da.Pet_uploadFile(petId, additionalMetadata, file) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -179,7 +180,7 @@ object PetApi { } private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpPetApi", null) + val file = Files.createTempFile("tmpPetApi", null).toFile() val output = new FileOutputStream(file) output.write(input) file diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala index c45ef8153fd..386cba2eaf1 100644 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/StoreApi.scala @@ -15,6 +15,7 @@ import com.twitter.util.Future import com.twitter.io.Buf import io.finch._, items._ import java.io.File +import java.nio.file.Files import java.time._ object StoreApi { @@ -50,11 +51,11 @@ object StoreApi { } /** - * + * * @return An endpoint representing a Unit */ private def deleteOrder(da: DataAccessor): Endpoint[Unit] = - delete("store" :: "order" :: string) { (orderId: String) => + delete("store" :: "order" :: string) { (orderId: String) => da.Store_deleteOrder(orderId) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -64,11 +65,11 @@ object StoreApi { } /** - * + * * @return An endpoint representing a Map[String, Int] */ private def getInventory(da: DataAccessor): Endpoint[Map[String, Int]] = - get("store" :: "inventory" :: header("api_key")) { + get("store" :: "inventory" :: header("api_key")) { da.Store_getInventory(authParamapi_key) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -78,11 +79,11 @@ object StoreApi { } /** - * + * * @return An endpoint representing a Order */ private def getOrderById(da: DataAccessor): Endpoint[Order] = - get("store" :: "order" :: long) { (orderId: Long) => + get("store" :: "order" :: long) { (orderId: Long) => da.Store_getOrderById(orderId) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -92,11 +93,11 @@ object StoreApi { } /** - * + * * @return An endpoint representing a Order */ private def placeOrder(da: DataAccessor): Endpoint[Order] = - post("store" :: "order" :: jsonBody[Order]) { (body: Order) => + post("store" :: "order" :: jsonBody[Order]) { (body: Order) => da.Store_placeOrder(body) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -117,7 +118,7 @@ object StoreApi { } private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpStoreApi", null) + val file = Files.createTempFile("tmpStoreApi", null).toFile() val output = new FileOutputStream(file) output.write(input) file diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala index c33effe4417..ea75ee25a6a 100644 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/apis/UserApi.scala @@ -16,6 +16,7 @@ import com.twitter.util.Future import com.twitter.io.Buf import io.finch._, items._ import java.io.File +import java.nio.file.Files import java.time._ object UserApi { @@ -55,11 +56,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a Unit */ private def createUser(da: DataAccessor): Endpoint[Unit] = - post("user" :: jsonBody[User]) { (body: User) => + post("user" :: jsonBody[User]) { (body: User) => da.User_createUser(body) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -69,11 +70,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a Unit */ private def createUsersWithArrayInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => da.User_createUsersWithArrayInput(body) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -83,11 +84,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a Unit */ private def createUsersWithListInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => da.User_createUsersWithListInput(body) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -97,11 +98,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a Unit */ private def deleteUser(da: DataAccessor): Endpoint[Unit] = - delete("user" :: string) { (username: String) => + delete("user" :: string) { (username: String) => da.User_deleteUser(username) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -111,11 +112,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a User */ private def getUserByName(da: DataAccessor): Endpoint[User] = - get("user" :: string) { (username: String) => + get("user" :: string) { (username: String) => da.User_getUserByName(username) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -125,11 +126,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a String */ private def loginUser(da: DataAccessor): Endpoint[String] = - get("user" :: "login" :: param("username") :: param("password")) { (username: String, password: String) => + get("user" :: "login" :: param("username") :: param("password")) { (username: String, password: String) => da.User_loginUser(username, password) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -139,11 +140,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a Unit */ private def logoutUser(da: DataAccessor): Endpoint[Unit] = - get("user" :: "logout") { + get("user" :: "logout") { da.User_logoutUser() match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -153,11 +154,11 @@ object UserApi { } /** - * + * * @return An endpoint representing a Unit */ private def updateUser(da: DataAccessor): Endpoint[Unit] = - put("user" :: string :: jsonBody[User]) { (username: String, body: User) => + put("user" :: string :: jsonBody[User]) { (username: String, body: User) => da.User_updateUser(username, body) match { case Left(error) => checkError(error) case Right(data) => Ok(data) @@ -178,7 +179,7 @@ object UserApi { } private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpUserApi", null) + val file = Files.createTempFile("tmpUserApi", null).toFile() val output = new FileOutputStream(file) output.write(input) file diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala index da83cbe3e47..1a259cb3e72 100644 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/PetApi.scala @@ -18,6 +18,7 @@ import com.twitter.util.Future import com.twitter.io.Buf import io.finch._, items._ import java.io.File +import java.nio.file.Files object PetApi { /** @@ -35,11 +36,11 @@ object PetApi { uploadFile(da) /** - * + * * @return And endpoint representing a Unit */ private def addPet(da: DataAccessor): Endpoint[Unit] = - post("pet" :: jsonBody[Pet]) { (body: Pet) => + post("pet" :: jsonBody[Pet]) { (body: Pet) => da.Pet_addPet(body) NoContent[Unit] } handle { @@ -47,11 +48,11 @@ object PetApi { } /** - * + * * @return And endpoint representing a Unit */ private def deletePet(da: DataAccessor): Endpoint[Unit] = - delete("pet" :: long :: string) { (petId: Long, apiKey: String) => + delete("pet" :: long :: string) { (petId: Long, apiKey: String) => da.Pet_deletePet(petId, apiKey) NoContent[Unit] } handle { @@ -59,44 +60,44 @@ object PetApi { } /** - * + * * @return And endpoint representing a Seq[Pet] */ private def findPetsByStatus(da: DataAccessor): Endpoint[Seq[Pet]] = - get("pet" :: "findByStatus" :: params("status")) { (status: Seq[String]) => + get("pet" :: "findByStatus" :: params("status")) { (status: Seq[String]) => Ok(da.Pet_findPetsByStatus(status)) } handle { case e: Exception => BadRequest(e) } /** - * + * * @return And endpoint representing a Seq[Pet] */ private def findPetsByTags(da: DataAccessor): Endpoint[Seq[Pet]] = - get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => + get("pet" :: "findByTags" :: params("tags")) { (tags: Seq[String]) => Ok(da.Pet_findPetsByTags(tags)) } handle { case e: Exception => BadRequest(e) } /** - * + * * @return And endpoint representing a Pet */ private def getPetById(da: DataAccessor): Endpoint[Pet] = - get("pet" :: long ) { (petId: Long) => + get("pet" :: long ) { (petId: Long) => Ok(da.Pet_getPetById(petId)) } handle { case e: Exception => BadRequest(e) } /** - * + * * @return And endpoint representing a Unit */ private def updatePet(da: DataAccessor): Endpoint[Unit] = - put("pet" :: jsonBody[Pet]) { (body: Pet) => + put("pet" :: jsonBody[Pet]) { (body: Pet) => da.Pet_updatePet(body) NoContent[Unit] } handle { @@ -104,11 +105,11 @@ object PetApi { } /** - * + * * @return And endpoint representing a Unit */ private def updatePetWithForm(da: DataAccessor): Endpoint[Unit] = - post("pet" :: long :: string :: string) { (petId: Long, name: String, status: String) => + post("pet" :: long :: string :: string) { (petId: Long, name: String, status: String) => da.Pet_updatePetWithForm(petId, name, status) NoContent[Unit] } handle { @@ -116,11 +117,11 @@ object PetApi { } /** - * + * * @return And endpoint representing a ApiResponse */ private def uploadFile(da: DataAccessor): Endpoint[ApiResponse] = - post("pet" :: long :: "uploadImage" :: string :: fileUpload("file")) { (petId: Long, additionalMetadata: String, file: FileUpload) => + post("pet" :: long :: "uploadImage" :: string :: fileUpload("file")) { (petId: Long, additionalMetadata: String, file: FileUpload) => Ok(da.Pet_uploadFile(petId, additionalMetadata, file)) } handle { case e: Exception => BadRequest(e) @@ -138,7 +139,7 @@ object PetApi { } private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpPetApi", null) + val file = Files.createTempFile("tmpPetApi", null).toFile() val output = new FileOutputStream(file) output.write(input) file diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala index d61b88b32a4..09dd2e9fc42 100644 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/StoreApi.scala @@ -16,6 +16,7 @@ import com.twitter.util.Future import com.twitter.io.Buf import io.finch._, items._ import java.io.File +import java.nio.file.Files object StoreApi { /** @@ -29,11 +30,11 @@ object StoreApi { placeOrder(da) /** - * + * * @return And endpoint representing a Unit */ private def deleteOrder(da: DataAccessor): Endpoint[Unit] = - delete("store" :: "order" :: string ) { (orderId: String) => + delete("store" :: "order" :: string ) { (orderId: String) => da.Store_deleteOrder(orderId) NoContent[Unit] } handle { @@ -41,33 +42,33 @@ object StoreApi { } /** - * + * * @return And endpoint representing a Map[String, Int] */ private def getInventory(da: DataAccessor): Endpoint[Map[String, Int]] = - get("store" :: "inventory" ) { + get("store" :: "inventory" ) { Ok(da.Store_getInventory()) } handle { case e: Exception => BadRequest(e) } /** - * + * * @return And endpoint representing a Order */ private def getOrderById(da: DataAccessor): Endpoint[Order] = - get("store" :: "order" :: long ) { (orderId: Long) => + get("store" :: "order" :: long ) { (orderId: Long) => Ok(da.Store_getOrderById(orderId)) } handle { case e: Exception => BadRequest(e) } /** - * + * * @return And endpoint representing a Order */ private def placeOrder(da: DataAccessor): Endpoint[Order] = - post("store" :: "order" :: jsonBody[Order]) { (body: Order) => + post("store" :: "order" :: jsonBody[Order]) { (body: Order) => Ok(da.Store_placeOrder(body)) } handle { case e: Exception => BadRequest(e) @@ -85,7 +86,7 @@ object StoreApi { } private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpStoreApi", null) + val file = Files.createTempFile("tmpStoreApi", null).toFile() val output = new FileOutputStream(file) output.write(input) file diff --git a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala index a052a679a67..1127db6857a 100644 --- a/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala +++ b/samples/server/petstore/finch/src/main/scala/io/swagger/petstore/apis/UserApi.scala @@ -17,6 +17,7 @@ import com.twitter.util.Future import com.twitter.io.Buf import io.finch._, items._ import java.io.File +import java.nio.file.Files object UserApi { /** @@ -34,11 +35,11 @@ object UserApi { updateUser(da) /** - * + * * @return And endpoint representing a Unit */ private def createUser(da: DataAccessor): Endpoint[Unit] = - post("user" :: jsonBody[User]) { (body: User) => + post("user" :: jsonBody[User]) { (body: User) => da.User_createUser(body) NoContent[Unit] } handle { @@ -46,11 +47,11 @@ object UserApi { } /** - * + * * @return And endpoint representing a Unit */ private def createUsersWithArrayInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + post("user" :: "createWithArray" :: jsonBody[Seq[User]]) { (body: Seq[User]) => da.User_createUsersWithArrayInput(body) NoContent[Unit] } handle { @@ -58,11 +59,11 @@ object UserApi { } /** - * + * * @return And endpoint representing a Unit */ private def createUsersWithListInput(da: DataAccessor): Endpoint[Unit] = - post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => + post("user" :: "createWithList" :: jsonBody[Seq[User]]) { (body: Seq[User]) => da.User_createUsersWithListInput(body) NoContent[Unit] } handle { @@ -70,11 +71,11 @@ object UserApi { } /** - * + * * @return And endpoint representing a Unit */ private def deleteUser(da: DataAccessor): Endpoint[Unit] = - delete("user" :: string ) { (username: String) => + delete("user" :: string ) { (username: String) => da.User_deleteUser(username) NoContent[Unit] } handle { @@ -82,33 +83,33 @@ object UserApi { } /** - * + * * @return And endpoint representing a User */ private def getUserByName(da: DataAccessor): Endpoint[User] = - get("user" :: string ) { (username: String) => + get("user" :: string ) { (username: String) => Ok(da.User_getUserByName(username)) } handle { case e: Exception => BadRequest(e) } /** - * + * * @return And endpoint representing a String */ private def loginUser(da: DataAccessor): Endpoint[String] = - get("user" :: "login" :: string :: string) { (username: String, password: String) => + get("user" :: "login" :: string :: string) { (username: String, password: String) => Ok(da.User_loginUser(username, password)) } handle { case e: Exception => BadRequest(e) } /** - * + * * @return And endpoint representing a Unit */ private def logoutUser(da: DataAccessor): Endpoint[Unit] = - get("user" :: "logout" ) { + get("user" :: "logout" ) { da.User_logoutUser() NoContent[Unit] } handle { @@ -116,11 +117,11 @@ object UserApi { } /** - * + * * @return And endpoint representing a Unit */ private def updateUser(da: DataAccessor): Endpoint[Unit] = - put("user" :: string :: jsonBody[User]) { (username: String, body: User) => + put("user" :: string :: jsonBody[User]) { (username: String, body: User) => da.User_updateUser(username, body) NoContent[Unit] } handle { @@ -139,7 +140,7 @@ object UserApi { } private def bytesToFile(input: Array[Byte]): java.io.File = { - val file = File.createTempFile("tmpUserApi", null) + val file = Files.createTempFile("tmpUserApi", null).toFile() val output = new FileOutputStream(file) output.write(input) file diff --git a/samples/server/petstore/go-api-server/.swagger-codegen/VERSION b/samples/server/petstore/go-api-server/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/server/petstore/go-api-server/.swagger-codegen/VERSION +++ b/samples/server/petstore/go-api-server/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/go-api-server/Dockerfile b/samples/server/petstore/go-api-server/Dockerfile new file mode 100644 index 00000000000..36e3f7ce2aa --- /dev/null +++ b/samples/server/petstore/go-api-server/Dockerfile @@ -0,0 +1,14 @@ +FROM golang:1.10 AS build +WORKDIR /go/src +COPY go ./go +COPY main.go . + +ENV CGO_ENABLED=0 +RUN go get -d -v ./... + +RUN go build -a -installsuffix cgo -o swagger . + +FROM scratch AS runtime +COPY --from=build /go/src/swagger ./ +EXPOSE 8080/tcp +ENTRYPOINT ["./swagger"] diff --git a/samples/server/petstore/go-api-server/api/swagger.yaml b/samples/server/petstore/go-api-server/api/swagger.yaml index 14dce0c4d35..16209c7522b 100644 --- a/samples/server/petstore/go-api-server/api/swagger.yaml +++ b/samples/server/petstore/go-api-server/api/swagger.yaml @@ -53,7 +53,7 @@ paths: $ref: "#/definitions/Pet" x-exportParamName: "Body" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: @@ -80,11 +80,11 @@ paths: $ref: "#/definitions/Pet" x-exportParamName: "Body" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" - 405: + "405": description: "Validation exception" security: - petstore_auth: @@ -116,13 +116,13 @@ paths: collectionFormat: "csv" x-exportParamName: "Status" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid status value" security: - petstore_auth: @@ -150,13 +150,13 @@ paths: collectionFormat: "csv" x-exportParamName: "Tags" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid tag value" security: - petstore_auth: @@ -182,13 +182,13 @@ paths: format: "int64" x-exportParamName: "PetId" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" security: - api_key: [] @@ -226,7 +226,7 @@ paths: x-exportParamName: "Status" x-optionalDataType: "String" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: @@ -256,7 +256,7 @@ paths: format: "int64" x-exportParamName: "PetId" responses: - 400: + "400": description: "Invalid pet value" security: - petstore_auth: @@ -295,7 +295,7 @@ paths: type: "file" x-exportParamName: "File" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/ApiResponse" @@ -314,7 +314,7 @@ paths: - "application/json" parameters: [] responses: - 200: + "200": description: "successful operation" schema: type: "object" @@ -342,11 +342,11 @@ paths: $ref: "#/definitions/Order" x-exportParamName: "Body" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid Order" /store/order/{orderId}: get: @@ -370,13 +370,13 @@ paths: format: "int64" x-exportParamName: "OrderId" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" delete: tags: @@ -396,9 +396,9 @@ paths: type: "string" x-exportParamName: "OrderId" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" /user: post: @@ -491,7 +491,7 @@ paths: type: "string" x-exportParamName: "Password" responses: - 200: + "200": description: "successful operation" headers: X-Rate-Limit: @@ -504,7 +504,7 @@ paths: description: "date in UTC when toekn expires" schema: type: "string" - 400: + "400": description: "Invalid username/password supplied" /user/logout: get: @@ -538,13 +538,13 @@ paths: type: "string" x-exportParamName: "Username" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/User" - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" put: tags: @@ -570,9 +570,9 @@ paths: $ref: "#/definitions/User" x-exportParamName: "Body" responses: - 400: + "400": description: "Invalid user supplied" - 404: + "404": description: "User not found" delete: tags: @@ -591,9 +591,9 @@ paths: type: "string" x-exportParamName: "Username" responses: - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" securityDefinitions: petstore_auth: diff --git a/samples/server/petstore/go-api-server/go-api-server b/samples/server/petstore/go-api-server/go-api-server new file mode 100755 index 00000000000..f7a3da59626 Binary files /dev/null and b/samples/server/petstore/go-api-server/go-api-server differ diff --git a/samples/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index 0631dc5494d..b417ca41fd7 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -3,7 +3,7 @@ org.wso2.msf4j msf4j-service 2.0.0 - + 4.0.0 io.swagger swagger-msf4j-server @@ -59,8 +59,8 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.10.1 - + 2.11.4 + @@ -75,10 +75,10 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.2.9.v20150224 2.22.2 - 4.12 + 4.13.1 1.1.7 2.5 2.22.2 diff --git a/samples/server/petstore/java-vertx/async/pom.xml b/samples/server/petstore/java-vertx/async/pom.xml index 35b9f92537a..de0ab55078e 100644 --- a/samples/server/petstore/java-vertx/async/pom.xml +++ b/samples/server/petstore/java-vertx/async/pom.xml @@ -17,7 +17,7 @@ 3.3 1.2.0 2.3 - 2.10.1 + 2.11.4 @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/java-vertx/rx/pom.xml b/samples/server/petstore/java-vertx/rx/pom.xml index 14f9492955b..df9f6783831 100644 --- a/samples/server/petstore/java-vertx/rx/pom.xml +++ b/samples/server/petstore/java-vertx/rx/pom.xml @@ -17,7 +17,7 @@ 3.3 1.2.0 2.3 - 2.10.1 + 2.11.4 @@ -88,4 +88,4 @@ - \ No newline at end of file + diff --git a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file 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 4a823e30d17..dabfd040341 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -1,197 +1,197 @@ - 4.0.0 - io.swagger - swagger-cxf-annotated-basepath - war - swagger-cxf-annotated-basepath - This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - 1.0.0 - - src/main/java - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - + 4.0.0 + io.swagger + swagger-cxf-annotated-basepath + war + swagger-cxf-annotated-basepath + This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + 1.0.0 + + src/main/java + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + - - - maven-war-plugin - 3.1.0 - - false - - - - - - - io.swagger - swagger-jaxrs - compile - ${swagger-core-version} - - - ch.qos.logback - logback-classic - ${logback-version} - compile - - - ch.qos.logback - logback-core - ${logback-version} - compile - - - junit - junit - ${junit-version} - test - - - - javax.validation - validation-api - ${beanvalidation-version} - provided - - - - org.apache.cxf - cxf-rt-rs-client - ${cxf-version} - test - + + + maven-war-plugin + 3.1.0 + + false + + + + + + + io.swagger + swagger-jaxrs + compile + ${swagger-core-version} + + + ch.qos.logback + logback-classic + ${logback-version} + compile + + + ch.qos.logback + logback-core + ${logback-version} + compile + + + junit + junit + ${junit-version} + test + + + + javax.validation + validation-api + ${beanvalidation-version} + provided + + + + org.apache.cxf + cxf-rt-rs-client + ${cxf-version} + test + - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-rs-service-description - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-rs-service-description-swagger - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-ws-policy - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-wsdl - ${cxf-version} - compile - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-jaxrs-version} - compile - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.7 - ${java.version} - ${java.version} - 1.5.18 - 9.2.9.v20150224 - 4.12 - 1.1.7 - 2.5 - 1.1.0.Final - 3.2.1 - 2.10.1 - UTF-8 - + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description-swagger + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-ws-policy + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-wsdl + ${cxf-version} + compile + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.7 + ${java.version} + ${java.version} + 1.5.24 + 9.3.27.v20190418 + 4.13.1 + 1.1.7 + 2.5 + 1.1.0.Final + 3.2.1 + 2.11.4 + UTF-8 + diff --git a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf-cdi/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml index 065f3d9afb6..ab16f6abcc5 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-cdi/pom.xml @@ -57,9 +57,8 @@ org.apache.cxf cxf-rt-frontend-jaxrs - - - 3.0.2 + + 3.3.8 provided @@ -67,7 +66,7 @@ com.fasterxml.jackson.jaxrs jackson-jaxrs-json-provider - 2.10.1 + 2.11.4 diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Amount.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Amount.java index a350be35a56..87e12a5d9a7 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Amount.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Amount.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +import javax.validation.Valid; /** * some description diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java index 92a3fc286e3..ef306d5d51d 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Category.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +import javax.validation.Valid; /** * A category for a pet diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java index becb77ed19e..b47c4152cdd 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Describes the result of uploading an image resource diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java index e5e8aacb1a5..6af83439d3e 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Order.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +import javax.validation.Valid; /** * An order for a pets from the pet store @@ -119,6 +120,7 @@ public Order shipDate(java.util.Date shipDate) { @ApiModelProperty(value = "") @JsonProperty("shipDate") + @Valid public java.util.Date getShipDate() { return shipDate; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java index c8868b563d0..b34ce243271 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Pet.java @@ -8,6 +8,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * A pet for sale in the pet store @@ -89,6 +90,7 @@ public Pet category(Category category) { @ApiModelProperty(value = "") @JsonProperty("category") + @Valid public Category getCategory() { return category; } @@ -142,6 +144,7 @@ public Pet tags(List tags) { @ApiModelProperty(value = "") @JsonProperty("tags") + @Valid public List getTags() { return tags; } diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java index 42f36861a08..82e836b1ea3 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/Tag.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +import javax.validation.Valid; /** * A tag for a pet diff --git a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java index e8cfc7d6b1d..80d71ad319a 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-cxf-cdi/src/gen/java/io/swagger/model/User.java @@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import javax.validation.constraints.*; +import javax.validation.Valid; /** * A User who is purchasing from the pet store diff --git a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json index f82e1977c95..9a8cf61ab7a 100644 --- a/samples/server/petstore/jaxrs-cxf-cdi/swagger.json +++ b/samples/server/petstore/jaxrs-cxf-cdi/swagger.json @@ -33,7 +33,7 @@ "url" : "http://swagger.io" } } ], - "schemes" : [ "http" ], + "schemes" : [ "https" ], "paths" : { "/pet" : { "post" : { diff --git a/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file 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 ac654d8c55f..561698e0fa9 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -1,197 +1,197 @@ - 4.0.0 - io.swagger - swagger-cxf-server-non-spring - war - swagger-cxf-server-non-spring - This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. - 1.0.0 - - src/main/java - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - + 4.0.0 + io.swagger + swagger-cxf-server-non-spring + war + swagger-cxf-server-non-spring + This is a sample server Petstore server. You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). For this sample, you can use the api key `special-key` to test the authorization filters. + 1.0.0 + + src/main/java + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + - - - maven-war-plugin - 3.1.0 - - false - - - - - - - io.swagger - swagger-jaxrs - compile - ${swagger-core-version} - - - ch.qos.logback - logback-classic - ${logback-version} - compile - - - ch.qos.logback - logback-core - ${logback-version} - compile - - - junit - junit - ${junit-version} - test - - - - javax.validation - validation-api - ${beanvalidation-version} - provided - - - - org.apache.cxf - cxf-rt-rs-client - ${cxf-version} - test - + + + maven-war-plugin + 3.1.0 + + false + + + + + + + io.swagger + swagger-jaxrs + compile + ${swagger-core-version} + + + ch.qos.logback + logback-classic + ${logback-version} + compile + + + ch.qos.logback + logback-core + ${logback-version} + compile + + + junit + junit + ${junit-version} + test + + + + javax.validation + validation-api + ${beanvalidation-version} + provided + + + + org.apache.cxf + cxf-rt-rs-client + ${cxf-version} + test + - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-rs-service-description - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-rs-service-description-swagger - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-ws-policy - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-wsdl - ${cxf-version} - compile - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-jaxrs-version} - compile - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.7 - ${java.version} - ${java.version} - 1.5.18 - 9.2.9.v20150224 - 4.12 - 1.1.7 - 2.5 - 1.1.0.Final - 3.2.1 - 2.10.1 - UTF-8 - + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description-swagger + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-ws-policy + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-wsdl + ${cxf-version} + compile + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.7 + ${java.version} + ${java.version} + 1.5.24 + 9.3.27.v20190418 + 4.13.1 + 1.1.7 + 2.5 + 1.1.0.Final + 3.2.1 + 2.11.4 + UTF-8 + diff --git a/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION index 9bc1c54fc94..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-cxf/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.8-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 133db71f5a5..1d0b87a6a69 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -1,197 +1,199 @@ - 4.0.0 - io.swagger - swagger-cxf-server - war - swagger-cxf-server - This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - 1.0.0 - - src/main/java - - - maven-failsafe-plugin - 2.6 - - - - integration-test - verify - - - - - - - org.codehaus.mojo - build-helper-maven-plugin - 1.9.1 - - - add-source - generate-sources - - add-source - - - - src/gen/java - - - - - + 4.0.0 + io.swagger + swagger-cxf-server + war + swagger-cxf-server + This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + 1.0.0 + + src/main/java + + + maven-failsafe-plugin + 2.6 + + + + integration-test + verify + + + + + + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + - - - maven-war-plugin - 3.1.0 - - false - - - - - - - io.swagger - swagger-jaxrs - compile - ${swagger-core-version} - - - ch.qos.logback - logback-classic - ${logback-version} - compile - - - ch.qos.logback - logback-core - ${logback-version} - compile - - - junit - junit - ${junit-version} - test - - - - javax.validation - validation-api - ${beanvalidation-version} - provided - - - - org.apache.cxf - cxf-rt-rs-client - ${cxf-version} - test - + + + maven-war-plugin + 3.1.0 + + false + + + + + + + io.swagger + swagger-jaxrs + compile + ${swagger-core-version} + + + ch.qos.logback + logback-classic + ${logback-version} + compile + + + ch.qos.logback + logback-core + ${logback-version} + compile + + + junit + junit + ${junit-version} + test + + + + javax.validation + validation-api + ${beanvalidation-version} + provided + + + + org.apache.cxf + cxf-rt-rs-client + ${cxf-version} + test + - - - org.apache.cxf - cxf-rt-frontend-jaxrs - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-rs-service-description - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-rs-service-description-swagger - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-ws-policy - ${cxf-version} - compile - - - org.apache.cxf - cxf-rt-wsdl - ${cxf-version} - compile - - - com.fasterxml.jackson.jaxrs - jackson-jaxrs-json-provider - ${jackson-jaxrs-version} - compile - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - ${jackson-jaxrs-version} - - - - - sonatype-snapshots - https://oss.sonatype.org/content/repositories/snapshots - - true - - - - - 1.7 - ${java.version} - ${java.version} - 1.5.18 - 9.2.9.v20150224 - 4.12 - 1.1.7 - 2.5 - 1.1.0.Final - 3.2.1 - 2.10.1 - UTF-8 - + + + org.apache.cxf + cxf-rt-frontend-jaxrs + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-rs-service-description-swagger + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-ws-policy + ${cxf-version} + compile + + + org.apache.cxf + cxf-rt-wsdl + ${cxf-version} + compile + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-jaxrs-version} + compile + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-jaxrs-version} + + + + + sonatype-snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + + + 1.7 + ${java.version} + ${java.version} + 1.5.24 + 9.3.27.v20190418 + 4.13.1 + 1.1.7 + 2.5 + 1.1.0.Final + 3.2.1 + 2.11.4 + UTF-8 + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Ints.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..4ce4c6d8ec1 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Ints.java @@ -0,0 +1,52 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + +} + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..5f6b5ea9355 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,42 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + +} + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..fc85c249413 --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,60 @@ +package io.swagger.model; + +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.ApiModelProperty; +import javax.xml.bind.annotation.XmlElement; +import javax.xml.bind.annotation.XmlRootElement; +import javax.xml.bind.annotation.XmlAccessType; +import javax.xml.bind.annotation.XmlAccessorType; +import javax.xml.bind.annotation.XmlType; +import javax.xml.bind.annotation.XmlEnum; +import javax.xml.bind.annotation.XmlEnumValue; +import com.fasterxml.jackson.annotation.JsonProperty; + +public class ModelList { + + @ApiModelProperty(value = "") + private String _123List = null; + /** + * Get _123List + * @return _123List + **/ + @JsonProperty("123-list") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private static String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Numbers.java b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..56de7b1e8ed --- /dev/null +++ b/samples/server/petstore/jaxrs-cxf/src/gen/java/io/swagger/model/Numbers.java @@ -0,0 +1,47 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } + +} + diff --git a/samples/server/petstore/jaxrs-datelib-j8/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-datelib-j8/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-datelib-j8/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index 0deb558f4df..866410b5463 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/pom.xml +++ b/samples/server/petstore/jaxrs-datelib-j8/pom.xml @@ -173,11 +173,11 @@ 1.8 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.2.9.v20150224 2.22.2 2.8.9 - 4.12 + 4.13.1 1.1.7 2.5 UTF-8 diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index 93259ae1d60..88ac80bceed 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -23,6 +23,7 @@ import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AdditionalPropertiesClass @@ -81,6 +82,7 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Animal.java index ec137e0355a..e56545cee72 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Animal.java @@ -22,6 +22,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Animal diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AnimalFarm.java index 4d4ae7caffa..4a42c9665e5 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/AnimalFarm.java @@ -19,6 +19,7 @@ import java.util.List; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AnimalFarm diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index c53469c1325..ee60e09646b 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -23,6 +23,7 @@ import java.util.List; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly @@ -51,6 +52,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @JsonProperty("ArrayArrayNumber") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index c58c941a471..c97a5267dbd 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -23,6 +23,7 @@ import java.util.List; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfNumberOnly @@ -51,6 +52,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @JsonProperty("ArrayNumber") @ApiModelProperty(value = "") + @Valid public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayTest.java index 4b315c69ed3..44a2824a0ef 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ArrayTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayTest @@ -84,6 +85,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @JsonProperty("array_array_of_integer") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -111,6 +113,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @JsonProperty("array_array_of_model") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Capitalization.java index 75776a65ec4..fe804f15bcb 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Capitalization.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Capitalization diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Cat.java index cadd5c93256..d78d1f5c4be 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Cat.java @@ -21,6 +21,7 @@ import io.swagger.model.Animal; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Cat diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Category.java index 4acf22b5f67..1db6c9897bf 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Category.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Category diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ClassModel.java index 3c3c17b7681..f2aba1dd463 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ClassModel.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model with \"_class\" property diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Client.java index b456e0f00ab..94e8ad425ed 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Client.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Client diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Dog.java index 95bce035306..3efe163e88e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Dog.java @@ -21,6 +21,7 @@ import io.swagger.model.Animal; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Dog diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumArrays.java index 92504ca022a..a67870ee0e4 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumArrays.java @@ -23,6 +23,7 @@ import java.util.List; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumArrays diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumClass.java index 37886ca42f6..56db3d31c92 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumClass.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumTest.java index 13c6b9d1ca6..02914c9a575 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/EnumTest.java @@ -22,6 +22,7 @@ import io.swagger.model.OuterEnum; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumTest @@ -259,6 +260,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @JsonProperty("outerEnum") @ApiModelProperty(value = "") + @Valid public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/FormatTest.java index a5ae77a9346..1511cceada2 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/FormatTest.java @@ -24,6 +24,7 @@ import java.util.UUID; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * FormatTest @@ -144,6 +145,7 @@ public FormatTest number(BigDecimal number) { @JsonProperty("number") @ApiModelProperty(required = true, value = "") @NotNull + @Valid @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -264,6 +266,7 @@ public FormatTest date(LocalDate date) { @JsonProperty("date") @ApiModelProperty(required = true, value = "") @NotNull + @Valid public LocalDate getDate() { return date; } @@ -283,6 +286,7 @@ public FormatTest dateTime(OffsetDateTime dateTime) { **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public OffsetDateTime getDateTime() { return dateTime; } @@ -302,6 +306,7 @@ public FormatTest uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 7e231212b5d..4a13b09f01d 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * HasOnlyReadOnly diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MapTest.java index 4849186df59..c3e1bb2d50f 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MapTest.java @@ -24,6 +24,7 @@ import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MapTest @@ -86,6 +87,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @JsonProperty("map_map_of_string") @ApiModelProperty(value = "") + @Valid public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 07b1c936250..247ca108e88 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -26,6 +26,7 @@ import java.util.UUID; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -52,6 +53,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } @@ -71,6 +73,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateT **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public OffsetDateTime getDateTime() { return dateTime; } @@ -98,6 +101,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @JsonProperty("map") @ApiModelProperty(value = "") + @Valid public Map getMap() { return map; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Model200Response.java index a3a8fb6ddb7..63269d11294 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Model200Response.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name starting with number diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelApiResponse.java index 496cf844a51..00a00e54f38 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ModelApiResponse diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..7d2dc9188b7 --- /dev/null +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,92 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ + +public class ModelList implements Serializable { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @JsonProperty("123-list") + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelReturn.java index c3ef933035a..53870a1bce8 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ModelReturn.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing reserved words diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Name.java index 6fc1efd2619..cd6fa381e46 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Name.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name same as property name diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/NumberOnly.java index b8768adacd1..20ec51b3f82 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/NumberOnly.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * NumberOnly @@ -41,6 +42,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @JsonProperty("JustNumber") @ApiModelProperty(value = "") + @Valid public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Order.java index 5bde8e492cf..97d4d7ede90 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Order.java @@ -22,6 +22,7 @@ import java.time.OffsetDateTime; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Order @@ -147,6 +148,7 @@ public Order shipDate(OffsetDateTime shipDate) { **/ @JsonProperty("shipDate") @ApiModelProperty(value = "") + @Valid public OffsetDateTime getShipDate() { return shipDate; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterComposite.java index aa7033f9344..ab71cee88df 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterComposite.java @@ -21,6 +21,7 @@ import java.math.BigDecimal; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * OuterComposite @@ -47,6 +48,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @JsonProperty("my_number") @ApiModelProperty(value = "") + @Valid public BigDecimal getMyNumber() { return myNumber; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterEnum.java index d2c5526ede0..80876eee78b 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/OuterEnum.java @@ -17,6 +17,7 @@ import com.fasterxml.jackson.annotation.JsonValue; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Pet.java index 4d350eb3f37..e2bcd687f15 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Pet.java @@ -25,6 +25,7 @@ import java.util.List; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Pet @@ -112,6 +113,7 @@ public Pet category(Category category) { **/ @JsonProperty("category") @ApiModelProperty(value = "") + @Valid public Category getCategory() { return category; } @@ -184,6 +186,7 @@ public Pet addTagsItem(Tag tagsItem) { **/ @JsonProperty("tags") @ApiModelProperty(value = "") + @Valid public List getTags() { return tags; } diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ReadOnlyFirst.java index b69a26e8187..90851731a6e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ReadOnlyFirst diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/SpecialModelName.java index e3410cc40ef..d30b13e9d3e 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/SpecialModelName.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * SpecialModelName diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Tag.java index 92e347cd8e6..30ed3872420 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/Tag.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Tag diff --git a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/User.java index 7c9a29680ef..cf5009369c0 100644 --- a/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs-datelib-j8/src/gen/java/io/swagger/model/User.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.io.Serializable; import javax.validation.constraints.*; +import javax.validation.Valid; /** * User diff --git a/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/default/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/default/Dockerfile b/samples/server/petstore/jaxrs-resteasy/default/Dockerfile new file mode 100644 index 00000000000..2298a855dde --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/default/Dockerfile @@ -0,0 +1,7 @@ +FROM jboss/wildfly:21.0.2.Final + +ADD target/swagger-jaxrs-resteasy-server-1.0.0.war /opt/jboss/wildfly/standalone/deployments/ + +EXPOSE 8080 9990 8009 + +CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"] diff --git a/samples/server/petstore/jaxrs-resteasy/default/build.gradle b/samples/server/petstore/jaxrs-resteasy/default/build.gradle index 1c222c6c305..63b1eb9b8c3 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/default/build.gradle @@ -18,7 +18,7 @@ dependencies { compile 'io.swagger:swagger-annotations:1.5.10' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'javax.validation:validation-api:1.1.0.Final' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.11.4' compile 'joda-time:joda-time:2.7' //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiException.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiException.class deleted file mode 100644 index 532edd306d7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiOriginFilter.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiOriginFilter.class deleted file mode 100644 index 491891093f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiOriginFilter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiResponseMessage.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiResponseMessage.class deleted file mode 100644 index 662e2e846f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/ApiResponseMessage.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$1.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$1.class deleted file mode 100644 index 9271b6069d1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$1.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$2.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$2.class deleted file mode 100644 index 2260a4b19b5..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1$2.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1.class deleted file mode 100644 index c757c04724e..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig$1.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig.class deleted file mode 100644 index b4368ff2475..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/JacksonConfig.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/NotFoundException.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/NotFoundException.class deleted file mode 100644 index cb773657253..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/NotFoundException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApi.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApi.class deleted file mode 100644 index 71f34c8625b..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApiService.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApiService.class deleted file mode 100644 index 92283312be5..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/PetApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RFC3339DateFormat.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RFC3339DateFormat.class deleted file mode 100644 index 0f5053f2a06..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RFC3339DateFormat.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RestApplication.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RestApplication.class deleted file mode 100644 index 1bd466b82da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/RestApplication.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApi.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApi.class deleted file mode 100644 index b132fb09089..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApiService.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApiService.class deleted file mode 100644 index da4fd7608fd..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StoreApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StringUtil.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StringUtil.class deleted file mode 100644 index 72824471def..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/StringUtil.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApi.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApi.class deleted file mode 100644 index df0b5b337fb..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApiService.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApiService.class deleted file mode 100644 index d12b14b2337..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/UserApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class deleted file mode 100644 index e36041a5f07..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class deleted file mode 100644 index 60fc71759c2..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class deleted file mode 100644 index 86d82b1e0da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Category.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Category.class deleted file mode 100644 index e0d0faed108..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Category.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/ModelApiResponse.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/ModelApiResponse.class deleted file mode 100644 index df7bdc5bbe7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/ModelApiResponse.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order$StatusEnum.class deleted file mode 100644 index 8f111540b87..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order.class deleted file mode 100644 index 5aed19284b4..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Order.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet$StatusEnum.class deleted file mode 100644 index 514e6558ae8..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet.class deleted file mode 100644 index 88f65946361..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Pet.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Tag.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Tag.class deleted file mode 100644 index 40027f0aeb7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/Tag.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/User.class b/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/User.class deleted file mode 100644 index 253481fbd91..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/classes/main/io/swagger/model/User.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/libs/swagger-jaxrs-resteasy-server-1.0.0.war b/samples/server/petstore/jaxrs-resteasy/default/build/libs/swagger-jaxrs-resteasy-server-1.0.0.war deleted file mode 100644 index 4d6cba4823b..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/default/build/libs/swagger-jaxrs-resteasy-server-1.0.0.war and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/default/build/tmp/war/MANIFEST.MF b/samples/server/petstore/jaxrs-resteasy/default/build/tmp/war/MANIFEST.MF deleted file mode 100644 index 59499bce4a2..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/default/build/tmp/war/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/samples/server/petstore/jaxrs-resteasy/default/pom.xml b/samples/server/petstore/jaxrs-resteasy/default/pom.xml index a7dd5353ad6..60bcb289f2e 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default/pom.xml @@ -89,18 +89,6 @@ ${resteasy-version} provided - - org.jboss.resteasy - jaxrs-api - ${resteasy-version} - provided - - - org.jboss.resteasy - resteasy-validator-provider-11 - ${resteasy-version} - provided - org.jboss.resteasy resteasy-multipart-provider @@ -167,7 +155,7 @@ 1.1.0.Final provided - + @@ -179,12 +167,12 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 - 3.0.11.Final + 3.13.2.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 - 2.10.1 + 2.11.4 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-java8/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle index 705542eb22f..899d68440d9 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/build.gradle @@ -16,7 +16,7 @@ dependencies { providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'javax.validation:validation-api:1.1.0.Final' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4' testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' } diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml index 72c0ec555eb..4decbb4b85a 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml @@ -179,22 +179,22 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-databind - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-core - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-annotations - 2.10.1 + 2.11.4 org.apache.httpcomponents @@ -213,11 +213,11 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 3.0.11.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle index 4b3b0cd3a12..93b74ad2d20 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/build.gradle @@ -16,7 +16,7 @@ dependencies { providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'javax.validation:validation-api:1.1.0.Final' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.11.4' compile 'joda-time:joda-time:2.7' testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' diff --git a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml index ec08d83ef8b..8ab7be0413b 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -184,22 +184,22 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-databind - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-core - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-annotations - 2.10.1 + 2.11.4 org.apache.httpcomponents @@ -218,11 +218,11 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 3.0.11.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 diff --git a/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/eap/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle index 4b3b0cd3a12..93b74ad2d20 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/eap/build.gradle @@ -16,7 +16,7 @@ dependencies { providedCompile 'org.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec:1.0.0.Final' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'javax.validation:validation-api:1.1.0.Final' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.11.4' compile 'joda-time:joda-time:2.7' testCompile 'junit:junit:4.12', 'org.hamcrest:hamcrest-core:1.3' diff --git a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml index a868789c8b6..a2a3e4c85d3 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -184,22 +184,22 @@ com.fasterxml.jackson.datatype jackson-datatype-joda - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-databind - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-core - 2.10.1 + 2.11.4 com.fasterxml.jackson.core jackson-annotations - 2.10.1 + 2.11.4 org.apache.httpcomponents @@ -218,11 +218,11 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 3.0.11.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 diff --git a/samples/server/petstore/jaxrs-resteasy/java8/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/java8/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/java8/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/java8/Dockerfile b/samples/server/petstore/jaxrs-resteasy/java8/Dockerfile new file mode 100644 index 00000000000..4e0e09b29ab --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/java8/Dockerfile @@ -0,0 +1,7 @@ +FROM jboss/wildfly:21.0.2.Final + +ADD target/swagger-jaxrs-resteasy-java8-server-1.0.0.war /opt/jboss/wildfly/standalone/deployments/ + +EXPOSE 8080 9990 8009 + +CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"] diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build.gradle b/samples/server/petstore/jaxrs-resteasy/java8/build.gradle index 13f56e928fa..7e258ae575e 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/java8/build.gradle @@ -18,7 +18,7 @@ dependencies { compile 'io.swagger:swagger-annotations:1.5.10' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'javax.validation:validation-api:1.1.0.Final' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.11.4' //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiException.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiException.class deleted file mode 100644 index 532edd306d7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiOriginFilter.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiOriginFilter.class deleted file mode 100644 index 491891093f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiOriginFilter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiResponseMessage.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiResponseMessage.class deleted file mode 100644 index 662e2e846f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/ApiResponseMessage.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/JacksonConfig.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/JacksonConfig.class deleted file mode 100644 index 883c2d0e91f..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/JacksonConfig.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/LocalDateProvider$LocalDateConverter.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/LocalDateProvider$LocalDateConverter.class deleted file mode 100644 index 89c440817d2..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/LocalDateProvider$LocalDateConverter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/LocalDateProvider.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/LocalDateProvider.class deleted file mode 100644 index d131a0de47b..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/LocalDateProvider.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/NotFoundException.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/NotFoundException.class deleted file mode 100644 index cb773657253..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/NotFoundException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/OffsetDateTimeProvider$OffsetDateTimeConverter.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/OffsetDateTimeProvider$OffsetDateTimeConverter.class deleted file mode 100644 index ebdbd90a1cd..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/OffsetDateTimeProvider$OffsetDateTimeConverter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/OffsetDateTimeProvider.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/OffsetDateTimeProvider.class deleted file mode 100644 index 9f0102acf1c..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/OffsetDateTimeProvider.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/PetApi.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/PetApi.class deleted file mode 100644 index 0076702a754..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/PetApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/PetApiService.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/PetApiService.class deleted file mode 100644 index 92283312be5..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/PetApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/RFC3339DateFormat.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/RFC3339DateFormat.class deleted file mode 100644 index 0f5053f2a06..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/RFC3339DateFormat.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/RestApplication.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/RestApplication.class deleted file mode 100644 index 1bd466b82da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/RestApplication.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StoreApi.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StoreApi.class deleted file mode 100644 index c8bfa86340a..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StoreApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StoreApiService.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StoreApiService.class deleted file mode 100644 index da4fd7608fd..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StoreApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StringUtil.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StringUtil.class deleted file mode 100644 index 72824471def..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/StringUtil.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/UserApi.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/UserApi.class deleted file mode 100644 index d07211ae915..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/UserApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/UserApiService.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/UserApiService.class deleted file mode 100644 index d12b14b2337..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/UserApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class deleted file mode 100644 index e36041a5f07..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class deleted file mode 100644 index 60fc71759c2..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class deleted file mode 100644 index 86d82b1e0da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Amount.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Amount.class deleted file mode 100644 index 2d8c3bb4d30..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Amount.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Category.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Category.class deleted file mode 100644 index e0d0faed108..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Category.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/ModelApiResponse.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/ModelApiResponse.class deleted file mode 100644 index df7bdc5bbe7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/ModelApiResponse.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Order$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Order$StatusEnum.class deleted file mode 100644 index 8f111540b87..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Order$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Order.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Order.class deleted file mode 100644 index 5caa4f8a586..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Order.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Pet$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Pet$StatusEnum.class deleted file mode 100644 index 514e6558ae8..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Pet$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Pet.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Pet.class deleted file mode 100644 index 88f65946361..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Pet.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Tag.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Tag.class deleted file mode 100644 index 40027f0aeb7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/Tag.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/User.class b/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/User.class deleted file mode 100644 index 253481fbd91..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/classes/main/io/swagger/model/User.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/libs/swagger-jaxrs-resteasy-java8-server-1.0.0.war b/samples/server/petstore/jaxrs-resteasy/java8/build/libs/swagger-jaxrs-resteasy-java8-server-1.0.0.war deleted file mode 100644 index 51dc992fc9d..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/java8/build/libs/swagger-jaxrs-resteasy-java8-server-1.0.0.war and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/java8/build/tmp/war/MANIFEST.MF b/samples/server/petstore/jaxrs-resteasy/java8/build/tmp/war/MANIFEST.MF deleted file mode 100644 index 58630c02ef4..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/java8/build/tmp/war/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml index 2111ac94ce1..77abc65d8bf 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml @@ -89,18 +89,6 @@ ${resteasy-version} provided - - org.jboss.resteasy - jaxrs-api - ${resteasy-version} - provided - - - org.jboss.resteasy - resteasy-validator-provider-11 - ${resteasy-version} - provided - org.jboss.resteasy resteasy-multipart-provider @@ -162,7 +150,7 @@ 1.1.0.Final provided - + @@ -174,12 +162,12 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 - 3.0.11.Final + 3.13.2.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 - 2.10.1 + 2.11.4 diff --git a/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-resteasy/joda/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-resteasy/joda/Dockerfile b/samples/server/petstore/jaxrs-resteasy/joda/Dockerfile new file mode 100644 index 00000000000..e0c5a0773e9 --- /dev/null +++ b/samples/server/petstore/jaxrs-resteasy/joda/Dockerfile @@ -0,0 +1,7 @@ +FROM jboss/wildfly:21.0.2.Final + +ADD target/swagger-jaxrs-resteasy-joda-server-1.0.0.war /opt/jboss/wildfly/standalone/deployments/ + +EXPOSE 8080 9990 8009 + +CMD ["/opt/jboss/wildfly/bin/standalone.sh", "-b", "0.0.0.0", "-bmanagement", "0.0.0.0", "-c", "standalone.xml"] diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build.gradle b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle index 1c222c6c305..63b1eb9b8c3 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/build.gradle +++ b/samples/server/petstore/jaxrs-resteasy/joda/build.gradle @@ -18,7 +18,7 @@ dependencies { compile 'io.swagger:swagger-annotations:1.5.10' compile 'org.jboss.resteasy:resteasy-jackson2-provider:3.0.11.Final' providedCompile 'javax.validation:validation-api:1.1.0.Final' - compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.10.1' + compile 'com.fasterxml.jackson.datatype:jackson-datatype-joda:2.11.4' compile 'joda-time:joda-time:2.7' //TODO: swaggerFeature compile 'io.swagger:swagger-jaxrs:1.5.12' diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiException.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiException.class deleted file mode 100644 index 532edd306d7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiOriginFilter.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiOriginFilter.class deleted file mode 100644 index 491891093f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiOriginFilter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiResponseMessage.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiResponseMessage.class deleted file mode 100644 index 662e2e846f1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/ApiResponseMessage.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$1.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$1.class deleted file mode 100644 index 9271b6069d1..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$1.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$2.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$2.class deleted file mode 100644 index 2260a4b19b5..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1$2.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1.class deleted file mode 100644 index c757c04724e..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig$1.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig.class deleted file mode 100644 index b4368ff2475..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JacksonConfig.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider$JodaDateTimeConverter.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider$JodaDateTimeConverter.class deleted file mode 100644 index e3e3c19c289..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider$JodaDateTimeConverter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider.class deleted file mode 100644 index 35b513c60ba..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaDateTimeProvider.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider$JodaLocalDateConverter.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider$JodaLocalDateConverter.class deleted file mode 100644 index 4c2b68d9204..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider$JodaLocalDateConverter.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider.class deleted file mode 100644 index d0d246dcc79..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/JodaLocalDateProvider.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/NotFoundException.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/NotFoundException.class deleted file mode 100644 index cb773657253..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/NotFoundException.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApi.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApi.class deleted file mode 100644 index 0076702a754..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApiService.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApiService.class deleted file mode 100644 index 92283312be5..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/PetApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RFC3339DateFormat.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RFC3339DateFormat.class deleted file mode 100644 index 0f5053f2a06..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RFC3339DateFormat.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RestApplication.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RestApplication.class deleted file mode 100644 index 1bd466b82da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/RestApplication.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApi.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApi.class deleted file mode 100644 index c8bfa86340a..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApiService.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApiService.class deleted file mode 100644 index da4fd7608fd..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StoreApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StringUtil.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StringUtil.class deleted file mode 100644 index 72824471def..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/StringUtil.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApi.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApi.class deleted file mode 100644 index d07211ae915..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApi.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApiService.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApiService.class deleted file mode 100644 index d12b14b2337..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/UserApiService.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class deleted file mode 100644 index e36041a5f07..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/PetApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class deleted file mode 100644 index 60fc71759c2..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/StoreApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class deleted file mode 100644 index 86d82b1e0da..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/api/impl/UserApiServiceImpl.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Amount.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Amount.class deleted file mode 100644 index 2d8c3bb4d30..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Amount.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Category.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Category.class deleted file mode 100644 index e0d0faed108..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Category.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/ModelApiResponse.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/ModelApiResponse.class deleted file mode 100644 index df7bdc5bbe7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/ModelApiResponse.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order$StatusEnum.class deleted file mode 100644 index 8f111540b87..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order.class deleted file mode 100644 index bb45a3e7e60..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Order.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet$StatusEnum.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet$StatusEnum.class deleted file mode 100644 index 514e6558ae8..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet$StatusEnum.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet.class deleted file mode 100644 index 88f65946361..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Pet.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Tag.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Tag.class deleted file mode 100644 index 40027f0aeb7..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/Tag.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/User.class b/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/User.class deleted file mode 100644 index 253481fbd91..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/classes/main/io/swagger/model/User.class and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/libs/swagger-jaxrs-resteasy-joda-server-1.0.0.war b/samples/server/petstore/jaxrs-resteasy/joda/build/libs/swagger-jaxrs-resteasy-joda-server-1.0.0.war deleted file mode 100644 index ad2e7541ee3..00000000000 Binary files a/samples/server/petstore/jaxrs-resteasy/joda/build/libs/swagger-jaxrs-resteasy-joda-server-1.0.0.war and /dev/null differ diff --git a/samples/server/petstore/jaxrs-resteasy/joda/build/tmp/war/MANIFEST.MF b/samples/server/petstore/jaxrs-resteasy/joda/build/tmp/war/MANIFEST.MF deleted file mode 100644 index 58630c02ef4..00000000000 --- a/samples/server/petstore/jaxrs-resteasy/joda/build/tmp/war/MANIFEST.MF +++ /dev/null @@ -1,2 +0,0 @@ -Manifest-Version: 1.0 - diff --git a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml index d0d1ff9d6ce..e96a8a8c9fe 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml @@ -89,18 +89,6 @@ ${resteasy-version} provided - - org.jboss.resteasy - jaxrs-api - ${resteasy-version} - provided - - - org.jboss.resteasy - resteasy-validator-provider-11 - ${resteasy-version} - provided - org.jboss.resteasy resteasy-multipart-provider @@ -167,7 +155,7 @@ 1.1.0.Final provided - + @@ -179,12 +167,12 @@ - 1.5.18 + 1.5.24 9.3.27.v20190418 - 3.0.11.Final + 3.13.2.Final 1.6.3 - 4.8.1 + 4.13.1 2.5 - 2.10.1 + 2.11.4 diff --git a/samples/server/petstore/jaxrs-spec-interface-response/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-spec-interface-response/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface-response/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml index a32dafce9ee..2d909d2c16c 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml @@ -13,15 +13,44 @@ maven-jar-plugin 2.2 + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + javax.ws.rs javax.ws.rs-api - 2.0 + 2.1.1 provided + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + io.swagger swagger-annotations @@ -43,6 +72,7 @@ - 4.8.1 + 2.9.9 + 4.13.1 diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/api/PetApi.java index 5fed5aea67d..1992d291311 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/api/PetApi.java @@ -1,6 +1,7 @@ package io.swagger.api; import java.io.File; +import java.io.InputStream; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; @@ -125,6 +126,5 @@ public interface PetApi { }, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail); + Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream); } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumArrays.java index 0ed8a2bf521..7f7fbe5ae25 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumArrays.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumTest.java index 09c6e8d7669..51cc83820f6 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/EnumTest.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.model.OuterEnum; import java.io.Serializable; import javax.validation.constraints.*; @@ -93,7 +95,7 @@ public enum EnumIntegerEnum { value = v; } - public String value() { + public Integer value() { return value; } @@ -127,7 +129,7 @@ public enum EnumNumberEnum { value = v; } - public String value() { + public Double value() { return value; } diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Ints.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..3e5e76cfe55 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Ints.java @@ -0,0 +1,57 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * True or False indicator + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/MapTest.java index 6a11ab8cbf6..9f3364faa35 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/MapTest.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..b3c8d8df7f5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,47 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * True or False indicator + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..b553d06fd45 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,73 @@ +package io.swagger.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ModelList implements Serializable { + + private @Valid String _123List = null; + + /** + **/ + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("123-list") + public String get123List() { + return _123List; + } + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(_123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Numbers.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..fcc9dbc954b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Numbers.java @@ -0,0 +1,52 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * some number + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Order.java index 393f06ff039..7652fda5287 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Order.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.Date; import java.io.Serializable; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Pet.java index 1c9f88d1401..91893933a3d 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface-response/src/gen/java/io/swagger/model/Pet.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; diff --git a/samples/server/petstore/jaxrs-spec-interface-response/swagger.json b/samples/server/petstore/jaxrs-spec-interface-response/swagger.json index 4c4ea769313..73925ccfefb 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/swagger.json +++ b/samples/server/petstore/jaxrs-spec-interface-response/swagger.json @@ -1741,6 +1741,22 @@ }, "OuterBoolean" : { "type" : "boolean" + }, + "Boolean" : { + "type" : "boolean", + "description" : "True or False indicator", + "enum" : [ "true", "false" ] + }, + "Ints" : { + "type" : "integer", + "format" : "int32", + "description" : "True or False indicator", + "enum" : [ "0", "1", "2", "3", "4", "5", "6" ] + }, + "Numbers" : { + "type" : "number", + "description" : "some number", + "enum" : [ "7", "8", "9", "10" ] } }, "externalDocs" : { diff --git a/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-spec-interface/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml index a32dafce9ee..2d909d2c16c 100644 --- a/samples/server/petstore/jaxrs-spec-interface/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -13,15 +13,44 @@ maven-jar-plugin 2.2 + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + javax.ws.rs javax.ws.rs-api - 2.0 + 2.1.1 provided + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + io.swagger swagger-annotations @@ -43,6 +72,7 @@ - 4.8.1 + 2.9.9 + 4.13.1 diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java index d2192d7162a..1441ea9e0a7 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/PetApi.java @@ -1,6 +1,7 @@ package io.swagger.api; import java.io.File; +import java.io.InputStream; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; @@ -125,6 +126,5 @@ public interface PetApi { }, tags={ "pet" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail); + ModelApiResponse uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream); } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java deleted file mode 100644 index 2561172aea9..00000000000 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/api/RestApplication.java +++ /dev/null @@ -1,9 +0,0 @@ -package io.swagger.api; - -import javax.ws.rs.ApplicationPath; -import javax.ws.rs.core.Application; - -@ApplicationPath("/") -public class RestApplication extends Application { - -} diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java index 0ed8a2bf521..7f7fbe5ae25 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumArrays.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java index 09c6e8d7669..51cc83820f6 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/EnumTest.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.model.OuterEnum; import java.io.Serializable; import javax.validation.constraints.*; @@ -93,7 +95,7 @@ public enum EnumIntegerEnum { value = v; } - public String value() { + public Integer value() { return value; } @@ -127,7 +129,7 @@ public enum EnumNumberEnum { value = v; } - public String value() { + public Double value() { return value; } diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Ints.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..3e5e76cfe55 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Ints.java @@ -0,0 +1,57 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * True or False indicator + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java index 6a11ab8cbf6..9f3364faa35 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/MapTest.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..b3c8d8df7f5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,47 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * True or False indicator + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..b553d06fd45 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,73 @@ +package io.swagger.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ModelList implements Serializable { + + private @Valid String _123List = null; + + /** + **/ + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("123-list") + public String get123List() { + return _123List; + } + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(_123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Numbers.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..fcc9dbc954b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Numbers.java @@ -0,0 +1,52 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * some number + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java index 393f06ff039..7652fda5287 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Order.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.Date; import java.io.Serializable; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java index 1c9f88d1401..91893933a3d 100644 --- a/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec-interface/src/gen/java/io/swagger/model/Pet.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; diff --git a/samples/server/petstore/jaxrs-spec-interface/swagger.json b/samples/server/petstore/jaxrs-spec-interface/swagger.json index 4c4ea769313..e89ae6aaad7 100644 --- a/samples/server/petstore/jaxrs-spec-interface/swagger.json +++ b/samples/server/petstore/jaxrs-spec-interface/swagger.json @@ -108,8 +108,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "available", - "enum" : [ "available", "pending", "sold" ] + "enum" : [ "available", "pending", "sold" ], + "default" : "available" }, "collectionFormat" : "csv" } ], @@ -681,8 +681,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_form_string", @@ -700,8 +700,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_header_string", @@ -719,8 +719,8 @@ "type" : "array", "items" : { "type" : "string", - "default" : "$", - "enum" : [ ">", "$" ] + "enum" : [ ">", "$" ], + "default" : "$" } }, { "name" : "enum_query_string", @@ -1741,6 +1741,22 @@ }, "OuterBoolean" : { "type" : "boolean" + }, + "Boolean" : { + "type" : "boolean", + "description" : "True or False indicator", + "enum" : [ "true", "false" ] + }, + "Ints" : { + "type" : "integer", + "format" : "int32", + "description" : "True or False indicator", + "enum" : [ "0", "1", "2", "3", "4", "5", "6" ] + }, + "Numbers" : { + "type" : "number", + "description" : "some number", + "enum" : [ "7", "8", "9", "10" ] } }, "externalDocs" : { diff --git a/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs-spec/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 17d7b2328ef..eb9a57a261f 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -28,15 +28,44 @@ + + org.codehaus.mojo + build-helper-maven-plugin + 1.9.1 + + + add-source + generate-sources + + add-source + + + + src/gen/java + + + + + javax.ws.rs javax.ws.rs-api - 2.0 + 2.1.1 provided + + com.fasterxml.jackson.datatype + jackson-datatype-joda + ${jackson-version} + + + com.fasterxml.jackson.jaxrs + jackson-jaxrs-json-provider + ${jackson-version} + io.swagger swagger-annotations @@ -78,6 +107,7 @@ - 4.8.1 + 2.9.9 + 4.13.1 diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java index 7eed58f0716..41f222b30ed 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/PetApi.java @@ -1,6 +1,7 @@ package io.swagger.api; import java.io.File; +import java.io.InputStream; import io.swagger.model.ModelApiResponse; import io.swagger.model.Pet; @@ -147,8 +148,7 @@ public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = ModelApiResponse.class) }) - public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream, - @FormParam(value = "file") Attachment fileDetail) { + public Response uploadFile(@PathParam("petId") @ApiParam("ID of pet to update") Long petId,@FormParam(value = "additionalMetadata") String additionalMetadata, @FormParam(value = "file") InputStream fileInputStream) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java index 56e801bbf5f..2561172aea9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/api/RestApplication.java @@ -5,5 +5,5 @@ @ApplicationPath("/") public class RestApplication extends Application { - -} \ No newline at end of file + +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java index 0ed8a2bf521..7f7fbe5ae25 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumArrays.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.ArrayList; import java.util.List; import java.io.Serializable; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java index 09c6e8d7669..51cc83820f6 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/EnumTest.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.model.OuterEnum; import java.io.Serializable; import javax.validation.constraints.*; @@ -93,7 +95,7 @@ public enum EnumIntegerEnum { value = v; } - public String value() { + public Integer value() { return value; } @@ -127,7 +129,7 @@ public enum EnumNumberEnum { value = v; } - public String value() { + public Double value() { return value; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Ints.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..3e5e76cfe55 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Ints.java @@ -0,0 +1,57 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * True or False indicator + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java index 6a11ab8cbf6..9f3364faa35 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/MapTest.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.HashMap; import java.util.List; import java.util.Map; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..b3c8d8df7f5 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,47 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * True or False indicator + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..b553d06fd45 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,73 @@ +package io.swagger.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; + + +public class ModelList implements Serializable { + + private @Valid String _123List = null; + + /** + **/ + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("123-list") + public String get123List() { + return _123List; + } + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(_123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Numbers.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..fcc9dbc954b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Numbers.java @@ -0,0 +1,52 @@ +package io.swagger.model; + +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + + +/** + * some number + **/ +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java index 393f06ff039..7652fda5287 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Order.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import java.util.Date; import java.io.Serializable; import javax.validation.constraints.*; diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java index 1c9f88d1401..91893933a3d 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/io/swagger/model/Pet.java @@ -1,5 +1,7 @@ package io.swagger.model; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; import io.swagger.model.Category; import io.swagger.model.Tag; import java.util.ArrayList; diff --git a/samples/server/petstore/jaxrs-spec/swagger.json b/samples/server/petstore/jaxrs-spec/swagger.json index 4c4ea769313..73925ccfefb 100644 --- a/samples/server/petstore/jaxrs-spec/swagger.json +++ b/samples/server/petstore/jaxrs-spec/swagger.json @@ -1741,6 +1741,22 @@ }, "OuterBoolean" : { "type" : "boolean" + }, + "Boolean" : { + "type" : "boolean", + "description" : "True or False indicator", + "enum" : [ "true", "false" ] + }, + "Ints" : { + "type" : "integer", + "format" : "int32", + "description" : "True or False indicator", + "enum" : [ "0", "1", "2", "3", "4", "5", "6" ] + }, + "Numbers" : { + "type" : "number", + "description" : "some number", + "enum" : [ "7", "8", "9", "10" ] } }, "externalDocs" : { diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs/jersey1-useTags/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml index d589a432a52..2751650c45c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml @@ -188,12 +188,12 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 1.19.1 - 2.10.1 + 2.11.4 1.7.21 - 4.12 + 4.13.1 2.5 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index d2cbef7abb5..5c1d2a89c0d 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AdditionalPropertiesClass @@ -80,6 +81,7 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java index 8f1fdfd45bb..fdcc3c9287e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Animal.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Animal diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java index be5b217a5c0..b7604f896ce 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/AnimalFarm.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AnimalFarm diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 7dcd2118293..4ce866fecf7 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly @@ -50,6 +51,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @JsonProperty("ArrayArrayNumber") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 05331fa55e9..ece3075a98b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfNumberOnly @@ -50,6 +51,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @JsonProperty("ArrayNumber") @ApiModelProperty(value = "") + @Valid public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java index 295a1ea1f14..e19708da692 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ArrayTest.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayTest @@ -83,6 +84,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @JsonProperty("array_array_of_integer") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +112,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @JsonProperty("array_array_of_model") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java index 6ee896a961d..3c075ac3d1c 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Capitalization.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Capitalization diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java index b96cffbbd79..aaf2a741bcf 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Cat.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Cat diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java index 0408b4d6acf..5d2fd21cd68 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Category.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Category diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java index e96a4ff4eb8..f23df62fa59 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ClassModel.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model with \"_class\" property diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java index 7bae1955cb3..93a26704524 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Client.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Client diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java index 94fd1071a92..9bcaef5fe0a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Dog.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Dog diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java index 8542c26fea8..d32843653f0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumArrays.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumArrays diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java index 1a5899f15d0..9665628c57a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumClass.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java index 59944f01c5c..593623e992e 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/EnumTest.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumTest @@ -258,6 +259,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @JsonProperty("outerEnum") @ApiModelProperty(value = "") + @Valid public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java index bc552c619c3..8f21368deff 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/FormatTest.java @@ -22,6 +22,7 @@ import java.util.Date; import java.util.UUID; import javax.validation.constraints.*; +import javax.validation.Valid; /** * FormatTest @@ -142,6 +143,7 @@ public FormatTest number(BigDecimal number) { @JsonProperty("number") @ApiModelProperty(required = true, value = "") @NotNull + @Valid @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -262,6 +264,7 @@ public FormatTest date(Date date) { @JsonProperty("date") @ApiModelProperty(required = true, value = "") @NotNull + @Valid public Date getDate() { return date; } @@ -281,6 +284,7 @@ public FormatTest dateTime(Date dateTime) { **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public Date getDateTime() { return dateTime; } @@ -300,6 +304,7 @@ public FormatTest uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 02480c10c65..51701f2d4f0 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * HasOnlyReadOnly diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java index 73c04c4bd63..db4e5f5d6d8 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MapTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MapTest @@ -85,6 +86,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @JsonProperty("map_map_of_string") @ApiModelProperty(value = "") + @Valid public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5e1d96f5ecc..39390cf1301 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -25,6 +25,7 @@ import java.util.Map; import java.util.UUID; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -51,6 +52,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } @@ -70,6 +72,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public Date getDateTime() { return dateTime; } @@ -97,6 +100,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @JsonProperty("map") @ApiModelProperty(value = "") + @Valid public Map getMap() { return map; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java index 954ef7ebed3..4bf46c05014 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Model200Response.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name starting with number diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java index 2a54b591b32..35dada901b5 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ModelApiResponse diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..e194244fd19 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @JsonProperty("123-list") + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java index 12b213d6afb..bb64c46d6b6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ModelReturn.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing reserved words diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java index 771531b30ab..fbe6a9b94a6 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Name.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name same as property name diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java index 82604a5b9c7..58fa3c5c166 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/NumberOnly.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * NumberOnly @@ -40,6 +41,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @JsonProperty("JustNumber") @ApiModelProperty(value = "") + @Valid public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java index 5147738768b..d048be962d2 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Order.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Order @@ -146,6 +147,7 @@ public Order shipDate(Date shipDate) { **/ @JsonProperty("shipDate") @ApiModelProperty(value = "") + @Valid public Date getShipDate() { return shipDate; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java index c144ee99521..34b6281f61f 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterComposite.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * OuterComposite @@ -46,6 +47,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @JsonProperty("my_number") @ApiModelProperty(value = "") + @Valid public BigDecimal getMyNumber() { return myNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java index 6740674b07c..fb5907cc7ce 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/OuterEnum.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java index 04480639f0f..ddf1cf1b4c9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Pet.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Pet @@ -111,6 +112,7 @@ public Pet category(Category category) { **/ @JsonProperty("category") @ApiModelProperty(value = "") + @Valid public Category getCategory() { return category; } @@ -183,6 +185,7 @@ public Pet addTagsItem(Tag tagsItem) { **/ @JsonProperty("tags") @ApiModelProperty(value = "") + @Valid public List getTags() { return tags; } diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 5d26b4199f8..f0dd78a79a9 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ReadOnlyFirst diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java index df3182fbd80..7353c0e3cba 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/SpecialModelName.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * SpecialModelName diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java index a86f54144f8..7a51922095a 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/Tag.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Tag diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java index 0c1b67c0d5b..0d6dbfbd41b 100644 --- a/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1-useTags/src/gen/java/io/swagger/model/User.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * User diff --git a/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs/jersey1/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey1/pom.xml b/samples/server/petstore/jaxrs/jersey1/pom.xml index 0780b2a3638..b8f5b0d5b39 100644 --- a/samples/server/petstore/jaxrs/jersey1/pom.xml +++ b/samples/server/petstore/jaxrs/jersey1/pom.xml @@ -188,12 +188,12 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 1.19.1 - 2.10.1 + 2.11.4 1.7.21 - 4.12 + 4.13.1 2.5 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index d2cbef7abb5..5c1d2a89c0d 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AdditionalPropertiesClass @@ -80,6 +81,7 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java index 8f1fdfd45bb..fdcc3c9287e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Animal.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Animal diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java index be5b217a5c0..b7604f896ce 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/AnimalFarm.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AnimalFarm diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 7dcd2118293..4ce866fecf7 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly @@ -50,6 +51,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @JsonProperty("ArrayArrayNumber") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 05331fa55e9..ece3075a98b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfNumberOnly @@ -50,6 +51,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @JsonProperty("ArrayNumber") @ApiModelProperty(value = "") + @Valid public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java index 295a1ea1f14..e19708da692 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ArrayTest.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayTest @@ -83,6 +84,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @JsonProperty("array_array_of_integer") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +112,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @JsonProperty("array_array_of_model") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java index 6ee896a961d..3c075ac3d1c 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Capitalization.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Capitalization diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java index b96cffbbd79..aaf2a741bcf 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Cat.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Cat diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java index 0408b4d6acf..5d2fd21cd68 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Category.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Category diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java index e96a4ff4eb8..f23df62fa59 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ClassModel.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model with \"_class\" property diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java index 7bae1955cb3..93a26704524 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Client.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Client diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java index 94fd1071a92..9bcaef5fe0a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Dog.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Dog diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java index 8542c26fea8..d32843653f0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumArrays.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumArrays diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java index 1a5899f15d0..9665628c57a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumClass.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java index 59944f01c5c..593623e992e 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/EnumTest.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumTest @@ -258,6 +259,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @JsonProperty("outerEnum") @ApiModelProperty(value = "") + @Valid public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java index bc552c619c3..8f21368deff 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/FormatTest.java @@ -22,6 +22,7 @@ import java.util.Date; import java.util.UUID; import javax.validation.constraints.*; +import javax.validation.Valid; /** * FormatTest @@ -142,6 +143,7 @@ public FormatTest number(BigDecimal number) { @JsonProperty("number") @ApiModelProperty(required = true, value = "") @NotNull + @Valid @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -262,6 +264,7 @@ public FormatTest date(Date date) { @JsonProperty("date") @ApiModelProperty(required = true, value = "") @NotNull + @Valid public Date getDate() { return date; } @@ -281,6 +284,7 @@ public FormatTest dateTime(Date dateTime) { **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public Date getDateTime() { return dateTime; } @@ -300,6 +304,7 @@ public FormatTest uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 02480c10c65..51701f2d4f0 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * HasOnlyReadOnly diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java index 73c04c4bd63..db4e5f5d6d8 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MapTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MapTest @@ -85,6 +86,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @JsonProperty("map_map_of_string") @ApiModelProperty(value = "") + @Valid public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5e1d96f5ecc..39390cf1301 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -25,6 +25,7 @@ import java.util.Map; import java.util.UUID; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -51,6 +52,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } @@ -70,6 +72,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public Date getDateTime() { return dateTime; } @@ -97,6 +100,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @JsonProperty("map") @ApiModelProperty(value = "") + @Valid public Map getMap() { return map; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java index 954ef7ebed3..4bf46c05014 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Model200Response.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name starting with number diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java index 2a54b591b32..35dada901b5 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ModelApiResponse diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..e194244fd19 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @JsonProperty("123-list") + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java index 12b213d6afb..bb64c46d6b6 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ModelReturn.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing reserved words diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java index 771531b30ab..fbe6a9b94a6 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Name.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name same as property name diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java index 82604a5b9c7..58fa3c5c166 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/NumberOnly.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * NumberOnly @@ -40,6 +41,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @JsonProperty("JustNumber") @ApiModelProperty(value = "") + @Valid public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java index 5147738768b..d048be962d2 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Order.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Order @@ -146,6 +147,7 @@ public Order shipDate(Date shipDate) { **/ @JsonProperty("shipDate") @ApiModelProperty(value = "") + @Valid public Date getShipDate() { return shipDate; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java index c144ee99521..34b6281f61f 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterComposite.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * OuterComposite @@ -46,6 +47,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @JsonProperty("my_number") @ApiModelProperty(value = "") + @Valid public BigDecimal getMyNumber() { return myNumber; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java index 6740674b07c..fb5907cc7ce 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/OuterEnum.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java index 04480639f0f..ddf1cf1b4c9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Pet.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Pet @@ -111,6 +112,7 @@ public Pet category(Category category) { **/ @JsonProperty("category") @ApiModelProperty(value = "") + @Valid public Category getCategory() { return category; } @@ -183,6 +185,7 @@ public Pet addTagsItem(Tag tagsItem) { **/ @JsonProperty("tags") @ApiModelProperty(value = "") + @Valid public List getTags() { return tags; } diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 5d26b4199f8..f0dd78a79a9 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ReadOnlyFirst diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java index df3182fbd80..7353c0e3cba 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/SpecialModelName.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * SpecialModelName diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java index a86f54144f8..7a51922095a 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/Tag.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Tag diff --git a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java index 0c1b67c0d5b..0d6dbfbd41b 100644 --- a/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey1/src/gen/java/io/swagger/model/User.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * User diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index 611a65d59a0..fc6652be55d 100644 --- a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml @@ -172,11 +172,11 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.2.9.v20150224 2.22.2 2.8.9 - 4.12 + 4.13.1 1.1.7 2.5 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION b/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION +++ b/samples/server/petstore/jaxrs/jersey2/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/jaxrs/jersey2/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index f7334da8b2d..2ff3a2b1e2b 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -13,7 +13,7 @@ repo - + src/main/java @@ -150,7 +150,7 @@ 2.2 - + javax.validation @@ -172,11 +172,11 @@ 1.7 ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 2.22.2 - 2.10.1 - 4.12 + 2.11.4 + 4.13.1 1.1.7 2.5 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java index d2cbef7abb5..5c1d2a89c0d 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AdditionalPropertiesClass.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AdditionalPropertiesClass @@ -80,6 +81,7 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map> getMapOfMapProperty() { return mapOfMapProperty; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java index 8f1fdfd45bb..fdcc3c9287e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Animal.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Animal diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java index be5b217a5c0..b7604f896ce 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/AnimalFarm.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * AnimalFarm diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 7dcd2118293..4ce866fecf7 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfArrayOfNumberOnly @@ -50,6 +51,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayAr **/ @JsonProperty("ArrayArrayNumber") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayNumber() { return arrayArrayNumber; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java index 05331fa55e9..ece3075a98b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayOfNumberOnly.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayOfNumberOnly @@ -50,6 +51,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { **/ @JsonProperty("ArrayNumber") @ApiModelProperty(value = "") + @Valid public List getArrayNumber() { return arrayNumber; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java index 295a1ea1f14..e19708da692 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ArrayTest.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ArrayTest @@ -83,6 +84,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) **/ @JsonProperty("array_array_of_integer") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfInteger() { return arrayArrayOfInteger; } @@ -110,6 +112,7 @@ public ArrayTest addArrayArrayOfModelItem(List arrayArrayOfModelI **/ @JsonProperty("array_array_of_model") @ApiModelProperty(value = "") + @Valid public List> getArrayArrayOfModel() { return arrayArrayOfModel; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java index 6ee896a961d..3c075ac3d1c 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Capitalization.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Capitalization diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java index b96cffbbd79..aaf2a741bcf 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Cat.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Cat diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java index 0408b4d6acf..5d2fd21cd68 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Category.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Category diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java index e96a4ff4eb8..f23df62fa59 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ClassModel.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model with \"_class\" property diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java index 7bae1955cb3..93a26704524 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Client.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Client diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java index 94fd1071a92..9bcaef5fe0a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Dog.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.Animal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Dog diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java index 8542c26fea8..d32843653f0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumArrays.java @@ -22,6 +22,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumArrays diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java index 1a5899f15d0..9665628c57a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumClass.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java index 59944f01c5c..593623e992e 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/EnumTest.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import io.swagger.model.OuterEnum; import javax.validation.constraints.*; +import javax.validation.Valid; /** * EnumTest @@ -258,6 +259,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) { **/ @JsonProperty("outerEnum") @ApiModelProperty(value = "") + @Valid public OuterEnum getOuterEnum() { return outerEnum; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java index bc552c619c3..8f21368deff 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/FormatTest.java @@ -22,6 +22,7 @@ import java.util.Date; import java.util.UUID; import javax.validation.constraints.*; +import javax.validation.Valid; /** * FormatTest @@ -142,6 +143,7 @@ public FormatTest number(BigDecimal number) { @JsonProperty("number") @ApiModelProperty(required = true, value = "") @NotNull + @Valid @DecimalMin("32.1") @DecimalMax("543.2") public BigDecimal getNumber() { return number; } @@ -262,6 +264,7 @@ public FormatTest date(Date date) { @JsonProperty("date") @ApiModelProperty(required = true, value = "") @NotNull + @Valid public Date getDate() { return date; } @@ -281,6 +284,7 @@ public FormatTest dateTime(Date dateTime) { **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public Date getDateTime() { return dateTime; } @@ -300,6 +304,7 @@ public FormatTest uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java index 02480c10c65..51701f2d4f0 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/HasOnlyReadOnly.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * HasOnlyReadOnly diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java index 73c04c4bd63..db4e5f5d6d8 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MapTest.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MapTest @@ -85,6 +86,7 @@ public MapTest putMapMapOfStringItem(String key, Map mapMapOfStr **/ @JsonProperty("map_map_of_string") @ApiModelProperty(value = "") + @Valid public Map> getMapMapOfString() { return mapMapOfString; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 5e1d96f5ecc..39390cf1301 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -25,6 +25,7 @@ import java.util.Map; import java.util.UUID; import javax.validation.constraints.*; +import javax.validation.Valid; /** * MixedPropertiesAndAdditionalPropertiesClass @@ -51,6 +52,7 @@ public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { **/ @JsonProperty("uuid") @ApiModelProperty(value = "") + @Valid public UUID getUuid() { return uuid; } @@ -70,6 +72,7 @@ public MixedPropertiesAndAdditionalPropertiesClass dateTime(Date dateTime) { **/ @JsonProperty("dateTime") @ApiModelProperty(value = "") + @Valid public Date getDateTime() { return dateTime; } @@ -97,6 +100,7 @@ public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal **/ @JsonProperty("map") @ApiModelProperty(value = "") + @Valid public Map getMap() { return map; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java index 954ef7ebed3..4bf46c05014 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Model200Response.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name starting with number diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java index 2a54b591b32..35dada901b5 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelApiResponse.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ModelApiResponse diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelList.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..e194244fd19 --- /dev/null +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelList.java @@ -0,0 +1,91 @@ +/* + * Swagger Petstore + * 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 + * Contact: apiteam@swagger.io + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * Do not edit the class manually. + */ + + +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** + * ModelList + */ + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @JsonProperty("123-list") + @ApiModelProperty(value = "") + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java index 12b213d6afb..bb64c46d6b6 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ModelReturn.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing reserved words diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java index 771531b30ab..fbe6a9b94a6 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Name.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Model for testing model name same as property name diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java index 82604a5b9c7..58fa3c5c166 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/NumberOnly.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * NumberOnly @@ -40,6 +41,7 @@ public NumberOnly justNumber(BigDecimal justNumber) { **/ @JsonProperty("JustNumber") @ApiModelProperty(value = "") + @Valid public BigDecimal getJustNumber() { return justNumber; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java index 5147738768b..d048be962d2 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Order.java @@ -21,6 +21,7 @@ import io.swagger.annotations.ApiModelProperty; import java.util.Date; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Order @@ -146,6 +147,7 @@ public Order shipDate(Date shipDate) { **/ @JsonProperty("shipDate") @ApiModelProperty(value = "") + @Valid public Date getShipDate() { return shipDate; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java index c144ee99521..34b6281f61f 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterComposite.java @@ -20,6 +20,7 @@ import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import javax.validation.constraints.*; +import javax.validation.Valid; /** * OuterComposite @@ -46,6 +47,7 @@ public OuterComposite myNumber(BigDecimal myNumber) { **/ @JsonProperty("my_number") @ApiModelProperty(value = "") + @Valid public BigDecimal getMyNumber() { return myNumber; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java index 6740674b07c..fb5907cc7ce 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/OuterEnum.java @@ -16,6 +16,7 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonValue; import javax.validation.constraints.*; +import javax.validation.Valid; import com.fasterxml.jackson.annotation.JsonCreator; diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java index 04480639f0f..ddf1cf1b4c9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Pet.java @@ -24,6 +24,7 @@ import java.util.ArrayList; import java.util.List; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Pet @@ -111,6 +112,7 @@ public Pet category(Category category) { **/ @JsonProperty("category") @ApiModelProperty(value = "") + @Valid public Category getCategory() { return category; } @@ -183,6 +185,7 @@ public Pet addTagsItem(Tag tagsItem) { **/ @JsonProperty("tags") @ApiModelProperty(value = "") + @Valid public List getTags() { return tags; } diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java index 5d26b4199f8..f0dd78a79a9 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/ReadOnlyFirst.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * ReadOnlyFirst diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java index df3182fbd80..7353c0e3cba 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/SpecialModelName.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * SpecialModelName diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java index a86f54144f8..7a51922095a 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/Tag.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * Tag diff --git a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java index 0c1b67c0d5b..0d6dbfbd41b 100644 --- a/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java +++ b/samples/server/petstore/jaxrs/jersey2/src/gen/java/io/swagger/model/User.java @@ -19,6 +19,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import javax.validation.constraints.*; +import javax.validation.Valid; /** * User diff --git a/samples/server/petstore/nodejs/.swagger-codegen/VERSION b/samples/server/petstore/nodejs/.swagger-codegen/VERSION index 017674fb59d..8c7754221a4 100644 --- a/samples/server/petstore/nodejs/.swagger-codegen/VERSION +++ b/samples/server/petstore/nodejs/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/nodejs/api/swagger.yaml b/samples/server/petstore/nodejs/api/swagger.yaml index 56495cbd299..658ebde5016 100644 --- a/samples/server/petstore/nodejs/api/swagger.yaml +++ b/samples/server/petstore/nodejs/api/swagger.yaml @@ -29,7 +29,7 @@ tags: description: "Find out more about our store" url: "http://swagger.io" schemes: -- "http" +- "https" paths: /pet: post: @@ -52,14 +52,13 @@ paths: schema: $ref: "#/definitions/Pet" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: - "write:pets" - "read:pets" x-swagger-router-controller: "Pet" - x-is-post-method: true put: tags: - "pet" @@ -80,18 +79,17 @@ paths: schema: $ref: "#/definitions/Pet" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" - 405: + "405": description: "Validation exception" security: - petstore_auth: - "write:pets" - "read:pets" x-swagger-router-controller: "Pet" - x-is-put-method: true /pet/findByStatus: get: tags: @@ -110,27 +108,26 @@ paths: type: "array" items: type: "string" - default: "available" enum: - "available" - "pending" - "sold" + default: "available" collectionFormat: "csv" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid status value" security: - petstore_auth: - "write:pets" - "read:pets" x-swagger-router-controller: "Pet" - x-is-get-method: true /pet/findByTags: get: tags: @@ -152,13 +149,13 @@ paths: type: "string" collectionFormat: "csv" responses: - 200: + "200": description: "successful operation" schema: type: "array" items: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid tag value" security: - petstore_auth: @@ -166,7 +163,6 @@ paths: - "read:pets" deprecated: true x-swagger-router-controller: "Pet" - x-is-get-method: true /pet/{petId}: get: tags: @@ -185,18 +181,17 @@ paths: type: "integer" format: "int64" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Pet" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Pet not found" security: - api_key: [] x-swagger-router-controller: "Pet" - x-is-get-method: true post: tags: - "pet" @@ -226,14 +221,13 @@ paths: required: false type: "string" responses: - 405: + "405": description: "Invalid input" security: - petstore_auth: - "write:pets" - "read:pets" x-swagger-router-controller: "Pet" - x-is-post-method: true delete: tags: - "pet" @@ -255,14 +249,13 @@ paths: type: "integer" format: "int64" responses: - 400: + "400": description: "Invalid pet value" security: - petstore_auth: - "write:pets" - "read:pets" x-swagger-router-controller: "Pet" - x-is-delete-method: true /pet/{petId}/uploadImage: post: tags: @@ -292,7 +285,7 @@ paths: required: false type: "file" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/ApiResponse" @@ -301,7 +294,6 @@ paths: - "write:pets" - "read:pets" x-swagger-router-controller: "Pet" - x-is-post-method: true /store/inventory: get: tags: @@ -313,7 +305,7 @@ paths: - "application/json" parameters: [] responses: - 200: + "200": description: "successful operation" schema: type: "object" @@ -323,7 +315,6 @@ paths: security: - api_key: [] x-swagger-router-controller: "Store" - x-is-get-method: true /store/order: post: tags: @@ -342,14 +333,13 @@ paths: schema: $ref: "#/definitions/Order" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid Order" x-swagger-router-controller: "Store" - x-is-post-method: true /store/order/{orderId}: get: tags: @@ -371,16 +361,15 @@ paths: minimum: 1 format: "int64" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/Order" - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" x-swagger-router-controller: "Store" - x-is-get-method: true delete: tags: - "store" @@ -398,12 +387,11 @@ paths: required: true type: "string" responses: - 400: + "400": description: "Invalid ID supplied" - 404: + "404": description: "Order not found" x-swagger-router-controller: "Store" - x-is-delete-method: true /user: post: tags: @@ -425,7 +413,6 @@ paths: default: description: "successful operation" x-swagger-router-controller: "User" - x-is-post-method: true /user/createWithArray: post: tags: @@ -449,7 +436,6 @@ paths: default: description: "successful operation" x-swagger-router-controller: "User" - x-is-post-method: true /user/createWithList: post: tags: @@ -473,7 +459,6 @@ paths: default: description: "successful operation" x-swagger-router-controller: "User" - x-is-post-method: true /user/login: get: tags: @@ -496,7 +481,7 @@ paths: required: true type: "string" responses: - 200: + "200": description: "successful operation" headers: X-Rate-Limit: @@ -509,10 +494,9 @@ paths: description: "date in UTC when toekn expires" schema: type: "string" - 400: + "400": description: "Invalid username/password supplied" x-swagger-router-controller: "User" - x-is-get-method: true /user/logout: get: tags: @@ -528,7 +512,6 @@ paths: default: description: "successful operation" x-swagger-router-controller: "User" - x-is-get-method: true /user/{username}: get: tags: @@ -546,16 +529,15 @@ paths: required: true type: "string" responses: - 200: + "200": description: "successful operation" schema: $ref: "#/definitions/User" - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" x-swagger-router-controller: "User" - x-is-get-method: true put: tags: - "user" @@ -578,12 +560,11 @@ paths: schema: $ref: "#/definitions/User" responses: - 400: + "400": description: "Invalid user supplied" - 404: + "404": description: "User not found" x-swagger-router-controller: "User" - x-is-put-method: true delete: tags: - "user" @@ -600,12 +581,11 @@ paths: required: true type: "string" responses: - 400: + "400": description: "Invalid username supplied" - 404: + "404": description: "User not found" x-swagger-router-controller: "User" - x-is-delete-method: true securityDefinitions: petstore_auth: type: "oauth2" diff --git a/samples/server/petstore/nodejs/package-lock.json b/samples/server/petstore/nodejs/package-lock.json new file mode 100644 index 00000000000..40df05ef0fe --- /dev/null +++ b/samples/server/petstore/nodejs/package-lock.json @@ -0,0 +1,1075 @@ +{ + "name": "swagger-petstore", + "version": "1.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "append-field": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", + "integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=" + }, + "argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "requires": { + "sprintf-js": "~1.0.2" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + }, + "busboy": { + "version": "0.2.14", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-0.2.14.tgz", + "integrity": "sha1-bCpiLvz0fFe7vh4qnDetNseSVFM=", + "requires": { + "dicer": "0.2.5", + "readable-stream": "1.1.x" + } + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + }, + "dependencies": { + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + } + } + }, + "connect": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "requires": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + } + }, + "content-type": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" + }, + "cookiejar": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", + "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" + }, + "core-js": { + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.12.tgz", + "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "depd": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" + }, + "destroy": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" + }, + "dicer": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/dicer/-/dicer-0.2.5.tgz", + "integrity": "sha1-WZbAhrszIYyBLAkL3cCc0S+stw8=", + "requires": { + "readable-stream": "1.1.x", + "streamsearch": "0.1.2" + } + }, + "ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" + }, + "encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" + }, + "escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==" + }, + "etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "finalhandler": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "requires": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" + } + }, + "form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + } + }, + "formidable": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", + "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==" + }, + "fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + }, + "graphlib": { + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/graphlib/-/graphlib-2.1.8.tgz", + "integrity": "sha512-jcLLfkpoVGmH7/InMC/1hIvOPSUh38oJtGhvrOFGzioE1DZ+0YW16RgmOJhHiuWTvGiJQ9Z1Ik43JvkRPRvE+A==", + "requires": { + "lodash": "^4.17.15" + } + }, + "http-errors": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "requires": { + "depd": "~1.1.2", + "inherits": "2.0.3", + "setprototypeof": "1.1.1", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.0" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=" + }, + "js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + }, + "json-refs": { + "version": "2.1.7", + "resolved": "https://registry.npmjs.org/json-refs/-/json-refs-2.1.7.tgz", + "integrity": "sha1-uesB/in16j6Sh48VrqEK04taz4k=", + "requires": { + "commander": "^2.9.0", + "graphlib": "^2.1.1", + "js-yaml": "^3.8.3", + "native-promise-only": "^0.8.1", + "path-loader": "^1.0.2", + "slash": "^1.0.0", + "uri-js": "^3.0.2" + }, + "dependencies": { + "uri-js": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-3.0.2.tgz", + "integrity": "sha1-+QuFhQf4HepNz7s8TD2/orVX+qo=", + "requires": { + "punycode": "^2.1.0" + } + } + } + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==" + }, + "lodash-compat": { + "version": "3.10.2", + "resolved": "https://registry.npmjs.org/lodash-compat/-/lodash-compat-3.10.2.tgz", + "integrity": "sha1-xpQBKKnTD46QLNLPmf0Muk7PwYM=" + }, + "lodash._arraypool": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._arraypool/-/lodash._arraypool-2.4.1.tgz", + "integrity": "sha1-6I7suS4ruEyQZWEv2VigcZzUf5Q=" + }, + "lodash._basebind": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._basebind/-/lodash._basebind-2.4.1.tgz", + "integrity": "sha1-6UC5690nwyfgqNqxtVkWxTQelXU=", + "requires": { + "lodash._basecreate": "~2.4.1", + "lodash._setbinddata": "~2.4.1", + "lodash._slice": "~2.4.1", + "lodash.isobject": "~2.4.1" + } + }, + "lodash._baseclone": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-2.4.1.tgz", + "integrity": "sha1-MPgj5X4X43NdODvWK2Czh1Q7QYY=", + "requires": { + "lodash._getarray": "~2.4.1", + "lodash._releasearray": "~2.4.1", + "lodash._slice": "~2.4.1", + "lodash.assign": "~2.4.1", + "lodash.foreach": "~2.4.1", + "lodash.forown": "~2.4.1", + "lodash.isarray": "~2.4.1", + "lodash.isobject": "~2.4.1" + } + }, + "lodash._basecreate": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-2.4.1.tgz", + "integrity": "sha1-+Ob1tXip405UEXm1a47uv0oofgg=", + "requires": { + "lodash._isnative": "~2.4.1", + "lodash.isobject": "~2.4.1", + "lodash.noop": "~2.4.1" + } + }, + "lodash._basecreatecallback": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._basecreatecallback/-/lodash._basecreatecallback-2.4.1.tgz", + "integrity": "sha1-fQsmdknLKeehOdAQO3wR+uhOSFE=", + "requires": { + "lodash._setbinddata": "~2.4.1", + "lodash.bind": "~2.4.1", + "lodash.identity": "~2.4.1", + "lodash.support": "~2.4.1" + } + }, + "lodash._basecreatewrapper": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._basecreatewrapper/-/lodash._basecreatewrapper-2.4.1.tgz", + "integrity": "sha1-TTHy595+E0+/KAN2K4FQsyUZZm8=", + "requires": { + "lodash._basecreate": "~2.4.1", + "lodash._setbinddata": "~2.4.1", + "lodash._slice": "~2.4.1", + "lodash.isobject": "~2.4.1" + } + }, + "lodash._createwrapper": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._createwrapper/-/lodash._createwrapper-2.4.1.tgz", + "integrity": "sha1-UdaVeXPaTtVW43KQ2MGhjFPeFgc=", + "requires": { + "lodash._basebind": "~2.4.1", + "lodash._basecreatewrapper": "~2.4.1", + "lodash._slice": "~2.4.1", + "lodash.isfunction": "~2.4.1" + } + }, + "lodash._getarray": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._getarray/-/lodash._getarray-2.4.1.tgz", + "integrity": "sha1-+vH3+BD6mFolHCGHQESBCUg55e4=", + "requires": { + "lodash._arraypool": "~2.4.1" + } + }, + "lodash._isnative": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._isnative/-/lodash._isnative-2.4.1.tgz", + "integrity": "sha1-PqZAS3hKe+g2x7V1gOHN95sUgyw=" + }, + "lodash._maxpoolsize": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._maxpoolsize/-/lodash._maxpoolsize-2.4.1.tgz", + "integrity": "sha1-nUgvRjuOZq++WcLBTtsRcGAXIzQ=" + }, + "lodash._objecttypes": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._objecttypes/-/lodash._objecttypes-2.4.1.tgz", + "integrity": "sha1-fAt/admKH3ZSn4kLDNsbTf7BHBE=" + }, + "lodash._releasearray": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._releasearray/-/lodash._releasearray-2.4.1.tgz", + "integrity": "sha1-phOWMNdtFTawfdyAliiJsIL2pkE=", + "requires": { + "lodash._arraypool": "~2.4.1", + "lodash._maxpoolsize": "~2.4.1" + } + }, + "lodash._setbinddata": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._setbinddata/-/lodash._setbinddata-2.4.1.tgz", + "integrity": "sha1-98IAzRuS7yNrOZ7s9zxkjReqlNI=", + "requires": { + "lodash._isnative": "~2.4.1", + "lodash.noop": "~2.4.1" + } + }, + "lodash._shimkeys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._shimkeys/-/lodash._shimkeys-2.4.1.tgz", + "integrity": "sha1-bpzJZm/wgfC1psl4uD4kLmlJ0gM=", + "requires": { + "lodash._objecttypes": "~2.4.1" + } + }, + "lodash._slice": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash._slice/-/lodash._slice-2.4.1.tgz", + "integrity": "sha1-dFz0GlNZexj2iImFREBe+isG2Q8=" + }, + "lodash.assign": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.assign/-/lodash.assign-2.4.1.tgz", + "integrity": "sha1-hMOVlt1xGBqXsGUpE6fJZ15Jsao=", + "requires": { + "lodash._basecreatecallback": "~2.4.1", + "lodash._objecttypes": "~2.4.1", + "lodash.keys": "~2.4.1" + } + }, + "lodash.bind": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.bind/-/lodash.bind-2.4.1.tgz", + "integrity": "sha1-XRn6AFyMTSNvr0dCx7eh/Kvikmc=", + "requires": { + "lodash._createwrapper": "~2.4.1", + "lodash._slice": "~2.4.1" + } + }, + "lodash.foreach": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.foreach/-/lodash.foreach-2.4.1.tgz", + "integrity": "sha1-/j/Do0yGyUyrb5UiVgKCdB4BYwk=", + "requires": { + "lodash._basecreatecallback": "~2.4.1", + "lodash.forown": "~2.4.1" + } + }, + "lodash.forown": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.forown/-/lodash.forown-2.4.1.tgz", + "integrity": "sha1-eLQer+FAX6lmRZ6kGT/VAtCEUks=", + "requires": { + "lodash._basecreatecallback": "~2.4.1", + "lodash._objecttypes": "~2.4.1", + "lodash.keys": "~2.4.1" + } + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=" + }, + "lodash.identity": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.identity/-/lodash.identity-2.4.1.tgz", + "integrity": "sha1-ZpTP+mX++TH3wxzobHRZfPVg9PE=" + }, + "lodash.isarray": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.isarray/-/lodash.isarray-2.4.1.tgz", + "integrity": "sha1-tSoybB9i9tfac6MdVAHfbvRPD6E=", + "requires": { + "lodash._isnative": "~2.4.1" + } + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=" + }, + "lodash.isfunction": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.isfunction/-/lodash.isfunction-2.4.1.tgz", + "integrity": "sha1-LP1XXHPkmKtX4xm3f6Aq3vE6lNE=" + }, + "lodash.isobject": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.isobject/-/lodash.isobject-2.4.1.tgz", + "integrity": "sha1-Wi5H/mmVPx7mMafrof5k0tBlWPU=", + "requires": { + "lodash._objecttypes": "~2.4.1" + } + }, + "lodash.keys": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.keys/-/lodash.keys-2.4.1.tgz", + "integrity": "sha1-SN6kbfj/djKxDXBrissmWR4rNyc=", + "requires": { + "lodash._isnative": "~2.4.1", + "lodash._shimkeys": "~2.4.1", + "lodash.isobject": "~2.4.1" + } + }, + "lodash.noop": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.noop/-/lodash.noop-2.4.1.tgz", + "integrity": "sha1-T7VPgWZS5a4Q6PcvcXo4jHMmU4o=" + }, + "lodash.support": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.support/-/lodash.support-2.4.1.tgz", + "integrity": "sha1-Mg4LZwMWc8KNeiu12eAzGkUkBRU=", + "requires": { + "lodash._isnative": "~2.4.1" + } + }, + "media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" + }, + "methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + }, + "mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" + }, + "mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" + }, + "mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "requires": { + "mime-db": "1.45.0" + } + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "requires": { + "minimist": "^1.2.5" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "multer": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.2.tgz", + "integrity": "sha512-xY8pX7V+ybyUpbYMxtjM9KAiD9ixtg5/JkeKUTD6xilfDv0vzzOFcCp4Ljb1UU3tSOM3VTZtKo63OmzOrGi3Cg==", + "requires": { + "append-field": "^1.0.0", + "busboy": "^0.2.11", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.1", + "object-assign": "^4.1.1", + "on-finished": "^2.3.0", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + } + }, + "native-promise-only": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/native-promise-only/-/native-promise-only-0.8.1.tgz", + "integrity": "sha1-IKMYwwy0X3H+et+/eyHJnBRy7xE=" + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, + "on-finished": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "requires": { + "ee-first": "1.1.1" + } + }, + "parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" + }, + "path-loader": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/path-loader/-/path-loader-1.0.10.tgz", + "integrity": "sha512-CMP0v6S6z8PHeJ6NFVyVJm6WyJjIwFvyz2b0n2/4bKdS/0uZa/9sKUlYZzubrn3zuDRU0zIuEDX9DZYQ2ZI8TA==", + "requires": { + "native-promise-only": "^0.8.1", + "superagent": "^3.8.3" + }, + "dependencies": { + "debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "requires": { + "ms": "^2.1.1" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "superagent": { + "version": "3.8.3", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-3.8.3.tgz", + "integrity": "sha512-GLQtLMCoEIK4eDv6OGtkOoSMt3D+oq0y3dsxMuYuDvaNUvuT8eFBuLmfR0iYYzHC1e8hpzC6ZsxbuP6DIalMFA==", + "requires": { + "component-emitter": "^1.2.0", + "cookiejar": "^2.1.0", + "debug": "^3.1.0", + "extend": "^3.0.0", + "form-data": "^2.3.1", + "formidable": "^1.2.0", + "methods": "^1.1.1", + "mime": "^1.4.1", + "qs": "^6.5.1", + "readable-stream": "^2.3.5" + } + } + } + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "qs": { + "version": "6.9.6", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", + "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==" + }, + "range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" + }, + "readable-stream": { + "version": "1.1.14", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", + "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + }, + "reduce-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/reduce-component/-/reduce-component-1.0.1.tgz", + "integrity": "sha1-4Mk1QsV0UhvqE98PlIjtgqt3xdo=" + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "send": { + "version": "0.17.1", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", + "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "requires": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "~1.7.2", + "mime": "1.6.0", + "ms": "2.1.1", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "dependencies": { + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + } + } + }, + "serve-static": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", + "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "requires": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.1" + } + }, + "setprototypeof": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==" + }, + "slash": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-1.0.0.tgz", + "integrity": "sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=" + }, + "spark-md5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/spark-md5/-/spark-md5-1.0.1.tgz", + "integrity": "sha1-xLmo1Bz3sIRUI6ghgk+N/6D1G3w=" + }, + "sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=" + }, + "statuses": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", + "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" + }, + "streamsearch": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", + "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" + }, + "string": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/string/-/string-3.3.3.tgz", + "integrity": "sha1-XqIRzZLSKOGEKUmQpsyXs2anfLA=" + }, + "string_decoder": { + "version": "0.10.31", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" + }, + "superagent": { + "version": "1.8.5", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-1.8.5.tgz", + "integrity": "sha1-HA3cOvMOgOuE68BcshItqP6UC1U=", + "requires": { + "component-emitter": "~1.2.0", + "cookiejar": "2.0.6", + "debug": "2", + "extend": "3.0.0", + "form-data": "1.0.0-rc3", + "formidable": "~1.0.14", + "methods": "~1.1.1", + "mime": "1.3.4", + "qs": "2.3.3", + "readable-stream": "1.0.27-1", + "reduce-component": "1.0.1" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "cookiejar": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.0.6.tgz", + "integrity": "sha1-Cr81atANHFohnYjURRgEbdAmrP4=" + }, + "extend": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=" + }, + "form-data": { + "version": "1.0.0-rc3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz", + "integrity": "sha1-01vGLn+8KTeuePlIqqDTjZBgdXc=", + "requires": { + "async": "^1.4.0", + "combined-stream": "^1.0.5", + "mime-types": "^2.1.3" + } + }, + "formidable": { + "version": "1.0.16", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.16.tgz", + "integrity": "sha1-SRbP38TL7QILJXpqlQWpqzjCzQ4=" + }, + "mime": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", + "integrity": "sha1-EV+eO2s9rylZmDyzjxSaLUDrXVM=" + }, + "qs": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.3.3.tgz", + "integrity": "sha1-6eha2+ddoLvkyOBHaghikPhjtAQ=" + }, + "readable-stream": { + "version": "1.0.27-1", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz", + "integrity": "sha1-a2eYPCA1fO/QfwFlABoW1xDZEHg=", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" + } + } + } + }, + "swagger-converter": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/swagger-converter/-/swagger-converter-0.1.7.tgz", + "integrity": "sha1-oJdRnG8e5N1n4wjZtT3cnCslf5c=", + "requires": { + "lodash.clonedeep": "^2.4.1" + }, + "dependencies": { + "lodash.clonedeep": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-2.4.1.tgz", + "integrity": "sha1-8pIDtAsS/uCkXTYxZIJZvrq8eGg=", + "requires": { + "lodash._baseclone": "~2.4.1", + "lodash._basecreatecallback": "~2.4.1" + } + } + } + }, + "swagger-tools": { + "version": "0.10.1", + "resolved": "https://registry.npmjs.org/swagger-tools/-/swagger-tools-0.10.1.tgz", + "integrity": "sha1-pFWyV5mOzyDeW06Zvc8acJqw/tw=", + "requires": { + "async": "^1.3.0", + "body-parser": "1.12.4", + "commander": "^2.8.1", + "debug": "^2.2.0", + "js-yaml": "^3.3.1", + "json-refs": "^2.1.5", + "lodash-compat": "^3.10.0", + "multer": "^1.1.0", + "parseurl": "^1.3.0", + "path-to-regexp": "^1.2.0", + "qs": "^4.0.0", + "serve-static": "^1.10.0", + "spark-md5": "^1.0.0", + "string": "^3.3.0", + "superagent": "^1.2.0", + "swagger-converter": "^0.1.7", + "traverse": "^0.6.6", + "z-schema": "^3.15.4" + }, + "dependencies": { + "async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" + }, + "body-parser": { + "version": "1.12.4", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.12.4.tgz", + "integrity": "sha1-CQcAxLoohiqFIO83g5X97l9hwik=", + "requires": { + "bytes": "1.0.0", + "content-type": "~1.0.1", + "debug": "~2.2.0", + "depd": "~1.0.1", + "iconv-lite": "0.4.8", + "on-finished": "~2.2.1", + "qs": "2.4.2", + "raw-body": "~2.0.1", + "type-is": "~1.6.2" + }, + "dependencies": { + "debug": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", + "integrity": "sha1-+HBX6ZWxofauaklgZkE3vFbwOdo=", + "requires": { + "ms": "0.7.1" + } + }, + "qs": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-2.4.2.tgz", + "integrity": "sha1-9854jld33wtQENp/fE5zujJHD1o=" + } + } + }, + "bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-1.0.0.tgz", + "integrity": "sha1-NWnt6Lo0MV+rmcPpLLBMciDeH6g=" + }, + "depd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/depd/-/depd-1.0.1.tgz", + "integrity": "sha1-gK7GTJ1tl+ZcwqnKqTwKpqv3Oqo=" + }, + "ee-first": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.0.tgz", + "integrity": "sha1-ag18YiHkkP7v2S7D9EHJzozQl/Q=" + }, + "iconv-lite": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.8.tgz", + "integrity": "sha1-xgGadZXyzvynAuq2lKAQvNkpjSA=" + }, + "ms": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz", + "integrity": "sha1-nNE8A62/8ltl7/3nzoZO6VIBcJg=" + }, + "on-finished": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.2.1.tgz", + "integrity": "sha1-XIXBzDYpn3gCllP2Z/J7a5nrwCk=", + "requires": { + "ee-first": "1.1.0" + } + }, + "path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "requires": { + "isarray": "0.0.1" + } + }, + "qs": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-4.0.0.tgz", + "integrity": "sha1-wx2bdOwn33XlQ6hseHKO2NRiNgc=" + }, + "raw-body": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.0.2.tgz", + "integrity": "sha1-osL5jIUxzumcY9jSOLfel7tln8o=", + "requires": { + "bytes": "2.1.0", + "iconv-lite": "0.4.8" + }, + "dependencies": { + "bytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-2.1.0.tgz", + "integrity": "sha1-rJPEEOL/ycx89LRks4KJBn9eR7Q=" + } + } + } + } + }, + "toidentifier": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==" + }, + "traverse": { + "version": "0.6.6", + "resolved": "https://registry.npmjs.org/traverse/-/traverse-0.6.6.tgz", + "integrity": "sha1-y99WD9e5r2MlAv7UD5GMFX6pcTc=" + }, + "type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "requires": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + } + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" + }, + "validator": { + "version": "10.11.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-10.11.0.tgz", + "integrity": "sha512-X/p3UZerAIsbBfN/IwahhYaBbY68EN/UQBWHtsbXGT5bfrH/p4NQzUCG1kF/rtKaNpnJ7jAu6NGTdSNtyNIXMw==" + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" + }, + "z-schema": { + "version": "3.25.1", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-3.25.1.tgz", + "integrity": "sha512-7tDlwhrBG+oYFdXNOjILSurpfQyuVgkRe3hB2q8TEssamDHB7BbLWYkYO98nTn0FibfdFroFKDjndbgufAgS/Q==", + "requires": { + "commander": "^2.7.1", + "core-js": "^2.5.7", + "lodash.get": "^4.0.0", + "lodash.isequal": "^4.0.0", + "validator": "^10.0.0" + } + } + } +} diff --git a/samples/server/petstore/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md b/samples/server/petstore/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md index d21ebf928f8..8c4eb28baae 100644 --- a/samples/server/petstore/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md +++ b/samples/server/petstore/slim/vendor/container-interop/container-interop/docs/Delegate-lookup-meta.md @@ -62,7 +62,7 @@ If the entry is not part of the container, an exception should be thrown (as req - Calls to the `has` method should only return *true* if the entry is part of the container. If the entry is not part of the container, *false* should be returned. - Finally, the important part: if the entry we are fetching has dependencies, -**instead** of perfoming the dependency lookup in the container, the lookup is performed on the *delegate container*. +**instead** of performing the dependency lookup in the container, the lookup is performed on the *delegate container*. Important! By default, the lookup should be performed on the delegate container **only**, not on the container itself. @@ -178,7 +178,7 @@ class CompositeContainer { Cons have been extensively discussed [here](https://github.com/container-interop/container-interop/pull/8#issuecomment-51721777). Basically, forcing a setter into an interface is a bad idea. Setters are similar to constructor arguments, -and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweights the benefits of the interface. +and it's a bad idea to standardize a constructor: how the delegate container is configured into a container is an implementation detail. This outweighs the benefits of the interface. ### 4.4 Alternative: no exception case for delegate lookups diff --git a/samples/server/petstore/spring-mvc-j8-async/.swagger-codegen/VERSION b/samples/server/petstore/spring-mvc-j8-async/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/spring-mvc-j8-async/.swagger-codegen/VERSION +++ b/samples/server/petstore/spring-mvc-j8-async/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml index fbbbbde2766..c964f3c165f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml @@ -164,10 +164,10 @@ ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 - 2.10.1 + 2.11.4 2.6.4 4.3.9.RELEASE diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java index c8b6bed74de..2bad67342e9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -30,6 +30,7 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; +@Validated @Api(value = "another-fake", description = "the another-fake API") @RequestMapping(value = "/v2") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java index 96f11f17db1..904d089b3dd 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -35,6 +35,7 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; +@Validated @Api(value = "fake", description = "the fake API") @RequestMapping(value = "/v2") public interface FakeApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java index 8927db81093..0b397faf63f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -30,6 +30,7 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; +@Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @RequestMapping(value = "/v2") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java index 10372d3d552..dda742c8217 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -32,6 +32,7 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -256,7 +257,7 @@ default CompletableFuture> updatePetWithForm(@ApiParam(valu produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { + default CompletableFuture> uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) { if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { if (getAcceptHeader().get().contains("application/json")) { try { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java index c2b3e80aa28..b351fa7b900 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -31,6 +31,7 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java index c9a080f3f55..5907d04c893 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -31,6 +31,7 @@ import java.util.Optional; import java.util.concurrent.CompletableFuture; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 338c4575058..9b7c50ccf05 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -17,6 +17,7 @@ */ @Validated + public class AdditionalPropertiesClass { @JsonProperty("map_property") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java index c044d494a42..a96ec17c98d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Animal.java @@ -15,12 +15,14 @@ * Animal */ @Validated + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), }) + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java index be9c113dd57..adf707bfa8f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ */ @Validated + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index a861c01791a..4bcf948a8a8 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index a6155b044fd..9e7af5726ce 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java index e5797376d2e..a3f8d31fe57 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ArrayTest.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayTest { @JsonProperty("array_of_string") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java index d2451af8b9f..2dbe6d262a2 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Capitalization.java @@ -14,6 +14,7 @@ */ @Validated + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java index 154c1aaeb0a..dee0ca496fe 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Cat.java @@ -15,6 +15,7 @@ */ @Validated + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java index a7cfd551750..ab41411820a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Category.java @@ -14,6 +14,7 @@ */ @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java index 86029cf9bdd..fe5b53552f3 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ClassModel.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model with \"_class\" property") @Validated + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java index 82e3f9f1116..b7635ab990d 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Client.java @@ -14,6 +14,7 @@ */ @Validated + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java index 17f1d070eba..2e350414e99 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Dog.java @@ -15,6 +15,7 @@ */ @Validated + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java index de785c05d59..0e3dd73dd40 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumArrays.java @@ -17,6 +17,7 @@ */ @Validated + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java index 20e909431af..a63c093c979 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/EnumTest.java @@ -16,6 +16,7 @@ */ @Validated + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java index d79c5833f6b..5cdc50b30da 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/FormatTest.java @@ -18,6 +18,7 @@ */ @Validated + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java index 23bc93bfdce..5eefe20921a 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ */ @Validated + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Ints.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..b8a3f1f6906 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Ints.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java index 1d08a0cdadb..2d9eb253436 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MapTest.java @@ -18,6 +18,7 @@ */ @Validated + public class MapTest { @JsonProperty("map_map_of_string") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 642840cf48d..067414b9873 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ */ @Validated + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java index a8b496debb4..93ea58fc31f 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Model200Response.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name starting with number") @Validated + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java index bb4d933a852..096400f9c60 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelApiResponse.java @@ -14,6 +14,7 @@ */ @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..43a98b33cbf --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,43 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..1ca8137c702 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelList.java @@ -0,0 +1,81 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * ModelList + */ +@Validated + + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + + + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java index 2f85fcb8a07..cfc5bb6d34e 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ModelReturn.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing reserved words") @Validated + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java index 26361ad7cb0..a06d6ed2db9 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Name.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name same as property name") @Validated + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java index 23120f3d823..dfa49f5dc20 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/NumberOnly.java @@ -15,6 +15,7 @@ */ @Validated + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Numbers.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..0903cc7a770 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Numbers.java @@ -0,0 +1,48 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java index d629712d8e6..52644f13878 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Order.java @@ -16,6 +16,7 @@ */ @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterComposite.java index 6786a2eac48..5f7669c5b39 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/OuterComposite.java @@ -15,6 +15,7 @@ */ @Validated + public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java index e645da24811..e4c40227a87 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Pet.java @@ -19,6 +19,7 @@ */ @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java index 475f63e8731..01be7b80359 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ */ @Validated + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java index 1a4f1acd512..e5786704f09 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/SpecialModelName.java @@ -14,6 +14,7 @@ */ @Validated + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java index 73a7d36cf4d..954576c549b 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/Tag.java @@ -14,6 +14,7 @@ */ @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java index 658e823c5a5..307edbaed10 100644 --- a/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-async/src/main/java/io/swagger/model/User.java @@ -14,6 +14,7 @@ */ @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/.swagger-codegen/VERSION b/samples/server/petstore/spring-mvc-j8-localdatetime/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/.swagger-codegen/VERSION +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml index 398767fcc39..93250828f96 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml @@ -164,10 +164,10 @@ ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 - 2.10.1 + 2.11.4 2.6.4 4.3.9.RELEASE diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/AnotherFakeApi.java index 61da995df34..6b45f35f2af 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -29,6 +29,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "another-fake", description = "the another-fake API") @RequestMapping(value = "/v2") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeApi.java index 22f93034e2d..4ab93de9be2 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -34,6 +34,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "fake", description = "the fake API") @RequestMapping(value = "/v2") public interface FakeApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeClassnameTestApi.java index 4cbfb6a507a..5c915698cd7 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -29,6 +29,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @RequestMapping(value = "/v2") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/PetApi.java index 83291ea6feb..759b4a2c998 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -31,6 +31,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -255,7 +256,7 @@ default ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { + default ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) { if(getObjectMapper().isPresent() && getAcceptHeader().isPresent()) { if (getAcceptHeader().get().contains("application/json")) { try { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/StoreApi.java index 89092bb0efb..946e7c6f828 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -30,6 +30,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/UserApi.java index 2e368b2ea49..4bce43f5809 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -30,6 +30,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 338c4575058..9b7c50ccf05 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -17,6 +17,7 @@ */ @Validated + public class AdditionalPropertiesClass { @JsonProperty("map_property") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Animal.java index c044d494a42..a96ec17c98d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Animal.java @@ -15,12 +15,14 @@ * Animal */ @Validated + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), }) + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AnimalFarm.java index be9c113dd57..adf707bfa8f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ */ @Validated + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index a861c01791a..4bcf948a8a8 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index a6155b044fd..9e7af5726ce 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayTest.java index e5797376d2e..a3f8d31fe57 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ArrayTest.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayTest { @JsonProperty("array_of_string") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Capitalization.java index d2451af8b9f..2dbe6d262a2 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Capitalization.java @@ -14,6 +14,7 @@ */ @Validated + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Cat.java index 154c1aaeb0a..dee0ca496fe 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Cat.java @@ -15,6 +15,7 @@ */ @Validated + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Category.java index a7cfd551750..ab41411820a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Category.java @@ -14,6 +14,7 @@ */ @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ClassModel.java index 86029cf9bdd..fe5b53552f3 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ClassModel.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model with \"_class\" property") @Validated + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Client.java index 82e3f9f1116..b7635ab990d 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Client.java @@ -14,6 +14,7 @@ */ @Validated + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Dog.java index 17f1d070eba..2e350414e99 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Dog.java @@ -15,6 +15,7 @@ */ @Validated + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumArrays.java index de785c05d59..0e3dd73dd40 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumArrays.java @@ -17,6 +17,7 @@ */ @Validated + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumTest.java index 20e909431af..a63c093c979 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/EnumTest.java @@ -16,6 +16,7 @@ */ @Validated + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/FormatTest.java index 441b99b298f..432133e367a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/FormatTest.java @@ -18,6 +18,7 @@ */ @Validated + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/HasOnlyReadOnly.java index 23bc93bfdce..5eefe20921a 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ */ @Validated + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Ints.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..b8a3f1f6906 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Ints.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MapTest.java index 1d08a0cdadb..2d9eb253436 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MapTest.java @@ -18,6 +18,7 @@ */ @Validated + public class MapTest { @JsonProperty("map_map_of_string") @Valid diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 391212f20fb..2de9be92874 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ */ @Validated + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Model200Response.java index a8b496debb4..93ea58fc31f 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Model200Response.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name starting with number") @Validated + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelApiResponse.java index bb4d933a852..096400f9c60 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelApiResponse.java @@ -14,6 +14,7 @@ */ @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..43a98b33cbf --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,43 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelList.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..1ca8137c702 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelList.java @@ -0,0 +1,81 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * ModelList + */ +@Validated + + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + + + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelReturn.java index 2f85fcb8a07..cfc5bb6d34e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ModelReturn.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing reserved words") @Validated + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Name.java index 26361ad7cb0..a06d6ed2db9 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Name.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name same as property name") @Validated + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/NumberOnly.java index 23120f3d823..dfa49f5dc20 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/NumberOnly.java @@ -15,6 +15,7 @@ */ @Validated + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Numbers.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..0903cc7a770 --- /dev/null +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Numbers.java @@ -0,0 +1,48 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Order.java index b8bd1b59207..cffcddece0e 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Order.java @@ -16,6 +16,7 @@ */ @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/OuterComposite.java index 6786a2eac48..5f7669c5b39 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/OuterComposite.java @@ -15,6 +15,7 @@ */ @Validated + public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Pet.java index e645da24811..e4c40227a87 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Pet.java @@ -19,6 +19,7 @@ */ @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ReadOnlyFirst.java index 475f63e8731..01be7b80359 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ */ @Validated + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/SpecialModelName.java index 1a4f1acd512..e5786704f09 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/SpecialModelName.java @@ -14,6 +14,7 @@ */ @Validated + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Tag.java index 73a7d36cf4d..954576c549b 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/Tag.java @@ -14,6 +14,7 @@ */ @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/User.java b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/User.java index 658e823c5a5..307edbaed10 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/src/main/java/io/swagger/model/User.java @@ -14,6 +14,7 @@ */ @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc/.swagger-codegen/VERSION b/samples/server/petstore/spring-mvc/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/spring-mvc/.swagger-codegen/VERSION +++ b/samples/server/petstore/spring-mvc/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml index eea53fac530..86d5b18318d 100644 --- a/samples/server/petstore/spring-mvc/pom.xml +++ b/samples/server/petstore/spring-mvc/pom.xml @@ -164,10 +164,10 @@ ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 - 2.10.1 + 2.11.4 2.6.4 4.3.9.RELEASE diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java index 7f51d10659a..c36082e74de 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "another-fake", description = "the another-fake API") @RequestMapping(value = "/v2") public interface AnotherFakeApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java index d2c055f0419..e8601bb5c8c 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -27,6 +27,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake", description = "the fake API") @RequestMapping(value = "/v2") public interface FakeApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java index e0c678cbf01..638dd3ce8da 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @RequestMapping(value = "/v2") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java index 57a7e62d56c..40770cfdabe 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -144,6 +145,6 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file); } diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApiController.java index f36f2a8d741..3cc1a636e5f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/PetApiController.java @@ -127,7 +127,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java index 57029dce674..0cad10d07b0 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java index 4bcc24002cd..e3e3241789f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 05680ef71de..983560d4f80 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -17,6 +17,7 @@ */ @Validated + public class AdditionalPropertiesClass { @JsonProperty("map_property") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Animal.java index c044d494a42..a96ec17c98d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Animal.java @@ -15,12 +15,14 @@ * Animal */ @Validated + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), }) + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AnimalFarm.java index be9c113dd57..adf707bfa8f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ */ @Validated + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 814fb690acd..74e17d165ab 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 99c91d44a01..6fc5f8ebd94 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java index 753132b708b..c6f81ceb09f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ArrayTest.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayTest { @JsonProperty("array_of_string") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java index d2451af8b9f..2dbe6d262a2 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Capitalization.java @@ -14,6 +14,7 @@ */ @Validated + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Cat.java index 154c1aaeb0a..dee0ca496fe 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Cat.java @@ -15,6 +15,7 @@ */ @Validated + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Category.java index a7cfd551750..ab41411820a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Category.java @@ -14,6 +14,7 @@ */ @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ClassModel.java index 86029cf9bdd..fe5b53552f3 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ClassModel.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model with \"_class\" property") @Validated + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Client.java index 82e3f9f1116..b7635ab990d 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Client.java @@ -14,6 +14,7 @@ */ @Validated + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Dog.java index 17f1d070eba..2e350414e99 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Dog.java @@ -15,6 +15,7 @@ */ @Validated + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java index d0ab7afca56..e587b289bc2 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumArrays.java @@ -17,6 +17,7 @@ */ @Validated + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumTest.java index 20e909431af..a63c093c979 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/EnumTest.java @@ -16,6 +16,7 @@ */ @Validated + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java index 99ad7deb9cf..c3034f4c145 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/FormatTest.java @@ -18,6 +18,7 @@ */ @Validated + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/HasOnlyReadOnly.java index 23bc93bfdce..5eefe20921a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ */ @Validated + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Ints.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..b8a3f1f6906 --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Ints.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java index 556cb7c33c5..99281e81e6a 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MapTest.java @@ -18,6 +18,7 @@ */ @Validated + public class MapTest { @JsonProperty("map_map_of_string") @Valid diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 50330e80d5c..734f96dad9b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ */ @Validated + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java index a8b496debb4..93ea58fc31f 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Model200Response.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name starting with number") @Validated + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelApiResponse.java index bb4d933a852..096400f9c60 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelApiResponse.java @@ -14,6 +14,7 @@ */ @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..43a98b33cbf --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,43 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelList.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..1ca8137c702 --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelList.java @@ -0,0 +1,81 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * ModelList + */ +@Validated + + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + + + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelReturn.java index 2f85fcb8a07..cfc5bb6d34e 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ModelReturn.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing reserved words") @Validated + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Name.java index 26361ad7cb0..a06d6ed2db9 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Name.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name same as property name") @Validated + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/NumberOnly.java index 23120f3d823..dfa49f5dc20 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/NumberOnly.java @@ -15,6 +15,7 @@ */ @Validated + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Numbers.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..0903cc7a770 --- /dev/null +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Numbers.java @@ -0,0 +1,48 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Order.java index b8a2a2c46e4..f1001b18b91 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Order.java @@ -16,6 +16,7 @@ */ @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/OuterComposite.java index 6786a2eac48..5f7669c5b39 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/OuterComposite.java @@ -15,6 +15,7 @@ */ @Validated + public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java index 1c769b0939e..98fcc9d1bfd 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Pet.java @@ -19,6 +19,7 @@ */ @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ReadOnlyFirst.java index 475f63e8731..01be7b80359 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ */ @Validated + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/SpecialModelName.java index 1a4f1acd512..e5786704f09 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/SpecialModelName.java @@ -14,6 +14,7 @@ */ @Validated + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Tag.java index 73a7d36cf4d..954576c549b 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/Tag.java @@ -14,6 +14,7 @@ */ @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/User.java b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/User.java index 658e823c5a5..307edbaed10 100644 --- a/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/spring-mvc/src/main/java/io/swagger/model/User.java @@ -14,6 +14,7 @@ */ @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-beanvalidation/.swagger-codegen/VERSION b/samples/server/petstore/springboot-beanvalidation/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/springboot-beanvalidation/.swagger-codegen/VERSION +++ b/samples/server/petstore/springboot-beanvalidation/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java index 7f51d10659a..c36082e74de 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "another-fake", description = "the another-fake API") @RequestMapping(value = "/v2") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java index d2c055f0419..e8601bb5c8c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -27,6 +27,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake", description = "the fake API") @RequestMapping(value = "/v2") public interface FakeApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java index e0c678cbf01..638dd3ce8da 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @RequestMapping(value = "/v2") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java index 57a7e62d56c..40770cfdabe 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -144,6 +145,6 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file); } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApiController.java index f36f2a8d741..3cc1a636e5f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/PetApiController.java @@ -127,7 +127,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java index 57029dce674..0cad10d07b0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java index 4bcc24002cd..e3e3241789f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 05680ef71de..983560d4f80 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -17,6 +17,7 @@ */ @Validated + public class AdditionalPropertiesClass { @JsonProperty("map_property") @Valid diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Animal.java index c044d494a42..a96ec17c98d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Animal.java @@ -15,12 +15,14 @@ * Animal */ @Validated + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), }) + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AnimalFarm.java index be9c113dd57..adf707bfa8f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ */ @Validated + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 814fb690acd..74e17d165ab 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 99c91d44a01..6fc5f8ebd94 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayTest.java index 753132b708b..c6f81ceb09f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ArrayTest.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayTest { @JsonProperty("array_of_string") @Valid diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Capitalization.java index d2451af8b9f..2dbe6d262a2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Capitalization.java @@ -14,6 +14,7 @@ */ @Validated + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Cat.java index 154c1aaeb0a..dee0ca496fe 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Cat.java @@ -15,6 +15,7 @@ */ @Validated + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Category.java index a7cfd551750..ab41411820a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Category.java @@ -14,6 +14,7 @@ */ @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ClassModel.java index 86029cf9bdd..fe5b53552f3 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ClassModel.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model with \"_class\" property") @Validated + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Client.java index 82e3f9f1116..b7635ab990d 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Client.java @@ -14,6 +14,7 @@ */ @Validated + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Dog.java index 17f1d070eba..2e350414e99 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Dog.java @@ -15,6 +15,7 @@ */ @Validated + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumArrays.java index d0ab7afca56..e587b289bc2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumArrays.java @@ -17,6 +17,7 @@ */ @Validated + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumTest.java index 20e909431af..a63c093c979 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/EnumTest.java @@ -16,6 +16,7 @@ */ @Validated + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/FormatTest.java index 99ad7deb9cf..c3034f4c145 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/FormatTest.java @@ -18,6 +18,7 @@ */ @Validated + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/HasOnlyReadOnly.java index 23bc93bfdce..5eefe20921a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ */ @Validated + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Ints.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..b8a3f1f6906 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Ints.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MapTest.java index 556cb7c33c5..99281e81e6a 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MapTest.java @@ -18,6 +18,7 @@ */ @Validated + public class MapTest { @JsonProperty("map_map_of_string") @Valid diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 50330e80d5c..734f96dad9b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ */ @Validated + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Model200Response.java index a8b496debb4..93ea58fc31f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Model200Response.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name starting with number") @Validated + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelApiResponse.java index bb4d933a852..096400f9c60 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelApiResponse.java @@ -14,6 +14,7 @@ */ @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..43a98b33cbf --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,43 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelList.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..1ca8137c702 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelList.java @@ -0,0 +1,81 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * ModelList + */ +@Validated + + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + + + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelReturn.java index 2f85fcb8a07..cfc5bb6d34e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ModelReturn.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing reserved words") @Validated + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Name.java index 26361ad7cb0..a06d6ed2db9 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Name.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name same as property name") @Validated + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/NumberOnly.java index 23120f3d823..dfa49f5dc20 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/NumberOnly.java @@ -15,6 +15,7 @@ */ @Validated + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Numbers.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..0903cc7a770 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Numbers.java @@ -0,0 +1,48 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Order.java index b8a2a2c46e4..f1001b18b91 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Order.java @@ -16,6 +16,7 @@ */ @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/OuterComposite.java index 6786a2eac48..5f7669c5b39 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/OuterComposite.java @@ -15,6 +15,7 @@ */ @Validated + public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Pet.java index 1c769b0939e..98fcc9d1bfd 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Pet.java @@ -19,6 +19,7 @@ */ @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ReadOnlyFirst.java index 475f63e8731..01be7b80359 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ */ @Validated + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/SpecialModelName.java index 1a4f1acd512..e5786704f09 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/SpecialModelName.java @@ -14,6 +14,7 @@ */ @Validated + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Tag.java index 73a7d36cf4d..954576c549b 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/Tag.java @@ -14,6 +14,7 @@ */ @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/User.java index 658e823c5a5..307edbaed10 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/io/swagger/model/User.java @@ -14,6 +14,7 @@ */ @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-delegate-j8/pom.xml b/samples/server/petstore/springboot-delegate-j8/pom.xml index 31223107aff..5bf29c050eb 100644 --- a/samples/server/petstore/springboot-delegate-j8/pom.xml +++ b/samples/server/petstore/springboot-delegate-j8/pom.xml @@ -56,7 +56,7 @@ com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.10.1 + 2.11.4 diff --git a/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen/VERSION b/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen/VERSION +++ b/samples/server/petstore/springboot-implicitHeaders/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java index 25ea6fd70ac..45f5b70b182 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "another-fake", description = "the another-fake API") @RequestMapping(value = "/v2") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java index 9c9e052914d..1571aa25843 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -27,6 +27,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake", description = "the fake API") @RequestMapping(value = "/v2") public interface FakeApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java index 6658851e260..a3954660a3e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @RequestMapping(value = "/v2") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java index 930e16e0f08..1ffabe3201a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -161,6 +162,6 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file); } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java index d44d1711cbc..3e574605906 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/PetApiController.java @@ -127,7 +127,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java index c077b1b9174..f8149ea57a1 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java index 52fd3f41bd9..7198a98a076 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 05680ef71de..983560d4f80 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -17,6 +17,7 @@ */ @Validated + public class AdditionalPropertiesClass { @JsonProperty("map_property") @Valid diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java index c044d494a42..a96ec17c98d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Animal.java @@ -15,12 +15,14 @@ * Animal */ @Validated + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), }) + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java index be9c113dd57..adf707bfa8f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ */ @Validated + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 814fb690acd..74e17d165ab 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 99c91d44a01..6fc5f8ebd94 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java index 753132b708b..c6f81ceb09f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ArrayTest.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayTest { @JsonProperty("array_of_string") @Valid diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java index d2451af8b9f..2dbe6d262a2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Capitalization.java @@ -14,6 +14,7 @@ */ @Validated + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java index 154c1aaeb0a..dee0ca496fe 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Cat.java @@ -15,6 +15,7 @@ */ @Validated + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java index a7cfd551750..ab41411820a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Category.java @@ -14,6 +14,7 @@ */ @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java index 86029cf9bdd..fe5b53552f3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ClassModel.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model with \"_class\" property") @Validated + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java index 82e3f9f1116..b7635ab990d 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Client.java @@ -14,6 +14,7 @@ */ @Validated + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java index 17f1d070eba..2e350414e99 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Dog.java @@ -15,6 +15,7 @@ */ @Validated + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java index d0ab7afca56..e587b289bc2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumArrays.java @@ -17,6 +17,7 @@ */ @Validated + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java index 20e909431af..a63c093c979 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/EnumTest.java @@ -16,6 +16,7 @@ */ @Validated + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java index 99ad7deb9cf..c3034f4c145 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/FormatTest.java @@ -18,6 +18,7 @@ */ @Validated + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java index 23bc93bfdce..5eefe20921a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ */ @Validated + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Ints.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..b8a3f1f6906 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Ints.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java index 556cb7c33c5..99281e81e6a 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MapTest.java @@ -18,6 +18,7 @@ */ @Validated + public class MapTest { @JsonProperty("map_map_of_string") @Valid diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 50330e80d5c..734f96dad9b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ */ @Validated + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java index a8b496debb4..93ea58fc31f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Model200Response.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name starting with number") @Validated + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java index bb4d933a852..096400f9c60 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelApiResponse.java @@ -14,6 +14,7 @@ */ @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..43a98b33cbf --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,43 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelList.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..1ca8137c702 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelList.java @@ -0,0 +1,81 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * ModelList + */ +@Validated + + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + + + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java index 2f85fcb8a07..cfc5bb6d34e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ModelReturn.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing reserved words") @Validated + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java index 26361ad7cb0..a06d6ed2db9 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Name.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name same as property name") @Validated + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java index 23120f3d823..dfa49f5dc20 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/NumberOnly.java @@ -15,6 +15,7 @@ */ @Validated + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Numbers.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..0903cc7a770 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Numbers.java @@ -0,0 +1,48 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java index b8a2a2c46e4..f1001b18b91 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Order.java @@ -16,6 +16,7 @@ */ @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterComposite.java index 6786a2eac48..5f7669c5b39 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/OuterComposite.java @@ -15,6 +15,7 @@ */ @Validated + public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java index 1c769b0939e..98fcc9d1bfd 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Pet.java @@ -19,6 +19,7 @@ */ @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java index 475f63e8731..01be7b80359 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ */ @Validated + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java index 1a4f1acd512..e5786704f09 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/SpecialModelName.java @@ -14,6 +14,7 @@ */ @Validated + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java index 73a7d36cf4d..954576c549b 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/Tag.java @@ -14,6 +14,7 @@ */ @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java index 658e823c5a5..307edbaed10 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/io/swagger/model/User.java @@ -14,6 +14,7 @@ */ @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-useoptional/.swagger-codegen/VERSION b/samples/server/petstore/springboot-useoptional/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/springboot-useoptional/.swagger-codegen/VERSION +++ b/samples/server/petstore/springboot-useoptional/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java index 99e7e5604eb..cb9854703f1 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "another-fake", description = "the another-fake API") @RequestMapping(value = "/v2") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java index 4f8497704ee..82a6949e848 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -28,6 +28,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "fake", description = "the fake API") @RequestMapping(value = "/v2") public interface FakeApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java index f95d1f17d15..1940e038cb9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @RequestMapping(value = "/v2") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java index b63445e42bc..ca8b7ff889d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -25,6 +25,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -145,6 +146,6 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file); } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApiController.java index 27c7817e114..492bb35f275 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/PetApiController.java @@ -128,7 +128,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java index d78dcc63a17..7342bfd2d31 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java index af1cb2d4c54..6349dc879c9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import java.util.List; import java.util.Optional; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 05680ef71de..983560d4f80 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -17,6 +17,7 @@ */ @Validated + public class AdditionalPropertiesClass { @JsonProperty("map_property") @Valid diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Animal.java index c044d494a42..a96ec17c98d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Animal.java @@ -15,12 +15,14 @@ * Animal */ @Validated + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), }) + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AnimalFarm.java index be9c113dd57..adf707bfa8f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ */ @Validated + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 814fb690acd..74e17d165ab 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 99c91d44a01..6fc5f8ebd94 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayTest.java index 753132b708b..c6f81ceb09f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ArrayTest.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayTest { @JsonProperty("array_of_string") @Valid diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Capitalization.java index d2451af8b9f..2dbe6d262a2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Capitalization.java @@ -14,6 +14,7 @@ */ @Validated + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Cat.java index 154c1aaeb0a..dee0ca496fe 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Cat.java @@ -15,6 +15,7 @@ */ @Validated + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Category.java index a7cfd551750..ab41411820a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Category.java @@ -14,6 +14,7 @@ */ @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ClassModel.java index 86029cf9bdd..fe5b53552f3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ClassModel.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model with \"_class\" property") @Validated + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Client.java index 82e3f9f1116..b7635ab990d 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Client.java @@ -14,6 +14,7 @@ */ @Validated + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Dog.java index 17f1d070eba..2e350414e99 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Dog.java @@ -15,6 +15,7 @@ */ @Validated + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumArrays.java index d0ab7afca56..e587b289bc2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumArrays.java @@ -17,6 +17,7 @@ */ @Validated + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumTest.java index 20e909431af..a63c093c979 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/EnumTest.java @@ -16,6 +16,7 @@ */ @Validated + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/FormatTest.java index 99ad7deb9cf..c3034f4c145 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/FormatTest.java @@ -18,6 +18,7 @@ */ @Validated + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/HasOnlyReadOnly.java index 23bc93bfdce..5eefe20921a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ */ @Validated + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Ints.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..b8a3f1f6906 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Ints.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MapTest.java index 556cb7c33c5..99281e81e6a 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MapTest.java @@ -18,6 +18,7 @@ */ @Validated + public class MapTest { @JsonProperty("map_map_of_string") @Valid diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 50330e80d5c..734f96dad9b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ */ @Validated + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Model200Response.java index a8b496debb4..93ea58fc31f 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Model200Response.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name starting with number") @Validated + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelApiResponse.java index bb4d933a852..096400f9c60 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelApiResponse.java @@ -14,6 +14,7 @@ */ @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..43a98b33cbf --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,43 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelList.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..1ca8137c702 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelList.java @@ -0,0 +1,81 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * ModelList + */ +@Validated + + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + + + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelReturn.java index 2f85fcb8a07..cfc5bb6d34e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ModelReturn.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing reserved words") @Validated + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Name.java index 26361ad7cb0..a06d6ed2db9 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Name.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name same as property name") @Validated + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/NumberOnly.java index 23120f3d823..dfa49f5dc20 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/NumberOnly.java @@ -15,6 +15,7 @@ */ @Validated + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Numbers.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..0903cc7a770 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Numbers.java @@ -0,0 +1,48 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Order.java index b8a2a2c46e4..f1001b18b91 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Order.java @@ -16,6 +16,7 @@ */ @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/OuterComposite.java index 6786a2eac48..5f7669c5b39 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/OuterComposite.java @@ -15,6 +15,7 @@ */ @Validated + public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Pet.java index 1c769b0939e..98fcc9d1bfd 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Pet.java @@ -19,6 +19,7 @@ */ @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ReadOnlyFirst.java index 475f63e8731..01be7b80359 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ */ @Validated + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/SpecialModelName.java index 1a4f1acd512..e5786704f09 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/SpecialModelName.java @@ -14,6 +14,7 @@ */ @Validated + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Tag.java index 73a7d36cf4d..954576c549b 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/Tag.java @@ -14,6 +14,7 @@ */ @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/User.java index 658e823c5a5..307edbaed10 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/io/swagger/model/User.java @@ -14,6 +14,7 @@ */ @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot/.swagger-codegen/VERSION b/samples/server/petstore/springboot/.swagger-codegen/VERSION index 52f864c9d49..8c7754221a4 100644 --- a/samples/server/petstore/springboot/.swagger-codegen/VERSION +++ b/samples/server/petstore/springboot/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.10-SNAPSHOT \ No newline at end of file +2.4.19-SNAPSHOT \ No newline at end of file diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java index 7f51d10659a..c36082e74de 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/AnotherFakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "another-fake", description = "the another-fake API") @RequestMapping(value = "/v2") public interface AnotherFakeApi { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java index d2c055f0419..e8601bb5c8c 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -27,6 +27,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake", description = "the fake API") @RequestMapping(value = "/v2") public interface FakeApi { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java index e0c678cbf01..638dd3ce8da 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/FakeClassnameTestApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -22,6 +22,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "fake_classname_test", description = "the fake_classname_test API") @RequestMapping(value = "/v2") public interface FakeClassnameTestApi { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java index 57a7e62d56c..40770cfdabe 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -24,6 +24,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "pet", description = "the pet API") @RequestMapping(value = "/v2") public interface PetApi { @@ -144,6 +145,6 @@ public interface PetApi { produces = { "application/json" }, consumes = { "multipart/form-data" }, method = RequestMethod.POST) - ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file); + ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file); } diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java index f36f2a8d741..3cc1a636e5f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/PetApiController.java @@ -127,7 +127,7 @@ public ResponseEntity updatePetWithForm(@ApiParam(value = "ID of pet that return new ResponseEntity(HttpStatus.NOT_IMPLEMENTED); } - public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file detail") @Valid @RequestPart("file") MultipartFile file) { + public ResponseEntity uploadFile(@ApiParam(value = "ID of pet to update",required=true) @PathVariable("petId") Long petId,@ApiParam(value = "Additional data to pass to server") @RequestParam(value="additionalMetadata", required=false) String additionalMetadata,@ApiParam(value = "file to upload") @Valid @RequestPart(value="file", required=false) MultipartFile file) { String accept = request.getHeader("Accept"); if (accept != null && accept.contains("application/json")) { try { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java index 57029dce674..0cad10d07b0 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/StoreApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "store", description = "the store API") @RequestMapping(value = "/v2") public interface StoreApi { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java index 4bcc24002cd..e3e3241789f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/api/UserApi.java @@ -1,5 +1,5 @@ /** - * NOTE: This class is auto generated by the swagger code generator program (2.4.10-SNAPSHOT). + * NOTE: This class is auto generated by the swagger code generator program (2.4.19-SNAPSHOT). * https://github.com/swagger-api/swagger-codegen * Do not edit the class manually. */ @@ -23,6 +23,7 @@ import javax.validation.constraints.*; import java.util.List; +@Validated @Api(value = "user", description = "the user API") @RequestMapping(value = "/v2") public interface UserApi { diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java index 05680ef71de..983560d4f80 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/AdditionalPropertiesClass.java @@ -17,6 +17,7 @@ */ @Validated + public class AdditionalPropertiesClass { @JsonProperty("map_property") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Animal.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Animal.java index c044d494a42..a96ec17c98d 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Animal.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Animal.java @@ -15,12 +15,14 @@ * Animal */ @Validated + @JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true ) @JsonSubTypes({ @JsonSubTypes.Type(value = Dog.class, name = "Dog"), @JsonSubTypes.Type(value = Cat.class, name = "Cat"), }) + public class Animal { @JsonProperty("className") private String className = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/AnimalFarm.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/AnimalFarm.java index be9c113dd57..adf707bfa8f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/AnimalFarm.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/AnimalFarm.java @@ -13,6 +13,7 @@ */ @Validated + public class AnimalFarm extends ArrayList { @Override diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java index 814fb690acd..74e17d165ab 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java index 99c91d44a01..6fc5f8ebd94 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayOfNumberOnly.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java index 753132b708b..c6f81ceb09f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ArrayTest.java @@ -17,6 +17,7 @@ */ @Validated + public class ArrayTest { @JsonProperty("array_of_string") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java index d2451af8b9f..2dbe6d262a2 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Capitalization.java @@ -14,6 +14,7 @@ */ @Validated + public class Capitalization { @JsonProperty("smallCamel") private String smallCamel = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Cat.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Cat.java index 154c1aaeb0a..dee0ca496fe 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Cat.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Cat.java @@ -15,6 +15,7 @@ */ @Validated + public class Cat extends Animal { @JsonProperty("declawed") private Boolean declawed = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Category.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Category.java index a7cfd551750..ab41411820a 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Category.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Category.java @@ -14,6 +14,7 @@ */ @Validated + public class Category { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ClassModel.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ClassModel.java index 86029cf9bdd..fe5b53552f3 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ClassModel.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ClassModel.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model with \"_class\" property") @Validated + public class ClassModel { @JsonProperty("_class") private String propertyClass = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Client.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Client.java index 82e3f9f1116..b7635ab990d 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Client.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Client.java @@ -14,6 +14,7 @@ */ @Validated + public class Client { @JsonProperty("client") private String client = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Dog.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Dog.java index 17f1d070eba..2e350414e99 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Dog.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Dog.java @@ -15,6 +15,7 @@ */ @Validated + public class Dog extends Animal { @JsonProperty("breed") private String breed = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java index d0ab7afca56..e587b289bc2 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumArrays.java @@ -17,6 +17,7 @@ */ @Validated + public class EnumArrays { /** * Gets or Sets justSymbol diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumTest.java index 20e909431af..a63c093c979 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/EnumTest.java @@ -16,6 +16,7 @@ */ @Validated + public class EnumTest { /** * Gets or Sets enumString diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java index 99ad7deb9cf..c3034f4c145 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/FormatTest.java @@ -18,6 +18,7 @@ */ @Validated + public class FormatTest { @JsonProperty("integer") private Integer integer = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/HasOnlyReadOnly.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/HasOnlyReadOnly.java index 23bc93bfdce..5eefe20921a 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/HasOnlyReadOnly.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/HasOnlyReadOnly.java @@ -14,6 +14,7 @@ */ @Validated + public class HasOnlyReadOnly { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Ints.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Ints.java new file mode 100644 index 00000000000..b8a3f1f6906 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Ints.java @@ -0,0 +1,53 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum Ints { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2), + + NUMBER_3(3), + + NUMBER_4(4), + + NUMBER_5(5), + + NUMBER_6(6); + + private Integer value; + + Ints(Integer value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Ints fromValue(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java index 556cb7c33c5..99281e81e6a 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MapTest.java @@ -18,6 +18,7 @@ */ @Validated + public class MapTest { @JsonProperty("map_map_of_string") @Valid diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java index 50330e80d5c..734f96dad9b 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -20,6 +20,7 @@ */ @Validated + public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("uuid") private UUID uuid = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java index a8b496debb4..93ea58fc31f 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Model200Response.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name starting with number") @Validated + public class Model200Response { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelApiResponse.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelApiResponse.java index bb4d933a852..096400f9c60 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelApiResponse.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelApiResponse.java @@ -14,6 +14,7 @@ */ @Validated + public class ModelApiResponse { @JsonProperty("code") private Integer code = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelBoolean.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelBoolean.java new file mode 100644 index 00000000000..43a98b33cbf --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelBoolean.java @@ -0,0 +1,43 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * True or False indicator + */ +public enum ModelBoolean { + + TRUE(true), + + FALSE(false); + + private Boolean value; + + ModelBoolean(Boolean value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static ModelBoolean fromValue(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelList.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelList.java new file mode 100644 index 00000000000..1ca8137c702 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelList.java @@ -0,0 +1,81 @@ +package io.swagger.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +/** + * ModelList + */ +@Validated + + +public class ModelList { + @JsonProperty("123-list") + private String _123List = null; + + public ModelList _123List(String _123List) { + this._123List = _123List; + return this; + } + + /** + * Get _123List + * @return _123List + **/ + @ApiModelProperty(value = "") + + + public String get123List() { + return _123List; + } + + public void set123List(String _123List) { + this._123List = _123List; + } + + + @Override + public boolean equals(java.lang.Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return Objects.hash(_123List); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ModelList {\n"); + + sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(java.lang.Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelReturn.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelReturn.java index 2f85fcb8a07..cfc5bb6d34e 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelReturn.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ModelReturn.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing reserved words") @Validated + public class ModelReturn { @JsonProperty("return") private Integer _return = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Name.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Name.java index 26361ad7cb0..a06d6ed2db9 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Name.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Name.java @@ -15,6 +15,7 @@ @ApiModel(description = "Model for testing model name same as property name") @Validated + public class Name { @JsonProperty("name") private Integer name = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/NumberOnly.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/NumberOnly.java index 23120f3d823..dfa49f5dc20 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/NumberOnly.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/NumberOnly.java @@ -15,6 +15,7 @@ */ @Validated + public class NumberOnly { @JsonProperty("JustNumber") private BigDecimal justNumber = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Numbers.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Numbers.java new file mode 100644 index 00000000000..0903cc7a770 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Numbers.java @@ -0,0 +1,48 @@ +package io.swagger.model; + +import java.util.Objects; +import io.swagger.annotations.ApiModel; +import java.math.BigDecimal; +import com.fasterxml.jackson.annotation.JsonValue; +import org.springframework.validation.annotation.Validated; +import javax.validation.Valid; +import javax.validation.constraints.*; + +import com.fasterxml.jackson.annotation.JsonCreator; + +/** + * some number + */ +public enum Numbers { + + NUMBER_7(new BigDecimal(7)), + + NUMBER_8(new BigDecimal(8)), + + NUMBER_9(new BigDecimal(9)), + + NUMBER_10(new BigDecimal(10)); + + private BigDecimal value; + + Numbers(BigDecimal value) { + this.value = value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static Numbers fromValue(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java index b8a2a2c46e4..f1001b18b91 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Order.java @@ -16,6 +16,7 @@ */ @Validated + public class Order { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/OuterComposite.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/OuterComposite.java index 6786a2eac48..5f7669c5b39 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/OuterComposite.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/OuterComposite.java @@ -15,6 +15,7 @@ */ @Validated + public class OuterComposite { @JsonProperty("my_number") private BigDecimal myNumber = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java index 1c769b0939e..98fcc9d1bfd 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Pet.java @@ -19,6 +19,7 @@ */ @Validated + public class Pet { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ReadOnlyFirst.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ReadOnlyFirst.java index 475f63e8731..01be7b80359 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/ReadOnlyFirst.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/ReadOnlyFirst.java @@ -14,6 +14,7 @@ */ @Validated + public class ReadOnlyFirst { @JsonProperty("bar") private String bar = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/SpecialModelName.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/SpecialModelName.java index 1a4f1acd512..e5786704f09 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/SpecialModelName.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/SpecialModelName.java @@ -14,6 +14,7 @@ */ @Validated + public class SpecialModelName { @JsonProperty("$special[property.name]") private Long specialPropertyName = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Tag.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Tag.java index 73a7d36cf4d..954576c549b 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/Tag.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/Tag.java @@ -14,6 +14,7 @@ */ @Validated + public class Tag { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/springboot/src/main/java/io/swagger/model/User.java b/samples/server/petstore/springboot/src/main/java/io/swagger/model/User.java index 658e823c5a5..307edbaed10 100644 --- a/samples/server/petstore/springboot/src/main/java/io/swagger/model/User.java +++ b/samples/server/petstore/springboot/src/main/java/io/swagger/model/User.java @@ -14,6 +14,7 @@ */ @Validated + public class User { @JsonProperty("id") private Long id = null; diff --git a/samples/server/petstore/undertow/pom.xml b/samples/server/petstore/undertow/pom.xml index 77f1fe52ad2..e8d2b4600fe 100644 --- a/samples/server/petstore/undertow/pom.xml +++ b/samples/server/petstore/undertow/pom.xml @@ -16,7 +16,7 @@ 1.8 UTF-8 0.1.1 - 2.10.1 + 2.11.4 1.7.21 0.5.2 4.5.3 diff --git a/standalone-gen-dev/docker-entrypoint.sh b/standalone-gen-dev/docker-entrypoint.sh new file mode 100755 index 00000000000..d4a3d407e27 --- /dev/null +++ b/standalone-gen-dev/docker-entrypoint.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# GEN_DIR allows to share the entrypoint between Dockerfile and run-in-docker.sh (backward compatible) +GEN_DIR=${GEN_DIR:-/opt/swagger-codegen} +JAVA_OPTS=${JAVA_OPTS:-"-Xmx1024M -Dlogback.configurationFile=conf/logback.xml"} + +cli="${GEN_DIR}" +codegen2="${cli}/swagger-codegen-cli.jar" + +(cd "${GEN_DIR}" && exec mvn -Duser.home=$(dirname MAVEN_CONFIG) package) +command=$1 +shift +exec java ${JAVA_OPTS} -cp "${codegen2}:${GEN_DIR}/target/*" "io.swagger.codegen.SwaggerCodegen" "${command}" "$@" + diff --git a/standalone-gen-dev/docker-stub.sh b/standalone-gen-dev/docker-stub.sh new file mode 100755 index 00000000000..3a39a9419fb --- /dev/null +++ b/standalone-gen-dev/docker-stub.sh @@ -0,0 +1,10 @@ +#!/bin/sh +set -euo pipefail +# GEN_DIR allows to share the entrypoint between Dockerfile and run-in-docker.sh (backward compatible) +GEN_DIR=${GEN_DIR:-/opt/swagger-codegen} +JAVA_OPTS=${JAVA_OPTS:-"-Xmx1024M -Dlogback.configurationFile=conf/logback.xml"} + +codegen2="${GEN_DIR}/swagger-codegen-cli.jar" + +command=$1 +exec java ${JAVA_OPTS} -jar "${codegen2}" "meta" "$@" diff --git a/standalone-gen-dev/generator-stub-docker.sh b/standalone-gen-dev/generator-stub-docker.sh new file mode 100755 index 00000000000..1abd87117ba --- /dev/null +++ b/standalone-gen-dev/generator-stub-docker.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -exo pipefail + +cd "$(dirname ${BASH_SOURCE})" + +docker run --rm -it \ + -w /gen \ + -e GEN_DIR=/gen \ + -v "${PWD}:/gen" \ + --entrypoint /gen/docker-stub.sh \ + openjdk:8-jre-alpine "$@" diff --git a/standalone-gen-dev/run-in-docker.sh b/standalone-gen-dev/run-in-docker.sh new file mode 100755 index 00000000000..31c47764503 --- /dev/null +++ b/standalone-gen-dev/run-in-docker.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -exo pipefail + +cd "$(dirname ${BASH_SOURCE})" + +maven_cache_repo="${HOME}/.m2/repository" + +mkdir -p "${maven_cache_repo}" + +docker run --rm -it \ + -w /gen \ + -e GEN_DIR=/gen \ + -e MAVEN_CONFIG=/var/maven/.m2 \ + -u "$(id -u):$(id -g)" \ + -v "${PWD}:/gen" \ + -v "${maven_cache_repo}:/var/maven/.m2/repository" \ + --entrypoint /gen/docker-entrypoint.sh \ + maven:3-jdk-8 "$@" diff --git a/standalone-gen-dev/standalone-generator-development.md b/standalone-gen-dev/standalone-generator-development.md new file mode 100644 index 00000000000..04507e83e71 --- /dev/null +++ b/standalone-gen-dev/standalone-generator-development.md @@ -0,0 +1,58 @@ +### Swagger Codegen 2.x Standalone generator development (separate project/repo) + +As described in [Readme](https://github.com/swagger-api/swagger-codegen/tree/master#making-your-own-codegen-modules), +a new generator can be implemented by starting with a project stub generated by the `meta` command of `swagger-codegen-cli`. + +This can be achieved without needing to clone the `swagger-codegen` repo, by downloading and running the jar, e.g.: + +``` +wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.19/swagger-codegen-cli-2.4.19.jar -O swagger-codegen-cli.jar +java -jar swagger-codegen-cli.jar meta -o output/myLibrary -n myClientCodegen -p com.my.company.codegen +``` + +Such generator can be then made available to the CLI by adding it to the classpath, allowing to run/test it via the command line CLI, +add it to the build pipeline and so on, as mentioned in [Readme](https://github.com/swagger-api/swagger-codegen/tree/master#making-your-own-codegen-modules). + + +#### Development in docker + +Similar to what mentioned in Readme [development in docker section](https://github.com/swagger-api/swagger-codegen/tree/master#development-in-docker), a standalone generator can be built and run in docker, without need of a java/maven environment on the local machine. + +Generate the initial project: + +```bash + +# project dir +TARGET_DIR=/tmp/codegen/mygenerator +mkdir -p $TARGET_DIR +cd $TARGET_DIR +# generated code location +GENERATED_CODE_DIR=generated +mkdir -p $GENERATED_CODE_DIR +# download desired version +wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.19/swagger-codegen-cli-2.4.19.jar -O swagger-codegen-cli.jar +wget https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/standalone-gen-dev/docker-stub.sh -O docker-stub.sh +wget https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/standalone-gen-dev/generator-stub-docker.sh -O generator-stub-docker.sh +chmod +x *.sh +# generated initial stub: -p -n +./generator-stub-docker.sh -p io.swagger.codegen.custom -n custom + +``` + +A test definition if we don't have one: + +```bash +wget https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/modules/swagger-codegen/src/test/resources/2_0/petstore.yaml -O petstore.yaml +``` + + +Build the generator and run it against a definition (first time will be slower as it needs to download deps) + +```bash +wget https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/standalone-gen-dev/run-in-docker.sh -O run-in-docker.sh +wget https://raw.githubusercontent.com/swagger-api/swagger-codegen/master/standalone-gen-dev/docker-entrypoint.sh -O docker-entrypoint.sh +chmod +x *.sh +./run-in-docker.sh generate -i petstore.yaml -l custom -o /gen/$GENERATED_CODE_DIR +``` + +