diff --git a/.github/actions/dotnetbuild/action.yml b/.github/actions/dotnetbuild/action.yml new file mode 100644 index 000000000000..8c01e09bcae8 --- /dev/null +++ b/.github/actions/dotnetbuild/action.yml @@ -0,0 +1,33 @@ +name: 'DotNetBuild' +description: 'build dotnet project' +inputs: + path: + description: 'project root path' + required: true + job-name: + description: 'Job name' + 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: | + logfile=${{ inputs.job-name }}.log + echo "::set-output name=logs::$(echo $logfile)" + echo "::set-output name=path::$(echo generated/${{ inputs.job-name }})" + echo -e "\n****** dotnet build ******\n" >> $logfile + curdir=$(pwd) + cd ${{ inputs.path }} + echo -e "\n****** dotnet build ******\n" >> $curdir/$logfile + dotnet restore src/IO.Swagger/ | tee --append $curdir/$logfile + dotnet build src/IO.Swagger/ | tee --append $curdir/$logfile + cd ${curdir} + shell: bash diff --git a/.github/actions/generate/action.yml b/.github/actions/generate/action.yml new file mode 100644 index 000000000000..7de609f95d97 --- /dev/null +++ b/.github/actions/generate/action.yml @@ -0,0 +1,37 @@ +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 + echo "::set-output name=logs::$(echo $logfile)" + chmod +x ${{ github.action_path }}/generate.sh + echo -e "\n****** generate ******\n" > $logfile + ${{ github.action_path }}/generate.sh ${{ inputs.language }} ${{ inputs.job-name }} ${{ inputs.spec-url }} ${{ inputs.options }} >> $logfile + echo "::set-output name=path::$(echo generated/${{ inputs.job-name }})" + shell: bash diff --git a/.github/actions/generate/generate.sh b/.github/actions/generate/generate.sh new file mode 100755 index 000000000000..d4ee6f3ffcbb --- /dev/null +++ b/.github/actions/generate/generate.sh @@ -0,0 +1,41 @@ +#!/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 + + +executable="swagger-codegen-cli.jar" + +LANG=$1 + +JOB_NAME=$2 +if [ -z "$JOB_NAME" ] +then + JOB_NAME=$LANG +fi + +SPEC_URL=$3 +if [[ $SPEC_URL == "null" ]]; +then + SPEC_URL="https://petstore3.swagger.io/api/v3/openapi.json" +fi + +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 000000000000..656e397fa98c --- /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/actions/javabuild/action.yml b/.github/actions/javabuild/action.yml new file mode 100644 index 000000000000..bd8692d8a543 --- /dev/null +++ b/.github/actions/javabuild/action.yml @@ -0,0 +1,31 @@ +name: 'JavaBuild' +description: 'build java with maven' +inputs: + path: + description: 'project root path' + required: true + job-name: + description: 'Job name' + 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: | + logfile=${{ inputs.job-name }}.log + echo "::set-output name=logs::$(echo $logfile)" + echo "::set-output name=path::$(echo generated/${{ inputs.job-name }})" + echo -e "\n****** mvn clean package ******\n" >> $logfile + curdir=$(pwd) + cd ${{ inputs.path }} + mvn clean package | tee --append $curdir/$logfile + cd ${curdir} + shell: bash diff --git a/.github/actions/jsbuild/action.yml b/.github/actions/jsbuild/action.yml new file mode 100644 index 000000000000..fac15387f30b --- /dev/null +++ b/.github/actions/jsbuild/action.yml @@ -0,0 +1,33 @@ +name: 'JsBuild' +description: 'build js with npm' +inputs: + path: + description: 'project root path' + required: true + job-name: + description: 'Job name' + 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: | + logfile=${{ inputs.job-name }}.log + echo "::set-output name=logs::$(echo $logfile)" + echo "::set-output name=path::$(echo generated/${{ inputs.job-name }})" + echo -e "\n****** npm i ******\n" >> $logfile + curdir=$(pwd) + cd ${{ inputs.path }} + npm i 2>&1 | tee --append $curdir/$logfile + echo -e "\n****** npm run test ******\n" >> $curdir/$logfile + npm run test 2>&1 | tee --append $curdir/$logfile + cd ${curdir} + shell: bash diff --git a/.github/actions/pythonbuild/action.yml b/.github/actions/pythonbuild/action.yml new file mode 100644 index 000000000000..70964fe9ceb4 --- /dev/null +++ b/.github/actions/pythonbuild/action.yml @@ -0,0 +1,34 @@ +name: 'Python Build' +description: 'build python project' +inputs: + path: + description: 'project root path' + required: true + job-name: + description: 'Job name' + 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: | + logfile=${{ inputs.job-name }}.log + echo "::set-output name=logs::$(echo $logfile)" + echo "::set-output name=path::$(echo generated/${{ inputs.job-name }})" + echo -e "\n****** python ******\n" >> $logfile + curdir=$(pwd) + cd ${{ inputs.path }} + echo -e "\n****** python setup and build ******\n" >> $curdir/$logfile + python3 setup.py install --user | tee --append $curdir/$logfile + pip3 install nose2 --user + python3 -m nose2 | tee --append $curdir/$logfile + cd ${curdir} + shell: bash diff --git a/.github/workflows/test-framework-dotnet.yml b/.github/workflows/test-framework-dotnet.yml new file mode 100644 index 000000000000..d68157ef9961 --- /dev/null +++ b/.github/workflows/test-framework-dotnet.yml @@ -0,0 +1,158 @@ +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 + +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: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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: $LANGUAGE + job-name: ${JOB_NAME} + spec-url: ${SPEC_URL} + options: $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: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + matrix: + dotnet-version: [3.1.x] + + 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 + - name: Set up DotNet 3.1.x + uses: actions/setup-dotnet@v1 + with: + dotnet-version: ${{ matrix.dotnet-version }} + - name: build + id: build + uses: ./.github/actions/dotnetbuild + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - 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 }} diff --git a/.github/workflows/test-framework-dynamic.yml b/.github/workflows/test-framework-dynamic.yml new file mode 100644 index 000000000000..01cf85a3cfea --- /dev/null +++ b/.github/workflows/test-framework-dynamic.yml @@ -0,0 +1,164 @@ +name: Test Framework Dynamic + +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 + buildAction: + description: 'build action name' + required: true + default: "jsbuild" + +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: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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: $LANGUAGE + job-name: ${JOB_NAME} + options: $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_ACTION: ${{ github.event.inputs.buildAction }} + + build: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + 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 + #path: ${{ env.JOB_NAME }}.build.log + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: build + id: build + uses: ./.github/actions/${{ env.BUILD_ACTION }} + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - 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_ACTION: ${{ github.event.inputs.buildAction }} diff --git a/.github/workflows/test-framework-java.yml b/.github/workflows/test-framework-java.yml new file mode 100644 index 000000000000..ccd0c8bdbfd5 --- /dev/null +++ b/.github/workflows/test-framework-java.yml @@ -0,0 +1,158 @@ +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 + +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: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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: $LANGUAGE + job-name: ${JOB_NAME} + spec-url: ${SPEC_URL} + options: $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: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + matrix: + java-version: [1.8] + + 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 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java-version }} + - name: build + id: build + uses: ./.github/actions/javabuild + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - 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 }} diff --git a/.github/workflows/test-framework-js.yml b/.github/workflows/test-framework-js.yml new file mode 100644 index 000000000000..a6a60557b4df --- /dev/null +++ b/.github/workflows/test-framework-js.yml @@ -0,0 +1,166 @@ +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 + +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: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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: $LANGUAGE + job-name: ${JOB_NAME} + spec-url: ${SPEC_URL} + options: $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: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + 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 + #path: ${{ env.JOB_NAME }}.build.log + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### DYNAMIC: Dependent on build environment + ##### TODO: pass also build buildCommands coming from workflow input steps + ############################################### + - name: build + id: build + uses: ./.github/actions/jsbuild + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - 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 }} diff --git a/.github/workflows/test-framework-matrix.yml b/.github/workflows/test-framework-matrix.yml new file mode 100644 index 000000000000..d0fbfb32c77b --- /dev/null +++ b/.github/workflows/test-framework-matrix.yml @@ -0,0 +1,156 @@ +name: Test Framework Matrix + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "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 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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 a javascript client V3 from petstore3.swagger.io OpenAPI definition + generate-js-v3-petstore: + + needs: build-codegen + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + java: [ 8 ] + url: + - "https://petstore3.swagger.io/api/v3/openapi.json" + - "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" + - "https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-composed-schemas.yaml" + include: + - java: 8 + url: "https://petstore3.swagger.io/api/v3/openapi.json" + specId: "petstore3" + - java: 8 + url: "https://petstore3.swagger.io/api/v3/openapi.json" + specId: "petstorefake" + - java: 8 + url: "https://petstore3.swagger.io/api/v3/openapi.json" + specId: "petstorecomposed" + 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: $LANGUAGE + job-name: ${JOB_NAME} + options: $OPTIONS + spec-url: ${{ matrix['url'] }} + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: generate_logs_${{ env.JOB_NAME }} + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: generated_${{ env.JOB_NAME }} + path: ${{ steps.generate.outputs.path }} + - run: | + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: generate_outcome_${{ env.JOB_NAME }} + path: generate_outcome_${{ env.JOB_NAME }} + env: + LANGUAGE: "javascript" + JOB_NAME: js-petstore-v3${{ matrix['specId'] }} + OPTIONS: " -DappName=PetstoreClient --additional-properties useES6=false" + + build-js-v3-petstore: + + needs: generate-js-v3-petstore + + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + node-version: [12.x] + url: + - "https://petstore3.swagger.io/api/v3/openapi.json" + - "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" + - "https://raw.githubusercontent.com/swagger-api/swagger-codegen/3.0.0/modules/swagger-codegen/src/test/resources/3_0_0/petstore-with-composed-schemas.yaml" + include: + - node-version: 12.x + url: "https://petstore3.swagger.io/api/v3/openapi.json" + specId: "petstore3" + - node-version: 12.x + url: "https://petstore3.swagger.io/api/v3/openapi.json" + specId: "petstorefake" + - node-version: 12.x + url: "https://petstore3.swagger.io/api/v3/openapi.json" + specId: "petstorecomposed" + + + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: generated_${{ env.JOB_NAME }} + # todo replace with job output + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: generate_logs_${{ env.JOB_NAME }} + #path: ${{ env.JOB_NAME }}.build.log + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: jsbuild + id: jsbuild + uses: ./.github/actions/jsbuild + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.jsbuild.outputs.logs }} + path: ${{ steps.jsbuild.outputs.logs }} + env: + JOB_NAME: js-petstore-v3${{ matrix['specId'] }} diff --git a/.github/workflows/test-framework-python.yml b/.github/workflows/test-framework-python.yml new file mode 100644 index 000000000000..911c446090cf --- /dev/null +++ b/.github/workflows/test-framework-python.yml @@ -0,0 +1,158 @@ +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 + +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: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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: $LANGUAGE + job-name: ${JOB_NAME} + spec-url: ${SPEC_URL} + options: $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: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + matrix: + python-version: [3.x] + + 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 + - name: Setup python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: build + id: build + uses: ./.github/actions/pythonbuild + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - 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 }} diff --git a/.github/workflows/test-framework-single.yml b/.github/workflows/test-framework-single.yml new file mode 100644 index 000000000000..9848cb9fece7 --- /dev/null +++ b/.github/workflows/test-framework-single.yml @@ -0,0 +1,165 @@ +name: Test Framework Single + +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 + +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: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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: $LANGUAGE + job-name: ${JOB_NAME} + options: $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: + + needs: generate + if: contains(needs.generate.outputs.generate_outcome, 'success') + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + 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 + #path: ${{ env.JOB_NAME }}.build.log + ############################################### + ##### DYNAMIC: Dependent on build environment + ############################################### + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + ############################################### + ##### DYNAMIC: Dependent on build environment + ##### TODO: pass also build buildCommands coming from workflow input steps + ############################################### + - name: build + id: build + uses: ./.github/actions/jsbuild + continue-on-error: true + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - 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 }} diff --git a/.github/workflows/test-framework.yml b/.github/workflows/test-framework.yml new file mode 100644 index 000000000000..0fc039cdaa3b --- /dev/null +++ b/.github/workflows/test-framework.yml @@ -0,0 +1,125 @@ +name: Test Framework + +on: + # execute on demand + workflow_dispatch: + branches: ["master", "test-framework", "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 + - uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.java }} + - name: build codegen + run: | + mvn -q -B package -DskipTests + - name: prepare codegen cli + run: mkdir codegen-cli && 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 a javascript client V3 from petstore3.swagger.io OpenAPI definition + generate-js-v3-petstore: + + needs: 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: 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: $LANGUAGE + job-name: ${JOB_NAME} + options: $OPTIONS + - name: upload generate logs + uses: actions/upload-artifact@v2 + with: + name: generate_logs_${{ env.JOB_NAME }} + path: ${{ steps.generate.outputs.logs }} + - name: upload generated code + if: contains(steps.generate.outcome, 'success') + uses: actions/upload-artifact@v2 + with: + name: generated_${{ env.JOB_NAME }} + path: ${{ steps.generate.outputs.path }} + - run: | + echo ${{ steps.generate.outcome }} > generate_outcome_${{ env.JOB_NAME }} + - name: upload generate outcome + uses: actions/upload-artifact@v2 + with: + name: generate_outcome_${{ env.JOB_NAME }} + path: generate_outcome_${{ env.JOB_NAME }} + env: + LANGUAGE: "javascript" + JOB_NAME: "js-petstore-v3" + OPTIONS: " -DappName=PetstoreClient --additional-properties useES6=false" + + build-js-v3-petstore: + + needs: generate-js-v3-petstore + + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [12.x] + + steps: + - uses: actions/checkout@v2 + - name: Download artifacts + uses: actions/download-artifact@v2 + with: + name: generated_${{ env.JOB_NAME }} + # todo replace with job output + path: generated/${{ env.JOB_NAME }} + - name: Download logs + uses: actions/download-artifact@v2 + with: + name: generate_logs_${{ env.JOB_NAME }} + #path: ${{ env.JOB_NAME }}.build.log + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - name: jsbuild + id: jsbuild + uses: ./.github/actions/jsbuild + with: + path: generated/${{ env.JOB_NAME }} + job-name: ${{ env.JOB_NAME }} + - name: upload logs + uses: actions/upload-artifact@v2 + with: + name: ${{ steps.jsbuild.outputs.logs }} + path: ${{ steps.jsbuild.outputs.logs }} + env: + JOB_NAME: "js-petstore-v3" diff --git a/.whitesource b/.whitesource new file mode 100644 index 000000000000..db4b0fec82ca --- /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/README.md b/README.md index 7a429b3d7b27..9c4d9f105cda 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.16-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.19-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.22-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.25-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.15 + 2.4.18 ``` ### 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.21 + 3.0.24 ``` @@ -134,8 +134,11 @@ The OpenAPI Specification has undergone 3 revisions since initial creation in 20 Swagger Codegen Version | Release Date | OpenAPI Spec compatibility | Notes -------------------------- | ------------ | -------------------------- | ----- -3.0.22-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.22-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release -[3.0.21](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.21) (**current stable**) | 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.25-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.25-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0, 3.0 | Minor release +[3.0.24](https://github.com/swagger-api/swagger-codegen/releases/tag/v3.0.24) (**current stable**) | 2020-12-29 | 1.0, 1.1, 1.2, 2.0, 3.0 | [tag v3.0.23](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) @@ -156,8 +159,11 @@ 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.16-SNAPSHOT (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.16-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Minor release -[2.4.15](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.15) (**current stable**) | 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.19-SNAPSHOT (current master, upcoming minor release) [SNAPSHOT](https://oss.sonatype.org/content/repositories/snapshots/io/swagger/swagger-codegen-cli/2.4.18-SNAPSHOT/)| TBD | 1.0, 1.1, 1.2, 2.0 | Minor release +[2.4.18](https://github.com/swagger-api/swagger-codegen/releases/tag/v2.4.18) (**current stable**) | 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) @@ -186,17 +192,17 @@ If you're looking for the latest stable version, you can grab it directly from M ```sh # 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.15/swagger-codegen-cli-2.4.15.jar -O swagger-codegen-cli.jar +wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.18/swagger-codegen-cli-2.4.18.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.21/swagger-codegen-cli-3.0.21.jar -O swagger-codegen-cli.jar +wget https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.24/swagger-codegen-cli-3.0.24.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 https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15/swagger-codegen-cli-2.4.15.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.18/swagger-codegen-cli-2.4.18.jar` On a mac, it's even easier with `brew`: ```sh @@ -344,7 +350,7 @@ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate \ ``` (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](https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.15/swagger-codegen-cli-2.4.15.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.18/swagger-codegen-cli-2.4.18.jar) 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)) @@ -640,10 +646,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" } ``` @@ -779,10 +785,10 @@ curl -X POST -H "content-type:application/json" -d '{"swaggerUrl":"https://petst ``` 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": {}, + "options": {}, "swaggerUrl": "https://petstore.swagger.io/v2/swagger.json" } ``` @@ -791,23 +797,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" } } ``` diff --git a/modules/swagger-codegen-cli/pom.xml b/modules/swagger-codegen-cli/pom.xml index 3bf445909bda..2d40fadbb892 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.16-SNAPSHOT + 2.4.19-SNAPSHOT ../.. 4.0.0 diff --git a/modules/swagger-codegen-maven-plugin/examples/java-client.xml b/modules/swagger-codegen-maven-plugin/examples/java-client.xml index 43518b0e009b..16520f1dd03e 100644 --- a/modules/swagger-codegen-maven-plugin/examples/java-client.xml +++ b/modules/swagger-codegen-maven-plugin/examples/java-client.xml @@ -123,6 +123,6 @@ 2.10.1 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 c3803a573060..54e0bb2346b7 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.16-SNAPSHOT + 2.4.19-SNAPSHOT ../.. swagger-codegen-maven-plugin diff --git a/modules/swagger-codegen/pom.xml b/modules/swagger-codegen/pom.xml index b4c3f33faef0..0a5d49a18789 100644 --- a/modules/swagger-codegen/pom.xml +++ b/modules/swagger-codegen/pom.xml @@ -3,7 +3,7 @@ io.swagger swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT ../.. 4.0.0 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 d23c6d9b7472..41a9390f1a28 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 @@ -56,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/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 01f903967db9..74665c0f09de 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 @@ -11,6 +11,7 @@ import java.util.regex.Pattern; import io.swagger.models.properties.UntypedProperty; +import io.swagger.util.Yaml; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringEscapeUtils; import org.apache.commons.lang3.StringUtils; @@ -293,8 +294,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 @@ -347,7 +348,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) + "\""; @@ -374,6 +375,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) { @@ -1500,6 +1507,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) { @@ -1525,6 +1536,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); @@ -2762,6 +2776,7 @@ 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); diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java index ccb51ddc2073..d26987aa4198 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultGenerator.java @@ -261,6 +261,9 @@ protected void configureSwaggerInfo() { if (info.getTermsOfService() != null) { config.additionalProperties().put("termsOfService", config.escapeText(info.getTermsOfService())); } + if (info.getVendorExtensions() != null && !info.getVendorExtensions().isEmpty()) { + config.additionalProperties().put("info-extensions", info.getVendorExtensions()); + } } protected void generateModelTests(List files, Map models, String modelName) throws IOException { @@ -765,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 81917d2221b8..5cac878003a9 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; 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 0f01867c5032..e22833d0f00c 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; @@ -433,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/languages/AbstractJavaCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/AbstractJavaCodegen.java index 6b0e8cf45cee..68ce5b27feb2 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 @@ -11,6 +11,8 @@ import java.util.regex.Pattern; import io.swagger.codegen.languages.features.NotNullAnnotationFeatures; +import io.swagger.models.RefModel; +import io.swagger.models.properties.RefProperty; import org.apache.commons.lang3.BooleanUtils; import org.apache.commons.lang3.StringUtils; @@ -58,6 +60,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code 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"; protected String dateLibrary = "threetenbp"; protected boolean supportAsync = false; @@ -119,7 +122,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") ); @@ -187,6 +190,7 @@ public AbstractJavaCodegen() { cliOptions.add(java8Mode); 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)")); } @Override @@ -1042,6 +1046,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){ @@ -1099,6 +1107,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) { @@ -1126,8 +1212,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_"); @@ -1146,7 +1231,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 @@ -1154,6 +1239,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) + "\""; } 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 048fd022903d..5ea16e5a7f4e 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/GoServerCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/GoServerCodegen.java index 58f621ae3db7..aa88c6263da2 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/JavascriptClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/JavascriptClientCodegen.java index 3bba10e882f9..fb2dd0243afc 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"); @@ -1412,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/TypeScriptAngularClientCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/languages/TypeScriptAngularClientCodegen.java index 24007199db1f..c1666a805aa8 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 @@ -136,6 +136,7 @@ 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")); } 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 a00979fbd73c..fea6862b58a5 100644 --- a/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/build.gradle.mustache @@ -120,10 +120,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "{{^threetenbp}}2.10.1{{/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/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/feign/pom.mustache index 522dad9d89a9..ff452b927562 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 @@ -294,14 +294,14 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.4.0 2.1.0 2.10.1 {{#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 32cfca170a70..7dd89765de46 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 @@ -106,11 +106,11 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" 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/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/google-api-client/pom.mustache index b5c019b82cb0..56384c8cdf27 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 @@ -288,12 +288,12 @@ 2.29.1 2.10.1 {{#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/build.gradle.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/jersey2/build.gradle.mustache index d442426ad073..3eb71af377aa 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,7 +105,7 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" {{#supportJava6}} jersey_version = "2.6" 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 7560843591a2..980c5b2364a9 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}} @@ -329,6 +329,6 @@ {{/supportJava6}} {{^threetenbp}}2.10.1{{/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/build.sbt.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/okhttp-gson/build.sbt.mustache index fcf788885d6d..e0c1943e37fd 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 e03d82433481..a36042f1aac5 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 @@ -277,18 +277,18 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${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 54b90483f4cd..cf530e440dab 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 68f3eff08d0e..fab561fe6e7f 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 85d2b88363dd..5606dd82fc72 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 @@ -254,12 +254,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/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/resteasy/pom.mustache index 6603f1d703c2..45839204d272 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.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 9ee9bb42b425..5977526e20a2 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 @@ -106,10 +106,10 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" 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 b304cb5dee87..193057b2e252 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 @@ -290,12 +290,12 @@ 4.3.9.RELEASE 2.10.1 {{#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 b4ceff3aac0d..e26e927efe97 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 @@ -243,12 +243,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 50d6bf27913b..cf7fe35cc267 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,7 +101,7 @@ 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" @@ -112,7 +112,7 @@ ext { 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 c2267623b22c..45ba58b4237d 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,10 +9,10 @@ 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}} @@ -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/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/libraries/retrofit2/pom.mustache index bcbd35981d65..c21402a8bf6f 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 @@ -330,8 +330,8 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.8.0 - 1.5.18 + 1.8.3 + 1.5.24 {{#usePlayWS}} {{#play24}} 2.10.1 @@ -342,7 +342,7 @@ 2.5.15 {{/play25}} {{/usePlayWS}} - 2.3.0 + 2.7.1 {{#useRxJava}} 1.3.0 {{/useRxJava}} @@ -350,12 +350,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 605bb77cee5a..61076a5813bc 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,7 +26,7 @@ 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" vertx_version = "3.4.2" 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 7b873f053511..b41c52b821d7 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 + 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 4b35e990bf7e..5b46f187bb1d 100644 --- a/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/modelEnum.mustache @@ -60,7 +60,7 @@ 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}}; + {{{dataType}}} value = {{#isNumber}}new BigDecimal(jsonReader.nextDouble()){{/isNumber}}{{^isNumber}}jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.fromValue(String.valueOf(value)); } } diff --git a/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache b/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache index c6afaf5a4ca3..e4b04bad9e02 100644 --- a/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/modelInnerEnum.mustache @@ -51,7 +51,7 @@ @Override public {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}} read(final JsonReader jsonReader) throws IOException { - {{{datatype}}} value = jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}next{{{datatype}}}(){{/isInteger}}; + {{{dataType}}} value = {{#isNumber}}new BigDecimal(jsonReader.nextDouble()){{/isNumber}}{{^isNumber}}jsonReader.{{#isInteger}}nextInt(){{/isInteger}}{{^isInteger}}next{{{dataType}}}(){{/isInteger}}{{/isNumber}}; return {{#datatypeWithEnum}}{{{.}}}{{/datatypeWithEnum}}{{^datatypeWithEnum}}{{classname}}{{/datatypeWithEnum}}.fromValue(String.valueOf(value)); } } diff --git a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache index ec08ee907bd1..ff1f2b6b7001 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pojo.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pojo.mustache @@ -3,9 +3,9 @@ */{{#description}} @ApiModel(description = "{{{description}}}"){{/description}} {{>generatedAnnotation}}{{#discriminator}}{{>typeInfoAnnotation}}{{/discriminator}}{{>xmlAnnotation}} - -{{#notNullJacksonAnnotation}}@JsonInclude(JsonInclude.Include.NON_NULL){{/notNullJacksonAnnotation}} - +{{#notNullJacksonAnnotation}} +@JsonInclude(JsonInclude.Include.NON_NULL) +{{/notNullJacksonAnnotation}} 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; diff --git a/modules/swagger-codegen/src/main/resources/Java/pom.mustache b/modules/swagger-codegen/src/main/resources/Java/pom.mustache index 58b8d4bce2b7..623eaba6d562 100644 --- a/modules/swagger-codegen/src/main/resources/Java/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/Java/pom.mustache @@ -331,6 +331,6 @@ {{/supportJava6}} {{^threetenbp}}2.10.1{{/threetenbp}}{{#threetenbp}}2.6.4{{/threetenbp}} 1.0.0 - 4.12 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/beanValidation.mustache index c8c6946fef66..7c347758d8db 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 c8c6946fef66..7c347758d8db 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/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache index 8d576a69321a..622a71732014 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/cxf/pom.mustache @@ -189,9 +189,9 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${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}} 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 fb8fa1d30d5c..96f8670ad35a 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 @@ -240,9 +240,9 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${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}} 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 43196ada063c..00f915c8daa7 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 @@ -190,12 +190,12 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 1.19.1 2.10.1 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 1d4785dda12b..fce25592536f 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/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache index 1659b8865fe0..ac8e9530dc13 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/pom.mustache @@ -196,7 +196,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 9.3.27.v20190418 2.22.2 2.10.1 @@ -204,7 +204,7 @@ 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/eap/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/eap/pom.mustache index 79caaf936333..adbfb207fed8 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 @@ -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/pom.mustache b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache index a94e3ad88cba..23c8a2b9c4b0 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/resteasy/pom.mustache @@ -190,11 +190,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 2.10.1 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 b0316d58730d..2ee0877f3715 100644 --- a/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaJaxRS/spec/pom.mustache @@ -85,6 +85,6 @@ {{/useBeanValidation}} - 4.8.1 + 4.13.1 diff --git a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache index 557fa5b701b7..0fa5c0056c62 100644 --- a/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache +++ b/modules/swagger-codegen/src/main/resources/JavaSpring/api.mustache @@ -52,6 +52,9 @@ import java.util.Optional; import java.util.concurrent.{{^jdk8}}Callable{{/jdk8}}{{#jdk8}}CompletableFuture{{/jdk8}}; {{/async}} {{>generatedAnnotation}} +{{#useBeanValidation}} +@Validated +{{/useBeanValidation}} @Api(value = "{{{baseName}}}", description = "the {{{baseName}}} API") {{#operations}} @RequestMapping(value = "{{{contextPath}}}") 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 93c1b06b3fab..57116134cc3f 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 @@ -9,7 +9,7 @@ {{#java8}}1.8{{/java8}}{{^java8}}1.7{{/java8}} ${java.version} ${java.version} - 1.5.18 + 1.5.24 org.springframework.boot 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 f88621e05978..05b160fd4c61 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 @@ -201,7 +201,7 @@ ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 2.10.1 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 11385bd3cbfa..97e007fe22ca 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/MSF4J/pom.mustache b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache index 579446b86fa6..0906287c179c 100644 --- a/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache +++ b/modules/swagger-codegen/src/main/resources/MSF4J/pom.mustache @@ -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 de1ee61bf6ae..190e36bdf0e1 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/Solution.mustache b/modules/swagger-codegen/src/main/resources/aspnetcore/Solution.mustache index 80e5f6521018..8c6d69ea93da 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/codegen/pom.mustache b/modules/swagger-codegen/src/main/resources/codegen/pom.mustache index 2d01469c9863..37cf7df17053 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/dart/class.mustache b/modules/swagger-codegen/src/main/resources/dart/class.mustache index 930bf61d2d82..f940c6248219 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/go-server/Dockerfile b/modules/swagger-codegen/src/main/resources/go-server/Dockerfile new file mode 100644 index 000000000000..36e3f7ce2aa9 --- /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/api.mustache b/modules/swagger-codegen/src/main/resources/go/api.mustache index 4d6b97202b35..e7f3c36c6a0c 100644 --- a/modules/swagger-codegen/src/main/resources/go/api.mustache +++ b/modules/swagger-codegen/src/main/resources/go/api.mustache @@ -21,7 +21,7 @@ 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(). @@ -235,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}} @@ -263,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/python/api.mustache b/modules/swagger-codegen/src/main/resources/python/api.mustache index 89fcc0c82fc6..20db06822a1e 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 5decd411e1d3..bf0350b4ce03 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: diff --git a/modules/swagger-codegen/src/main/resources/python/configuration.mustache b/modules/swagger-codegen/src/main/resources/python/configuration.mustache index a2838d338e69..e76b93d69984 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 9b647633f552..c7686b57042b 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/scala/pom.mustache b/modules/swagger-codegen/src/main/resources/scala/pom.mustache index 5cfa0e2f1986..14eea6ed272c 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/typescript-angular/api.module.mustache b/modules/swagger-codegen/src/main/resources/typescript-angular/api.module.mustache index 06dad036e629..2953814b3c02 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-fetch/package.mustache b/modules/swagger-codegen/src/main/resources/typescript-fetch/package.mustache index 1eae586cf426..a7b5cbae4ddb 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/test/java/io/swagger/codegen/DefaultGeneratorTest.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/DefaultGeneratorTest.java index 9ef7b9d95ac1..c4df4726b25b 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; @@ -426,8 +427,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()); @@ -444,8 +447,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 5f5a3e644a32..9e927f0f0ad4 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; @@ -351,11 +355,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 5ac5f7885909..cb541fe286c2 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/options/JavaOptionsProvider.java b/modules/swagger-codegen/src/test/java/io/swagger/codegen/options/JavaOptionsProvider.java index f870adef42f8..fc2114fdb4d8 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 @@ -74,6 +74,7 @@ public JavaOptionsProvider() { .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") .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 a36534cf083f..51cde1f6916d 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 @@ -87,13 +87,13 @@ public Map createOptions() { .put(CodegenConstants.SERIALIZE_BIG_DECIMAL_AS_STRING, "true") .put(JavaClientCodegen.JAVA8_MODE, JAVA8_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"); return builder.build(); } 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 000000000000..1464b200d24f --- /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 5c19544ca983..179de245c0a5 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/templates/Java/libraries/jersey2/pom.mustache b/modules/swagger-codegen/src/test/resources/2_0/templates/Java/libraries/jersey2/pom.mustache index 98a0e9473a8a..a3d4b1083a60 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 def45f58f3e4..626e98eff8c8 100644 --- a/modules/swagger-generator/pom.xml +++ b/modules/swagger-generator/pom.xml @@ -4,7 +4,7 @@ io.swagger swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-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/pom.xml b/pom.xml index 692dd7acb3c5..253247cf5110 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -849,13 +849,10 @@ samples/client/petstore/python-asyncio samples/client/petstore/typescript-fetch/builds/default samples/client/petstore/typescript-fetch/builds/es6-target - + samples/client/petstore/typescript-node/npm @@ -943,13 +940,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 - 1.6.1 + 1.6.2 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/pom.xml.bash b/pom.xml.bash index 7fa6e1f7e194..da6f8122aab2 100644 --- a/pom.xml.bash +++ b/pom.xml.bash @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -914,13 +914,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 1.6.1 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/pom.xml.circleci b/pom.xml.circleci index d6599eeac1e2..cdb81e4813a2 100644 --- a/pom.xml.circleci +++ b/pom.xml.circleci @@ -10,7 +10,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -962,13 +962,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 1.6.1 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/pom.xml.circleci.java7 b/pom.xml.circleci.java7 index 7e11271659eb..1fc73dd17f61 100644 --- a/pom.xml.circleci.java7 +++ b/pom.xml.circleci.java7 @@ -10,7 +10,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -944,13 +944,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 1.6.1 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/pom.xml.ios b/pom.xml.ios index 20ee7fc7f6c0..0380e8c672c2 100644 --- a/pom.xml.ios +++ b/pom.xml.ios @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -922,13 +922,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 1.6.1 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/pom.xml.jenkins b/pom.xml.jenkins index d0ffde9b7796..c3340def001f 100644 --- a/pom.xml.jenkins +++ b/pom.xml.jenkins @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -1004,13 +1004,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 1.6.1 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/pom.xml.jenkins.java7 b/pom.xml.jenkins.java7 index 26496dae251c..e341b65fbcc2 100644 --- a/pom.xml.jenkins.java7 +++ b/pom.xml.jenkins.java7 @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -926,13 +926,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 1.6.1 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/pom.xml.travis b/pom.xml.travis index 692dd7acb3c5..2a462874546c 100644 --- a/pom.xml.travis +++ b/pom.xml.travis @@ -9,7 +9,7 @@ swagger-codegen-project pom swagger-codegen-project - 2.4.16-SNAPSHOT + 2.4.19-SNAPSHOT https://github.com/swagger-api/swagger-codegen scm:git:git@github.com:swagger-api/swagger-codegen.git @@ -943,13 +943,13 @@ - 1.0.51 + 1.0.54 2.11.1 3.3.0 1.6.1 2.4 1.2 - 4.8.1 + 4.13.1 2.10.1 1.0.0 3.4 diff --git a/samples/client/petstore-security-test/go/.swagger-codegen/VERSION b/samples/client/petstore-security-test/go/.swagger-codegen/VERSION index a6254504e401..0443c4ad0988 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.16-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 81d2ac1b8bb6..7f3a6a8b40f0 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,10 +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 index a19200a1fac0..a4c4305eac15 100644 --- a/samples/client/petstore-security-test/go/api_fake.go +++ b/samples/client/petstore-security-test/go/api_fake.go @@ -1,3 +1,4 @@ + /* * Swagger Petstore *_/ ' \" =end -- \\r\\n \\n \\r * @@ -26,20 +27,20 @@ var ( 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 *TestCodeInjectEndRnNROpts - Optional Parameters: + * @param optional nil or *FakeApiTestCodeInjectEndRnNROpts - Optional Parameters: * @param "TestCodeInjectEndRnNR" (optional.String) - To test code injection *_/ ' \" =end -- \\r\\n \\n \\r */ -type TestCodeInjectEndRnNROpts struct { +type FakeApiTestCodeInjectEndRnNROpts struct { TestCodeInjectEndRnNR optional.String } -func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOptionals *TestCodeInjectEndRnNROpts) (*http.Response, error) { +func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOptionals *FakeApiTestCodeInjectEndRnNROpts) (*http.Response, error) { var ( localVarHttpMethod = strings.ToUpper("Put") localVarPostBody interface{} @@ -103,3 +104,4 @@ func (a *FakeApiService) TestCodeInjectEndRnNR(ctx context.Context, localVarOpti return localVarHttpResponse, nil } + diff --git a/samples/client/petstore-security-test/go/client.go b/samples/client/petstore-security-test/go/client.go index ceacaa4445ab..938472e6f59c 100644 --- a/samples/client/petstore-security-test/go/client.go +++ b/samples/client/petstore-security-test/go/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 *_/ ' \" =end -- \\r\\n \\n \\r API v1.0.0 *_/ ' \" =end -- \\r\\n \\n \\r diff --git a/samples/client/petstore-security-test/go/docs/FakeApi.md b/samples/client/petstore-security-test/go/docs/FakeApi.md index 1d7dea697cc3..6444f27fde82 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/java/okhttp-gson/build.sbt b/samples/client/petstore-security-test/java/okhttp-gson/build.sbt index 03c3ac9e2316..890cd8a61ac0 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 9fbc7d0e39d5..f9fa294387fc 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/scala/pom.xml b/samples/client/petstore-security-test/scala/pom.xml index dc83c2362514..934e163b5a5b 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/android/httpclient/pom.xml b/samples/client/petstore/android/httpclient/pom.xml index 0ec1b68e2e0f..236b87b02f9a 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/dart/flutter_petstore/swagger/.swagger-codegen/VERSION b/samples/client/petstore/dart/flutter_petstore/swagger/.swagger-codegen/VERSION index 017674fb59d7..52f864c9d496 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 c30804fa2c0e..f17f838b90ca 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 017674fb59d7..52f864c9d496 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 c30804fa2c0e..f17f838b90ca 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 017674fb59d7..52f864c9d496 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 c30804fa2c0e..f17f838b90ca 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 6cecc1a68f36..0443c4ad0988 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.6-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 d3d111dda499..dc14850d4b02 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 d8749671bcb8..35a552740056 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: @@ -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" @@ -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" 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 e5a0fb71ea32..89e7e97727bc 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 @@ -26,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(). @@ -88,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 { @@ -115,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 fc269978e180..b4ed102daf4f 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_fake.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_fake.go @@ -27,7 +27,7 @@ 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(). @@ -102,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 { @@ -130,7 +128,7 @@ 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(). @@ -205,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 { @@ -233,7 +229,7 @@ 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(). @@ -308,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 { @@ -336,7 +330,7 @@ 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(). @@ -411,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 { @@ -439,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 @@ -512,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(). @@ -574,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 { @@ -602,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(). @@ -746,7 +736,7 @@ 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(). @@ -860,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(). @@ -932,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(). @@ -1004,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 d3cffa7e9171..6dc2f67b0a39 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 @@ -26,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(). @@ -101,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 { @@ -128,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 631ad3eaccf0..1d1fd3cfb5d8 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_pet.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_pet.go @@ -29,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(). @@ -101,7 +101,7 @@ 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(). @@ -182,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(). @@ -243,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 { @@ -271,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(). @@ -332,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 { @@ -360,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(). @@ -434,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 { @@ -462,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(). @@ -534,7 +528,7 @@ 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(). @@ -620,7 +614,7 @@ 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(). @@ -674,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) @@ -707,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 { @@ -734,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 400765f4981f..92e538eddffc 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_store.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_store.go @@ -27,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(). @@ -98,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(). @@ -170,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 { @@ -198,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(). @@ -265,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 { @@ -293,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(). @@ -355,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 { @@ -382,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 9f11693bfc4d..a80240c9ca3e 100644 --- a/samples/client/petstore/go/go-petstore-withXml/api_user.go +++ b/samples/client/petstore/go/go-petstore-withXml/api_user.go @@ -27,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(). @@ -99,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(). @@ -171,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(). @@ -243,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(). @@ -314,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(). @@ -375,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 { @@ -403,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(). @@ -466,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 { @@ -494,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(). @@ -563,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(). @@ -636,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 3c9aacc301ca..4c15f024f11c 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/.swagger-codegen/VERSION b/samples/client/petstore/go/go-petstore/.swagger-codegen/VERSION index be9d3ebd547f..0443c4ad0988 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.13-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/README.md b/samples/client/petstore/go/go-petstore/README.md index d3d111dda499..dc14850d4b02 100644 --- a/samples/client/petstore/go/go-petstore/README.md +++ b/samples/client/petstore/go/go-petstore/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/api_another_fake.go b/samples/client/petstore/go/go-petstore/api_another_fake.go index e5a0fb71ea32..89e7e97727bc 100644 --- a/samples/client/petstore/go/go-petstore/api_another_fake.go +++ b/samples/client/petstore/go/go-petstore/api_another_fake.go @@ -26,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(). @@ -88,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 { @@ -115,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 fc269978e180..b4ed102daf4f 100644 --- a/samples/client/petstore/go/go-petstore/api_fake.go +++ b/samples/client/petstore/go/go-petstore/api_fake.go @@ -27,7 +27,7 @@ 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(). @@ -102,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 { @@ -130,7 +128,7 @@ 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(). @@ -205,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 { @@ -233,7 +229,7 @@ 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(). @@ -308,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 { @@ -336,7 +330,7 @@ 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(). @@ -411,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 { @@ -439,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 @@ -512,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(). @@ -574,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 { @@ -602,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(). @@ -746,7 +736,7 @@ 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(). @@ -860,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(). @@ -932,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(). @@ -1004,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 d3cffa7e9171..6dc2f67b0a39 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 @@ -26,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(). @@ -101,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 { @@ -128,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 960a5f994e3e..1d1fd3cfb5d8 100644 --- a/samples/client/petstore/go/go-petstore/api_pet.go +++ b/samples/client/petstore/go/go-petstore/api_pet.go @@ -29,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(). @@ -101,7 +101,7 @@ 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(). @@ -182,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(). @@ -243,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 { @@ -271,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(). @@ -332,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 { @@ -360,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(). @@ -434,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 { @@ -462,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(). @@ -534,7 +528,7 @@ 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(). @@ -620,7 +614,7 @@ 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(). @@ -707,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 { @@ -734,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 400765f4981f..92e538eddffc 100644 --- a/samples/client/petstore/go/go-petstore/api_store.go +++ b/samples/client/petstore/go/go-petstore/api_store.go @@ -27,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(). @@ -98,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(). @@ -170,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 { @@ -198,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(). @@ -265,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 { @@ -293,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(). @@ -355,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 { @@ -382,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 9f11693bfc4d..a80240c9ca3e 100644 --- a/samples/client/petstore/go/go-petstore/api_user.go +++ b/samples/client/petstore/go/go-petstore/api_user.go @@ -27,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(). @@ -99,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(). @@ -171,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(). @@ -243,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(). @@ -314,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(). @@ -375,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 { @@ -403,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(). @@ -466,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 { @@ -494,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(). @@ -563,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(). @@ -636,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 52b150cfc51e..4c15f024f11c 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 diff --git a/samples/client/petstore/java/feign/.swagger-codegen/VERSION b/samples/client/petstore/java/feign/.swagger-codegen/VERSION index 9bc1c54fc94e..0b1559519952 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.18-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/feign/pom.xml b/samples/client/petstore/java/feign/pom.xml index f8e5e037e30c..8b9331ebddf6 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.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/Ints.java b/samples/client/petstore/java/feign/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..7f7e6e73ab0d --- /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(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 000000000000..b59fb634af7d --- /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(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + 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 000000000000..4e10dc7e3cca --- /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 000000000000..c5ccbcc79172 --- /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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/google-api-client/build.gradle b/samples/client/petstore/java/google-api-client/build.gradle index fae19029a3d1..f11b9847654a 100644 --- a/samples/client/petstore/java/google-api-client/build.gradle +++ b/samples/client/petstore/java/google-api-client/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" google_api_client_version = "1.23.0" jersey_common_version = "2.29.1" diff --git a/samples/client/petstore/java/google-api-client/pom.xml b/samples/client/petstore/java/google-api-client/pom.xml index d2ea0f1d2fe2..1b636f1f9124 100644 --- a/samples/client/petstore/java/google-api-client/pom.xml +++ b/samples/client/petstore/java/google-api-client/pom.xml @@ -253,6 +253,6 @@ 2.10.1 2.6.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey1/.swagger-codegen/VERSION index 017674fb59d7..0b1559519952 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.18-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 9f3bb3cb70bc..d594fe02a45b 100644 --- a/samples/client/petstore/java/jersey1/build.gradle +++ b/samples/client/petstore/java/jersey1/build.gradle @@ -108,7 +108,7 @@ 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" 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 5b0aa55e110a..fbf08a0f2579 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/model/Ints.java b/samples/client/petstore/java/jersey1/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..7f7e6e73ab0d --- /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(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 000000000000..b59fb634af7d --- /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(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + 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 000000000000..4e10dc7e3cca --- /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 000000000000..c5ccbcc79172 --- /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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION index 017674fb59d7..0b1559519952 100644 --- a/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION +++ b/samples/client/petstore/java/jersey2-java6/.swagger-codegen/VERSION @@ -1 +1 @@ -2.4.3-SNAPSHOT \ No newline at end of file +2.4.18-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java6/build.gradle b/samples/client/petstore/java/jersey2-java6/build.gradle index 6f54775fc64d..d03f2fecdbfa 100644 --- a/samples/client/petstore/java/jersey2-java6/build.gradle +++ b/samples/client/petstore/java/jersey2-java6/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { ext { swagger_annotations_version = "1.5.17" - jackson_version = "2.8.9" + jackson_version = "2.10.1" jersey_version = "2.6" commons_io_version=2.5 commons_lang3_version=3.6 @@ -111,7 +111,7 @@ dependencies { 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.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 index 2e7737c2d69d..673707a55d3c 100644 --- a/samples/client/petstore/java/jersey2-java6/build.sbt +++ b/samples/client/petstore/java/jersey2-java6/build.sbt @@ -12,6 +12,7 @@ lazy val root = (project in file(".")). "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", diff --git a/samples/client/petstore/java/jersey2-java6/docs/Ints.md b/samples/client/petstore/java/jersey2-java6/docs/Ints.md new file mode 100644 index 000000000000..28b508b44f0b --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/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-java6/docs/ModelBoolean.md b/samples/client/petstore/java/jersey2-java6/docs/ModelBoolean.md new file mode 100644 index 000000000000..10ac48b4bbd3 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/ModelBoolean.md @@ -0,0 +1,12 @@ + +# ModelBoolean + +## Enum + + +* `TRUE` (value: `true`) + +* `FALSE` (value: `false`) + + + diff --git a/samples/client/petstore/java/jersey2-java6/docs/ModelList.md b/samples/client/petstore/java/jersey2-java6/docs/ModelList.md new file mode 100644 index 000000000000..708124350f8e --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/docs/ModelList.md @@ -0,0 +1,10 @@ + +# ModelList + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_123List** | **String** | | [optional] + + + diff --git a/samples/client/petstore/java/jersey2-java6/docs/Numbers.md b/samples/client/petstore/java/jersey2-java6/docs/Numbers.md new file mode 100644 index 000000000000..e2db29364b18 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/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-java6/pom.xml b/samples/client/petstore/java/jersey2-java6/pom.xml index b349f5217498..43d640163b28 100644 --- a/samples/client/petstore/java/jersey2-java6/pom.xml +++ b/samples/client/petstore/java/jersey2-java6/pom.xml @@ -220,7 +220,11 @@ jersey-media-json-jackson ${jersey-version} - + + org.glassfish.jersey.inject + jersey-hk2 + ${jersey-version} + com.fasterxml.jackson.core @@ -268,12 +272,12 @@ UTF-8 - 1.5.18 + 1.5.24 2.6 2.5 3.6 2.6.4 1.0.0 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Ints.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..cb9227ee583a --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Ints.java @@ -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 + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import org.apache.commons.lang3.ObjectUtils; +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(String text) { + for (Ints b : Ints.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/ModelBoolean.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelBoolean.java new file mode 100644 index 000000000000..b23231adc7e1 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelBoolean.java @@ -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 + * Do not edit the class manually. + */ + + +package io.swagger.client.model; + +import org.apache.commons.lang3.ObjectUtils; +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(String text) { + for (ModelBoolean b : ModelBoolean.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/ModelList.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelList.java new file mode 100644 index 000000000000..e00ff40233d6 --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/ModelList.java @@ -0,0 +1,90 @@ +/* + * 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; + +/** + * 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 ObjectUtils.equals(this._123List, _list._123List); + } + + @Override + public int hashCode() { + return ObjectUtils.hashCodeMulti(_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-java6/src/main/java/io/swagger/client/model/Numbers.java b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Numbers.java new file mode 100644 index 000000000000..1d267944685d --- /dev/null +++ b/samples/client/petstore/java/jersey2-java6/src/main/java/io/swagger/client/model/Numbers.java @@ -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 + * + * 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.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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2-java8/.swagger-codegen/VERSION index 52f864c9d496..0b1559519952 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.18-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/java/jersey2-java8/build.gradle b/samples/client/petstore/java/jersey2-java8/build.gradle index e3c0a4c4d4b9..7e25856a6c79 100644 --- a/samples/client/petstore/java/jersey2-java8/build.gradle +++ b/samples/client/petstore/java/jersey2-java8/build.gradle @@ -93,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" 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/docs/Ints.md b/samples/client/petstore/java/jersey2-java8/docs/Ints.md new file mode 100644 index 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 3e1b085045db..669a6d2e962d 100644 --- a/samples/client/petstore/java/jersey2-java8/pom.xml +++ b/samples/client/petstore/java/jersey2-java8/pom.xml @@ -260,6 +260,6 @@ 2.29.1 2.10.1 1.0.0 - 4.12 + 4.13.1 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 000000000000..7f7e6e73ab0d --- /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(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 000000000000..b59fb634af7d --- /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(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + 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 000000000000..4e10dc7e3cca --- /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 000000000000..c5ccbcc79172 --- /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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION b/samples/client/petstore/java/jersey2/.swagger-codegen/VERSION index 52f864c9d496..0b1559519952 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.18-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 8ceb02c6e3b0..d8ecb56a9fe7 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 9bf97ddc4489..9ac0e1042e76 100644 --- a/samples/client/petstore/java/jersey2/build.gradle +++ b/samples/client/petstore/java/jersey2/build.gradle @@ -93,7 +93,7 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" 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 1c17767c2b72..000000000000 --- 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 56f7c9ea1fff..000000000000 --- 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 f8ec0768e1f8..000000000000 --- 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 232cb0ed5c11..000000000000 --- 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 bf3b975ffcb8..cdb6fbda4823 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/model/Ints.java b/samples/client/petstore/java/jersey2/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..7f7e6e73ab0d --- /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(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 000000000000..b59fb634af7d --- /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(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + 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 000000000000..4e10dc7e3cca --- /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 000000000000..c5ccbcc79172 --- /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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 0e4979b29060..776b1dec2f31 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 af5885aadddb..06147652aad6 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 017674fb59d7..0b1559519952 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.18-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 957ff4822923..cd2a7a2ac2f6 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 364994983a08..93ba32a2d716 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/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 000000000000..7dcfb9dcd02d --- /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 000000000000..548a277d1044 --- /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 { + Boolean value = jsonReader.nextBoolean(); + 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 000000000000..16c2ecf62e11 --- /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 000000000000..bffdca973bf2 --- /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 017674fb59d7..0b1559519952 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.18-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 957ff4822923..cd2a7a2ac2f6 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 1fcb1aa43b28..0587f5818a5c 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/model/Ints.java b/samples/client/petstore/java/okhttp-gson/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..b615fd3bc7fd --- /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 000000000000..5aef30ff2b20 --- /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 { + Boolean value = jsonReader.nextBoolean(); + 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 000000000000..583815135708 --- /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 000000000000..47cadd1886d7 --- /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/rest-assured/.swagger-codegen/VERSION b/samples/client/petstore/java/rest-assured/.swagger-codegen/VERSION index 017674fb59d7..0b1559519952 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.18-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 45a01cf97899..fb5809920f4d 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 8147094612bf..d0a4e1126906 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 b4e1a0b9b939..034dcfe9d617 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/Ints.java b/samples/client/petstore/java/rest-assured/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..b615fd3bc7fd --- /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 000000000000..5aef30ff2b20 --- /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 { + Boolean value = jsonReader.nextBoolean(); + 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 000000000000..583815135708 --- /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 000000000000..47cadd1886d7 --- /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 9bc1c54fc94e..0b1559519952 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.18-SNAPSHOT \ No newline at end of file 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 e0463febda41..0c4ffc42e460 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.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/model/Ints.java b/samples/client/petstore/java/resteasy/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..7f7e6e73ab0d --- /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(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 000000000000..b59fb634af7d --- /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(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + 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 000000000000..4e10dc7e3cca --- /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 000000000000..c5ccbcc79172 --- /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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION b/samples/client/petstore/java/resttemplate-withXml/.swagger-codegen/VERSION index 0443c4ad0988..0b1559519952 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.16-SNAPSHOT \ No newline at end of file +2.4.18-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 e96838255ecf..3031a1a635d1 100644 --- a/samples/client/petstore/java/resttemplate-withXml/build.gradle +++ b/samples/client/petstore/java/resttemplate-withXml/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" 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 000000000000..28b508b44f0b --- /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/ModelBoolean.md b/samples/client/petstore/java/resttemplate-withXml/docs/ModelBoolean.md new file mode 100644 index 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 c51e2c12043b..3b4c8aa7e3aa 100644 --- a/samples/client/petstore/java/resttemplate-withXml/pom.xml +++ b/samples/client/petstore/java/resttemplate-withXml/pom.xml @@ -261,6 +261,6 @@ 2.10.1 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/Ints.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..42579fe475d3 --- /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(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 000000000000..9956988a6f71 --- /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(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/List.java b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelList.java similarity index 87% rename from samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/List.java rename to samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelList.java index b97eb45decff..c58b70d69aac 100644 --- a/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/List.java +++ b/samples/client/petstore/java/resttemplate-withXml/src/main/java/io/swagger/client/model/ModelList.java @@ -24,19 +24,19 @@ import javax.xml.bind.annotation.*; /** - * List + * ModelList */ -@XmlRootElement(name = "List") +@XmlRootElement(name = "ModelList") @XmlAccessorType(XmlAccessType.FIELD) -@JacksonXmlRootElement(localName = "List") -public class List { +@JacksonXmlRootElement(localName = "ModelList") +public class ModelList { @JsonProperty("123-list") @JacksonXmlProperty(localName = "123-list") @XmlElement(name = "123-list") private String _123List = null; - public List _123List(String _123List) { + public ModelList _123List(String _123List) { this._123List = _123List; return this; } @@ -63,8 +63,8 @@ public boolean equals(java.lang.Object o) { if (o == null || getClass() != o.getClass()) { return false; } - List list = (List) o; - return Objects.equals(this._123List, list._123List); + ModelList _list = (ModelList) o; + return Objects.equals(this._123List, _list._123List); } @Override @@ -76,7 +76,7 @@ public int hashCode() { @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class List {\n"); + sb.append("class ModelList {\n"); sb.append(" _123List: ").append(toIndentedString(_123List)).append("\n"); sb.append("}"); 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 000000000000..e4cc3d64da25 --- /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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION b/samples/client/petstore/java/resttemplate/.swagger-codegen/VERSION index bba5a87afd0a..0b1559519952 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.18-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 24574c275c0a..b84f16696a28 100644 --- a/samples/client/petstore/java/resttemplate/build.gradle +++ b/samples/client/petstore/java/resttemplate/build.gradle @@ -94,7 +94,7 @@ if(hasProperty('target') && target == 'android') { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" jackson_version = "2.10.1" spring_web_version = "4.3.9.RELEASE" jodatime_version = "2.9.9" 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 58196a104759..cfd623ae48f9 100644 --- a/samples/client/petstore/java/resttemplate/pom.xml +++ b/samples/client/petstore/java/resttemplate/pom.xml @@ -253,6 +253,6 @@ 2.10.1 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/Ints.java b/samples/client/petstore/java/resttemplate/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..7f7e6e73ab0d --- /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(String text) { + for (Ints b : Ints.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + 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 000000000000..b59fb634af7d --- /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(String text) { + for (ModelBoolean b : ModelBoolean.values()) { + if (String.valueOf(b.value).equals(text)) { + 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 000000000000..4e10dc7e3cca --- /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 000000000000..c5ccbcc79172 --- /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(String text) { + for (Numbers b : Numbers.values()) { + if (String.valueOf(b.value).equals(text)) { + return b; + } + } + return null; + } +} + diff --git a/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit/.swagger-codegen/VERSION index 017674fb59d7..0b1559519952 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.18-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 f71111ea7f99..965cffca64c2 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/Ints.java b/samples/client/petstore/java/retrofit/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..b615fd3bc7fd --- /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 000000000000..5aef30ff2b20 --- /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 { + Boolean value = jsonReader.nextBoolean(); + 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 000000000000..583815135708 --- /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 000000000000..47cadd1886d7 --- /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/retrofit2-play24/build.gradle b/samples/client/petstore/java/retrofit2-play24/build.gradle index 90dd0fa01761..1a54095cf2e2 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.gradle +++ b/samples/client/petstore/java/retrofit2-play24/build.gradle @@ -95,12 +95,12 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" + retrofit_version = "2.7.1" jackson_version = "2.10.1" 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 37c69c7cc9c2..4aeba14e181e 100644 --- a/samples/client/petstore/java/retrofit2-play24/build.sbt +++ b/samples/client/petstore/java/retrofit2-play24/build.sbt @@ -9,16 +9,16 @@ 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", "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", + "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.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/samples/client/petstore/java/retrofit2-play24/pom.xml b/samples/client/petstore/java/retrofit2-play24/pom.xml index e03677f94676..1b3fae04b3f1 100644 --- a/samples/client/petstore/java/retrofit2-play24/pom.xml +++ b/samples/client/petstore/java/retrofit2-play24/pom.xml @@ -271,12 +271,12 @@ 1.8 ${java.version} ${java.version} - 1.8.0 + 1.8.3 1.5.18 2.10.1 2.4.11 2.3.0 1.0.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit2-play25/build.gradle b/samples/client/petstore/java/retrofit2-play25/build.gradle index e27eeb884fd6..2856c5fddf15 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.gradle +++ b/samples/client/petstore/java/retrofit2-play25/build.gradle @@ -95,13 +95,13 @@ if(hasProperty('target') && target == 'android') { ext { oltu_version = "1.0.1" - retrofit_version = "2.3.0" + retrofit_version = "2.7.1" jackson_version = "2.10.1" 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 b92ac33f1fe7..f776b55b00f0 100644 --- a/samples/client/petstore/java/retrofit2-play25/build.sbt +++ b/samples/client/petstore/java/retrofit2-play25/build.sbt @@ -9,17 +9,17 @@ 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", + "joda-time" % "joda-time" % "2.10.5" % "compile",% "2.3.0" % "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.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", + "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-play25/pom.xml b/samples/client/petstore/java/retrofit2-play25/pom.xml index bab629d1f45b..2a882074f342 100644 --- a/samples/client/petstore/java/retrofit2-play25/pom.xml +++ b/samples/client/petstore/java/retrofit2-play25/pom.xml @@ -276,13 +276,13 @@ 1.8 ${java.version} ${java.version} - 1.8.0 - 1.5.18 + 1.8.3 + 1.5.24 2.10.1 2.5.15 2.3.0 - 1.3.5 + 1.4.1 1.0.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2/.swagger-codegen/VERSION index 017674fb59d7..0b1559519952 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.18-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 bcbaf119988d..2e8e60c9a3fe 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 4513bfe6a5da..d2c7eb2c27a8 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 8aeb47c55b54..83a15f4ef48a 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 + 1.8.3 + 1.5.24 2.3.0 - 1.3.5 + 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/Ints.java b/samples/client/petstore/java/retrofit2/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..b615fd3bc7fd --- /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 000000000000..5aef30ff2b20 --- /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 { + Boolean value = jsonReader.nextBoolean(); + 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 000000000000..583815135708 --- /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 000000000000..47cadd1886d7 --- /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/retrofit2rx/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx/.swagger-codegen/VERSION index 017674fb59d7..0b1559519952 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.18-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 43f0fcbe3e38..7eb143ad1e81 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 b0c73c5aeafc..bd7c59ea2921 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 92c39cffb45e..9ae26aab24a5 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 + 1.8.3 + 1.5.24 2.3.0 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/Ints.java b/samples/client/petstore/java/retrofit2rx/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..b615fd3bc7fd --- /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 000000000000..5aef30ff2b20 --- /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 { + Boolean value = jsonReader.nextBoolean(); + 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 000000000000..583815135708 --- /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 000000000000..47cadd1886d7 --- /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/retrofit2rx2/.swagger-codegen/VERSION b/samples/client/petstore/java/retrofit2rx2/.swagger-codegen/VERSION index 017674fb59d7..0b1559519952 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.18-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 2e0e6d3aa2c7..8292c9be899d 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 7cd73d966952..c50287e9d7b1 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 000000000000..28b508b44f0b --- /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 000000000000..10ac48b4bbd3 --- /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 000000000000..708124350f8e --- /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 000000000000..e2db29364b18 --- /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 6b2cc2ac8384..c9f05d03cffb 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.8.3 1.5.18 2.3.0 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/Ints.java b/samples/client/petstore/java/retrofit2rx2/src/main/java/io/swagger/client/model/Ints.java new file mode 100644 index 000000000000..b615fd3bc7fd --- /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 000000000000..5aef30ff2b20 --- /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 { + Boolean value = jsonReader.nextBoolean(); + 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 000000000000..583815135708 --- /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 000000000000..47cadd1886d7 --- /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/build.gradle b/samples/client/petstore/java/vertx/build.gradle index ed809937e3f1..d43aea604d2a 100644 --- a/samples/client/petstore/java/vertx/build.gradle +++ b/samples/client/petstore/java/vertx/build.gradle @@ -26,7 +26,7 @@ task execute(type:JavaExec) { } ext { - swagger_annotations_version = "1.5.17" + swagger_annotations_version = "1.5.24" threetenbp_version = "2.6.4" jackson_version = "2.10.1" vertx_version = "3.4.2" diff --git a/samples/client/petstore/java/vertx/pom.xml b/samples/client/petstore/java/vertx/pom.xml index 0567f5e6cb5d..f28e64b60f2b 100644 --- a/samples/client/petstore/java/vertx/pom.xml +++ b/samples/client/petstore/java/vertx/pom.xml @@ -261,9 +261,9 @@ UTF-8 3.4.2 - 1.5.18 + 1.5.24 2.6.4 2.10.1 - 4.12 + 4.13.1 diff --git a/samples/client/petstore/javascript-es6/.swagger-codegen/VERSION b/samples/client/petstore/javascript-es6/.swagger-codegen/VERSION index 6cecc1a68f36..0b1559519952 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.18-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 f344feaa82ba..e89a3c224cec 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 000000000000..4a4e8c4f3704 --- /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 000000000000..726dd7e9892a --- /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 000000000000..93fd4901f061 --- /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 4ba645d4e58b..16017053781c 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.18-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 e8df590c214d..3a75a99e08bf 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.18-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 c218f7119f58..d953eba00493 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.18-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 5147076eba66..743cae5dcafb 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.18-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 5086a05f21ab..54b1310fd076 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.18-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 03a1c979d4d2..8fc5d5cf1829 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.18-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 3764c08d2525..a73fac8d53bc 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.18-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 13e7010860de..e712d396f473 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.18-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 e50bab6a8548..797f4634efb3 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.18-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 7a7b870833ae..be46ad8432ca 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.18-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 79ba3491683e..a23d150a4908 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.18-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 d0a79855665a..d3abd94abe03 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.18-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 9448a69cd1cb..61861426c070 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.18-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 84f908bbc461..85ecb337d71b 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.18-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 d68627f53146..d2a402e76ac2 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.18-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 7e4f561236fe..09e942644189 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.18-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 b581d5e00bfb..c7acc537b35b 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.18-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 835ce21ae5ef..3f606d6db9f3 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.18-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 a68fb434c502..f62ec78c4c38 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.18-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 52b0d5f0c5d2..e2a11a0433bb 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.18-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 a90ac7793e26..6582e9d959f9 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.18-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 4264aee98b19..27916ea9c5c2 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.18-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 1d85dd4a9383..529860d186ce 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.18-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 5e0071078806..6fc5b66011d5 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.18-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 d1e7b5eb1cfe..7d49fb9958a4 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.18-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 791d233a4f0d..bd8947865c06 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.18-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 000000000000..315e7c3b2680 --- /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.18-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 d76c2aa0bb85..5236ed27347e 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.18-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 8b960570966e..ace4b3499e44 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.18-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 973037c11b5a..3fc6e01481c8 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.18-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 59683a26bc30..096a5a3fd734 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.18-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 000000000000..f838c4548758 --- /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.18-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 148ba14772ca..816b590e6641 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.18-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 06d1b0a61c8a..34fd4f73f58c 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.18-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 52c0b0611f3a..09487aa5b33c 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.18-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 000000000000..40fa21bf3a2e --- /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.18-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 208c85820d50..2cece22b42ff 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.18-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 99bf4cec6152..fc4d69cf22b4 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.18-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 76884b8a2a6c..04f51aab60a9 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.18-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 0d1ce5c25283..896853b97cd6 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.18-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 c5c4e82bdb6c..fd36c4d39a31 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.18-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 4b9ae20b9c2a..24cc72585c8e 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.18-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 3be93d5372d8..021b6df7bf20 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.18-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 a8ef7b7ca365..94eb28b686c1 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.18-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 875d2ce13a20..757ed9ddf1b0 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.18-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 7000111c3910..24607b6f8330 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.18-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 8bff47d2c82d..c93fcebb15ea 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.18-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 000000000000..5acd21643bb6 --- /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 000000000000..43707f907e0d --- /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 000000000000..1f396917eea8 --- /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 6cecc1a68f36..0b1559519952 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.18-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 01d4fd9ff53a..bbbac56e7d60 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 000000000000..4a4e8c4f3704 --- /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 000000000000..726dd7e9892a --- /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 000000000000..93fd4901f061 --- /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 19c88f4b4a54..692edc8f7924 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.18-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 47a5fff970c6..470bd9c98dd5 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.18-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 cd09075b1221..e531dee1bb8a 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.18-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 83e167de0605..b1b146cb801b 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.18-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 b253094d423b..ea1f4937d667 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.18-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 b7508407ae8b..60b919d0932a 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.18-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 43547ba38668..4e580c10b5e8 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.18-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 13e7010860de..e712d396f473 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.18-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 e50bab6a8548..797f4634efb3 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.18-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 7a7b870833ae..be46ad8432ca 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.18-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 79ba3491683e..a23d150a4908 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.18-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 d0a79855665a..d3abd94abe03 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.18-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 9448a69cd1cb..61861426c070 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.18-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 84f908bbc461..85ecb337d71b 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.18-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 d68627f53146..d2a402e76ac2 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.18-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 7e4f561236fe..09e942644189 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.18-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 b581d5e00bfb..c7acc537b35b 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.18-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 835ce21ae5ef..3f606d6db9f3 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.18-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 a68fb434c502..f62ec78c4c38 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.18-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 52b0d5f0c5d2..e2a11a0433bb 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.18-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 a90ac7793e26..6582e9d959f9 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.18-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 4264aee98b19..27916ea9c5c2 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.18-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 1d85dd4a9383..529860d186ce 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.18-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 5e0071078806..6fc5b66011d5 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.18-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 d1e7b5eb1cfe..7d49fb9958a4 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.18-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 791d233a4f0d..bd8947865c06 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.18-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 000000000000..315e7c3b2680 --- /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.18-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 d76c2aa0bb85..5236ed27347e 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.18-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 8b960570966e..ace4b3499e44 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.18-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 973037c11b5a..3fc6e01481c8 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.18-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 59683a26bc30..096a5a3fd734 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.18-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 000000000000..f838c4548758 --- /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.18-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 148ba14772ca..816b590e6641 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.18-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 06d1b0a61c8a..34fd4f73f58c 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.18-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 52c0b0611f3a..09487aa5b33c 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.18-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 000000000000..40fa21bf3a2e --- /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.18-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 208c85820d50..2cece22b42ff 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.18-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 99bf4cec6152..fc4d69cf22b4 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.18-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 76884b8a2a6c..04f51aab60a9 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.18-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 0d1ce5c25283..896853b97cd6 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.18-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 c5c4e82bdb6c..fd36c4d39a31 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.18-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 4b9ae20b9c2a..24cc72585c8e 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.18-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 3be93d5372d8..021b6df7bf20 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.18-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 a8ef7b7ca365..94eb28b686c1 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.18-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 875d2ce13a20..757ed9ddf1b0 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.18-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 7000111c3910..24607b6f8330 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.18-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 8bff47d2c82d..c93fcebb15ea 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.18-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 000000000000..5acd21643bb6 --- /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 000000000000..43707f907e0d --- /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 000000000000..1f396917eea8 --- /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 6cecc1a68f36..0b1559519952 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.18-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 a2f90c36046d..069130d9724a 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 000000000000..4a4e8c4f3704 --- /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 000000000000..726dd7e9892a --- /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 000000000000..93fd4901f061 --- /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 56ff623d99c3..76368411a39f 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.18-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 ab363bb6bda9..66bf3dfae951 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.18-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 2ab42c00edff..695f867cd78f 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.18-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 0c209d3c2f7d..e40e70229395 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.18-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 4d3a57aebbc5..6597dd7e93d3 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.18-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 d9ed668937e8..165f764e81b0 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.18-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 87eb3a6b9723..c8b66f7a1728 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.18-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 c2c51271854b..40a93e88202e 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.18-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 b4556bbea80c..b9f33d7baadd 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Animal.js b/samples/client/petstore/javascript-promise/src/model/Animal.js index 476b94f57030..426f50f51eae 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js b/samples/client/petstore/javascript-promise/src/model/AnimalFarm.js index 4d931c445aab..1519239af473 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ApiResponse.js b/samples/client/petstore/javascript-promise/src/model/ApiResponse.js index 5498ff0dbf6f..307d4631d132 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfArrayOfNumberOnly.js index cc7b6d1115da..29682c7b1dbc 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript-promise/src/model/ArrayOfNumberOnly.js index aa87b50174e0..52c4c42debd9 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ArrayTest.js b/samples/client/petstore/javascript-promise/src/model/ArrayTest.js index a4c824dde132..14f82f74ff34 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Capitalization.js b/samples/client/petstore/javascript-promise/src/model/Capitalization.js index e57f49c4d12d..b55568647a3e 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Cat.js b/samples/client/petstore/javascript-promise/src/model/Cat.js index 91dd1dd31e7e..03dbbb1ed5cc 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Category.js b/samples/client/petstore/javascript-promise/src/model/Category.js index 44af7aff4aff..81d29c3c1b01 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ClassModel.js b/samples/client/petstore/javascript-promise/src/model/ClassModel.js index f8637b603b70..1ec57bf324e4 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Client.js b/samples/client/petstore/javascript-promise/src/model/Client.js index ac162078cfe9..94dc080e276d 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Dog.js b/samples/client/petstore/javascript-promise/src/model/Dog.js index b0d92d8007de..0cdc866ce62e 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumArrays.js b/samples/client/petstore/javascript-promise/src/model/EnumArrays.js index 89b926cc0edb..1c498159a3de 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/EnumClass.js b/samples/client/petstore/javascript-promise/src/model/EnumClass.js index 3ca437dab09b..f76a1f58fcf7 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.18-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 34769c178900..43f308a5ef24 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/FormatTest.js b/samples/client/petstore/javascript-promise/src/model/FormatTest.js index 626843b704c5..9b441fc6e690 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript-promise/src/model/HasOnlyReadOnly.js index dc9c99c01318..bfc9610d191b 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..de67f441a260 --- /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.18-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 4a69e4338848..e2cfb7a14ecd 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MapTest.js b/samples/client/petstore/javascript-promise/src/model/MapTest.js index ddf6ec6913fc..a784fb64863f 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript-promise/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 5c7381e3e25d..569acd3633d0 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Model200Response.js b/samples/client/petstore/javascript-promise/src/model/Model200Response.js index 5198ae0a2c4f..06f690b13fe3 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..d61de3830f95 --- /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.18-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 a3b7baf88553..c948bac8874f 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Name.js b/samples/client/petstore/javascript-promise/src/model/Name.js index 6f0a72cd41b9..e936ca3828d9 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/NumberOnly.js b/samples/client/petstore/javascript-promise/src/model/NumberOnly.js index ecad15c65f7a..a6a5bff94ad6 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..f66d3e069961 --- /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.18-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 647183b7b793..2da42a56fe7f 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js b/samples/client/petstore/javascript-promise/src/model/OuterBoolean.js index e216877e573d..f940e9399cf8 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterComposite.js b/samples/client/petstore/javascript-promise/src/model/OuterComposite.js index 2d83d642b090..e029ede8031d 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterEnum.js b/samples/client/petstore/javascript-promise/src/model/OuterEnum.js index 5e59925dcea8..ab0b29259caa 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.18-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 593efea443fd..9d6ea3ea444c 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/OuterString.js b/samples/client/petstore/javascript-promise/src/model/OuterString.js index 97dc19f52922..1850686d6f1c 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Pet.js b/samples/client/petstore/javascript-promise/src/model/Pet.js index b90c95af2452..12c1752a5b82 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript-promise/src/model/ReadOnlyFirst.js index 4f7d7915cea5..93489cdd1b6e 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js b/samples/client/petstore/javascript-promise/src/model/SpecialModelName.js index c064f24336d0..7682e9ed7e1a 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/Tag.js b/samples/client/petstore/javascript-promise/src/model/Tag.js index 9deb39464f5b..780203123459 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript-promise/src/model/User.js b/samples/client/petstore/javascript-promise/src/model/User.js index 873c85186895..d65b3a497f61 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..5acd21643bb6 --- /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 000000000000..43707f907e0d --- /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 000000000000..1f396917eea8 --- /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 6cecc1a68f36..0b1559519952 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.18-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/javascript/README.md b/samples/client/petstore/javascript/README.md index 3172081042d8..01f47f7e7091 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 000000000000..4a4e8c4f3704 --- /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 000000000000..726dd7e9892a --- /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 000000000000..93fd4901f061 --- /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 77aa6675d163..40fa17c57072 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.18-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 de058cd12cda..5b1ce965235d 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.18-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 83e93cd17714..3cffa7fd86b8 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.18-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 f03c34cac52c..537b713978d0 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.18-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 c8cf8b734362..2619d06c2189 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.18-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 9ca63e17b1be..096b6b681485 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.18-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 5636e4906b6d..13ad41fbb902 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.18-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 c2c51271854b..40a93e88202e 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.18-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 b4556bbea80c..b9f33d7baadd 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Animal.js b/samples/client/petstore/javascript/src/model/Animal.js index 476b94f57030..426f50f51eae 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/AnimalFarm.js b/samples/client/petstore/javascript/src/model/AnimalFarm.js index 4d931c445aab..1519239af473 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ApiResponse.js b/samples/client/petstore/javascript/src/model/ApiResponse.js index 5498ff0dbf6f..307d4631d132 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfArrayOfNumberOnly.js index cc7b6d1115da..29682c7b1dbc 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js b/samples/client/petstore/javascript/src/model/ArrayOfNumberOnly.js index aa87b50174e0..52c4c42debd9 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ArrayTest.js b/samples/client/petstore/javascript/src/model/ArrayTest.js index a4c824dde132..14f82f74ff34 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Capitalization.js b/samples/client/petstore/javascript/src/model/Capitalization.js index e57f49c4d12d..b55568647a3e 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Cat.js b/samples/client/petstore/javascript/src/model/Cat.js index 91dd1dd31e7e..03dbbb1ed5cc 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Category.js b/samples/client/petstore/javascript/src/model/Category.js index 44af7aff4aff..81d29c3c1b01 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ClassModel.js b/samples/client/petstore/javascript/src/model/ClassModel.js index f8637b603b70..1ec57bf324e4 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Client.js b/samples/client/petstore/javascript/src/model/Client.js index ac162078cfe9..94dc080e276d 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Dog.js b/samples/client/petstore/javascript/src/model/Dog.js index b0d92d8007de..0cdc866ce62e 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumArrays.js b/samples/client/petstore/javascript/src/model/EnumArrays.js index 89b926cc0edb..1c498159a3de 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/EnumClass.js b/samples/client/petstore/javascript/src/model/EnumClass.js index 3ca437dab09b..f76a1f58fcf7 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.18-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 34769c178900..43f308a5ef24 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/FormatTest.js b/samples/client/petstore/javascript/src/model/FormatTest.js index 626843b704c5..9b441fc6e690 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js b/samples/client/petstore/javascript/src/model/HasOnlyReadOnly.js index dc9c99c01318..bfc9610d191b 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..de67f441a260 --- /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.18-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 4a69e4338848..e2cfb7a14ecd 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MapTest.js b/samples/client/petstore/javascript/src/model/MapTest.js index ddf6ec6913fc..a784fb64863f 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js b/samples/client/petstore/javascript/src/model/MixedPropertiesAndAdditionalPropertiesClass.js index 5c7381e3e25d..569acd3633d0 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Model200Response.js b/samples/client/petstore/javascript/src/model/Model200Response.js index 5198ae0a2c4f..06f690b13fe3 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..d61de3830f95 --- /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.18-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 a3b7baf88553..c948bac8874f 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Name.js b/samples/client/petstore/javascript/src/model/Name.js index 6f0a72cd41b9..e936ca3828d9 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/NumberOnly.js b/samples/client/petstore/javascript/src/model/NumberOnly.js index ecad15c65f7a..a6a5bff94ad6 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..f66d3e069961 --- /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.18-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 647183b7b793..2da42a56fe7f 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterBoolean.js b/samples/client/petstore/javascript/src/model/OuterBoolean.js index e216877e573d..f940e9399cf8 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterComposite.js b/samples/client/petstore/javascript/src/model/OuterComposite.js index 2d83d642b090..e029ede8031d 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterEnum.js b/samples/client/petstore/javascript/src/model/OuterEnum.js index 5e59925dcea8..ab0b29259caa 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.18-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 593efea443fd..9d6ea3ea444c 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/OuterString.js b/samples/client/petstore/javascript/src/model/OuterString.js index 97dc19f52922..1850686d6f1c 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Pet.js b/samples/client/petstore/javascript/src/model/Pet.js index b90c95af2452..12c1752a5b82 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js b/samples/client/petstore/javascript/src/model/ReadOnlyFirst.js index 4f7d7915cea5..93489cdd1b6e 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/SpecialModelName.js b/samples/client/petstore/javascript/src/model/SpecialModelName.js index c064f24336d0..7682e9ed7e1a 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/Tag.js b/samples/client/petstore/javascript/src/model/Tag.js index 9deb39464f5b..780203123459 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.18-SNAPSHOT * * Do not edit the class manually. * diff --git a/samples/client/petstore/javascript/src/model/User.js b/samples/client/petstore/javascript/src/model/User.js index 873c85186895..d65b3a497f61 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.18-SNAPSHOT * * Do not edit the class manually. * 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 000000000000..5acd21643bb6 --- /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 000000000000..43707f907e0d --- /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 000000000000..1f396917eea8 --- /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/pom.xml b/samples/client/petstore/jaxrs-cxf-client/pom.xml index 85652a39c96b..16195b8f8889 100644 --- a/samples/client/petstore/jaxrs-cxf-client/pom.xml +++ b/samples/client/petstore/jaxrs-cxf-client/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/jaxrs-cxf/pom.xml b/samples/client/petstore/jaxrs-cxf/pom.xml index 73d0c914e381..5bdfb1eeea28 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/python/.swagger-codegen/VERSION b/samples/client/petstore/python/.swagger-codegen/VERSION index e3c583516722..8c7754221a4e 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.19-SNAPSHOT \ No newline at end of file diff --git a/samples/client/petstore/python/README.md b/samples/client/petstore/python/README.md index cab8b4c968de..9ba2099777fa 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 000000000000..d0b536f8086e --- /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 ec171d3a5d29..000000000000 --- 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 000000000000..78218e2a7302 --- /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 000000000000..33da59af68c1 --- /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 8bf367cc5b81..21f67e5eb60b 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 955369935ea0..18b0712a29a9 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 a3be46de1e0d..410c068e48e1 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 8aa93d8dc324..ff91aefa1d91 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 bf71e96eab69..4528bd317944 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 27e1f7701922..68edb01ab174 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 62a87f2e4189..160b8ba81137 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 ab9a96868c00..e20fdfcae358 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: diff --git a/samples/client/petstore/python/petstore_api/configuration.py b/samples/client/petstore/python/petstore_api/configuration.py index 103b93fd7389..41d650fe0259 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 c5ae381c40f0..4d14b56341fb 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 83de7092668b..c6ebdbbb1d89 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 5175148b2d38..72d2b522c694 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 1df0fb399244..74fa330c0d47 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 9da53da373b6..f4dde5e8bb45 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 1e5e8be1ed17..4959da91072f 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 0628f7af1e7a..6740f02ce19a 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 b0785ac3f134..b73887c21a0b 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/model_200_response.py b/samples/client/petstore/python/petstore_api/models/boolean.py similarity index 58% rename from samples/client/petstore/python/petstore_api/models/model_200_response.py rename to samples/client/petstore/python/petstore_api/models/boolean.py index 60f9c96a676f..003b75d008b0 100644 --- a/samples/client/petstore/python/petstore_api/models/model_200_response.py +++ b/samples/client/petstore/python/petstore_api/models/boolean.py @@ -16,13 +16,21 @@ import six +from petstore_api.configuration import Configuration -class Model200Response(object): + +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 @@ -31,69 +39,18 @@ class Model200Response(object): 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 + 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 - 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 = {} @@ -115,6 +72,9 @@ def to_dict(self): )) else: result[attr] = value + if issubclass(Boolean, dict): + for key, value in self.items(): + result[key] = value return result @@ -128,11 +88,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, Model200Response): + if not isinstance(other, Boolean): 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, 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 83b0068aee2e..10ea31521cb1 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 4bca18ba8419..c0156a2f2e33 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 dbc4fd288163..24264a64cb95 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 6042036beb5a..c7ff4d8eed47 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 337100c3946f..e37e5d45384c 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 e4bfea5584ca..d64fddef7cba 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 5257b181b88f..fdc6845a7498 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 2282270dda1d..b09191427df9 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 f26afa5bdf95..0a46c111d881 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 206b991719d9..1f2761c6a6b5 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 76e5ceb1e22b..7a092bb5dd21 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 000000000000..659f1294bfe9 --- /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 46eef1e90f35..2f494c172a1a 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 f2633c30a99a..afe2546fc15f 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 cee99da31292..59aceef5a12d 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 1fcaabca10ec..373207ab1697 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_return.py b/samples/client/petstore/python/petstore_api/models/model_return.py index 792536114953..0f328c3e33fc 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 53be7953ea96..ba8196faf462 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 2f43a834f8bd..804e393cf7c1 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 000000000000..526a62eb648a --- /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 9291652787e1..ad4efe203c25 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 3b273333e75a..64ef71982c50 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 ec517a4620cb..98cb079a6356 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 bea07410cf27..6734ac066e3b 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 a60e97c8288e..6dd397fbc1a2 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 622589ce2f63..fed6a765edbe 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 e91ba99a436a..563798bd87e5 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 0a378f93da60..6bb37fcca083 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 3817430b656f..7012f2a2ba5d 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 dc3c0b5645f7..97a0b3922178 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 8dcac91845fa..1b510e0efb7f 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 ef55c4ea44ab..00b43a2e4fff 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 000000000000..1fa78246895b --- /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 00473d4a13bb..4c6e00c4a798 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 000000000000..8d764e748847 --- /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 f577dd421441..ccc768fc8f78 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 000000000000..2c565e08f51d --- /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/scala/pom.xml b/samples/client/petstore/scala/pom.xml index dc83c2362514..934e163b5a5b 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/spring-cloud/pom.xml b/samples/client/petstore/spring-cloud/pom.xml index 1c927dea75a1..c02765870ae1 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/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION b/samples/client/petstore/typescript-fetch/builds/with-npm-version/.swagger-codegen/VERSION index 017674fb59d7..6f88103ecef1 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.17-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 9d538e2147b4..7163176732a8 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 @@ -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 9e1c7628b365..240874eb2bcf 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 097b098c676f..000000000000 --- 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/server/petstore/java-msf4j/pom.xml b/samples/server/petstore/java-msf4j/pom.xml index 0631dc5494d9..7c5b9f5336c6 100644 --- a/samples/server/petstore/java-msf4j/pom.xml +++ b/samples/server/petstore/java-msf4j/pom.xml @@ -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/jaxrs-cxf-annotated-base-path/pom.xml b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml index 4a823e30d17e..f55705863f70 100644 --- a/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-annotated-base-path/pom.xml @@ -184,9 +184,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 1.1.0.Final 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 ac654d8c55f7..5b0016c86577 100644 --- a/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml +++ b/samples/server/petstore/jaxrs-cxf-non-spring-app/pom.xml @@ -184,9 +184,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 1.1.0.Final diff --git a/samples/server/petstore/jaxrs-cxf/pom.xml b/samples/server/petstore/jaxrs-cxf/pom.xml index 133db71f5a5e..adc33da0bd4c 100644 --- a/samples/server/petstore/jaxrs-cxf/pom.xml +++ b/samples/server/petstore/jaxrs-cxf/pom.xml @@ -184,9 +184,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 1.1.0.Final diff --git a/samples/server/petstore/jaxrs-datelib-j8/pom.xml b/samples/server/petstore/jaxrs-datelib-j8/pom.xml index 0deb558f4df3..866410b54636 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-resteasy/default/pom.xml b/samples/server/petstore/jaxrs-resteasy/default/pom.xml index a7dd5353ad6a..fbf67b1cfa1f 100644 --- a/samples/server/petstore/jaxrs-resteasy/default/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/default/pom.xml @@ -179,11 +179,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 2.10.1 diff --git a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml index 72c0ec555eb3..1f21b3a667c6 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-java8/pom.xml @@ -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/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml index ec08d83ef8b9..836c03ec2467 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap-joda/pom.xml @@ -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/pom.xml b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml index a868789c8b65..fcdd37de5bd8 100644 --- a/samples/server/petstore/jaxrs-resteasy/eap/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/eap/pom.xml @@ -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/pom.xml b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml index 2111ac94ce18..aad261c915e0 100644 --- a/samples/server/petstore/jaxrs-resteasy/java8/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/java8/pom.xml @@ -174,11 +174,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 2.10.1 diff --git a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml index d0d1ff9d6ce2..5b505bd91167 100644 --- a/samples/server/petstore/jaxrs-resteasy/joda/pom.xml +++ b/samples/server/petstore/jaxrs-resteasy/joda/pom.xml @@ -179,11 +179,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 2.10.1 diff --git a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml index a32dafce9eec..acf060558017 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml @@ -43,6 +43,6 @@ - 4.8.1 + 4.13.1 diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml index a32dafce9eec..acf060558017 100644 --- a/samples/server/petstore/jaxrs-spec-interface/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -43,6 +43,6 @@ - 4.8.1 + 4.13.1 diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 17d7b2328ef0..4c0c31488366 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -78,6 +78,6 @@ - 4.8.1 + 4.13.1 diff --git a/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey1-useTags/pom.xml index d589a432a522..8781b88a4121 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 1.7.21 - 4.12 + 4.13.1 2.5 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey1/pom.xml b/samples/server/petstore/jaxrs/jersey1/pom.xml index 0780b2a36386..27fecb2251e9 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 1.7.21 - 4.12 + 4.13.1 2.5 UTF-8 diff --git a/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml b/samples/server/petstore/jaxrs/jersey2-useTags/pom.xml index 611a65d59a02..fc6652be55dc 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/pom.xml b/samples/server/petstore/jaxrs/jersey2/pom.xml index f7334da8b2de..7f3f8f30fb02 100644 --- a/samples/server/petstore/jaxrs/jersey2/pom.xml +++ b/samples/server/petstore/jaxrs/jersey2/pom.xml @@ -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 + 4.13.1 1.1.7 2.5 UTF-8 diff --git a/samples/server/petstore/spring-mvc-j8-async/pom.xml b/samples/server/petstore/spring-mvc-j8-async/pom.xml index fbbbbde2766a..3bfdcb33b3cb 100644 --- a/samples/server/petstore/spring-mvc-j8-async/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-async/pom.xml @@ -164,7 +164,7 @@ ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 2.10.1 diff --git a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml index 398767fcc396..97c00718ee56 100644 --- a/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml +++ b/samples/server/petstore/spring-mvc-j8-localdatetime/pom.xml @@ -164,7 +164,7 @@ ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 2.10.1 diff --git a/samples/server/petstore/spring-mvc/pom.xml b/samples/server/petstore/spring-mvc/pom.xml index eea53fac5306..ec5d38e07268 100644 --- a/samples/server/petstore/spring-mvc/pom.xml +++ b/samples/server/petstore/spring-mvc/pom.xml @@ -164,7 +164,7 @@ ${java.version} 9.3.27.v20190418 1.7.21 - 4.12 + 4.13.1 2.5 2.7.0 2.10.1 diff --git a/standalone-gen-dev/standalone-generator-development.md b/standalone-gen-dev/standalone-generator-development.md index f48eb7033204..be2c0f3ac174 100644 --- a/standalone-gen-dev/standalone-generator-development.md +++ b/standalone-gen-dev/standalone-generator-development.md @@ -6,7 +6,7 @@ a new generator can be implemented by starting with a project stub generated by 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.15/swagger-codegen-cli-2.4.15.jar -O swagger-codegen-cli.jar +wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.18/swagger-codegen-cli-2.4.18.jar -O swagger-codegen-cli.jar java -jar swagger-codegen-cli.jar meta -o output/myLibrary -n myClientCodegen -p com.my.company.codegen ``` @@ -30,7 +30,7 @@ cd $TARGET_DIR 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.15/swagger-codegen-cli-2.4.15.jar -O swagger-codegen-cli.jar +wget https://repo1.maven.org/maven2/io/swagger/swagger-codegen-cli/2.4.18/swagger-codegen-cli-2.4.18.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