diff --git a/.github/workflows/samples-dotnet-petstore.yml b/.github/workflows/samples-dotnet-petstore.yml new file mode 100644 index 000000000000..6a97c8f11925 --- /dev/null +++ b/.github/workflows/samples-dotnet-petstore.yml @@ -0,0 +1,37 @@ +name: Samples C# .Net Client (Petstore) + +on: + push: + paths: + - samples/client/petstore/csharp/restsharp/standard2.0/Petstore/** + pull_request: + paths: + - samples/client/petstore/csharp/restsharp/standard2.0/Petstore/** +jobs: + build: + name: Build clients + runs-on: ubuntu-latest + services: + petstore-api: + image: swaggerapi/petstore + ports: + - 80:8080 + env: + SWAGGER_HOST: http://petstore.swagger.io + SWAGGER_BASE_PATH: /v2 + strategy: + fail-fast: false + matrix: + sample: + - samples/client/petstore/csharp/restsharp/standard2.0/Petstore/ + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-dotnet@v5.0.0 + with: + dotnet-version: '7.0.x' + - name: Build + working-directory: ${{ matrix.sample }} + run: dotnet build Org.OpenAPITools.sln + - name: Test + working-directory: ${{ matrix.sample }} + run: dotnet test Org.OpenAPITools.sln diff --git a/.github/workflows/samples-dotnet7-client.yml b/.github/workflows/samples-dotnet7-client.yml new file mode 100644 index 000000000000..f4cbfb61c088 --- /dev/null +++ b/.github/workflows/samples-dotnet7-client.yml @@ -0,0 +1,54 @@ +name: Samples C# .Net 7 Client + +on: + push: + paths: + # the .NET Core 3.0 runtime is no longer supported as it reached its end-of-life on March 3, 2020 + #- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/** + - samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/** + - samples/client/petstore/csharp/restsharp/net4.7/Petstore/** + - samples/client/petstore/csharp/restsharp/net4.8/Petstore/** + - samples/client/petstore/csharp/restsharp/net8/ParameterMappings/** + - samples/client/petstore/csharp/restsharp/net8/EnumMappings/** + - samples/client/petstore/csharp/restsharp/net8/Petstore/** + - samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/** + - samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/** + pull_request: + paths: + #- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/** + - samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/** + - samples/client/petstore/csharp/restsharp/net4.7/Petstore/** + - samples/client/petstore/csharp/restsharp/net4.8/Petstore/** + - samples/client/petstore/csharp/restsharp/net8/ParameterMappings/** + - samples/client/petstore/csharp/restsharp/net8/EnumMappings/** + - samples/client/petstore/csharp/restsharp/net8/Petstore/** + - samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/** + - samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/** +jobs: + build: + name: Build clients + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + sample: + #- samples/client/petstore/csharp/httpclient/standard2.0/Petstore/ + - samples/client/petstore/csharp/restsharp/net4.7/MultipleFrameworks/ + - samples/client/petstore/csharp/restsharp/net4.7/Petstore/ + - samples/client/petstore/csharp/restsharp/net4.8/Petstore/ + - samples/client/petstore/csharp/restsharp/net8/ParameterMappings/ + - samples/client/petstore/csharp/restsharp/net8/EnumMappings/ + - samples/client/petstore/csharp/restsharp/net8/Petstore/ + - samples/client/petstore/csharp/restsharp/net8/UseDateTimeForDate/ + - samples/client/petstore/csharp/restsharp/standard2.0/ConditionalSerialization/ + steps: + - uses: actions/checkout@v5 + - uses: actions/setup-dotnet@v5.0.0 + with: + dotnet-version: '7.0.x' + - name: Build + working-directory: ${{ matrix.sample }} + run: dotnet build Org.OpenAPITools.sln + - name: Test + working-directory: ${{ matrix.sample }} + run: dotnet test Org.OpenAPITools.sln diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 08ee15a80409..000000000000 --- a/appveyor.yml +++ /dev/null @@ -1,113 +0,0 @@ -version: '{branch}-{build}' -image: Visual Studio 2022 -hosts: - petstore.swagger.io: 127.0.0.1 -install: - - cmd: SET PATH=C:\maven\apache-maven-3.8.3\bin;C:\gradle\gradle-7.6\bin;%JAVA_HOME%\bin;%PATH% - - cmd: SET MAVEN_OPTS=-Xmx4g - - cmd: SET JAVA_OPTS=-Xmx4g - - cmd: SET M2_HOME=C:\maven\apache-maven-3.8.3 - - cmd: java -version - - cmd: dir/w - - cmd: docker pull swaggerapi/petstore - - cmd: docker run -d -e SWAGGER_HOST=http://petstore.swagger.io -e SWAGGER_BASE_PATH=/v2 -p 80:8080 swaggerapi/petstore - - ps: Start-Sleep -s 120 - - ps: $PSVersionTable.PSVersion -build_script: - - dotnet --info - # build C# aspnetcore 5.0 server - #- dotnet build samples\server\petstore\aspnetcore-5.0\Org.OpenAPITools.sln - ## build C# aspnetcore 3.1 server - #- dotnet build samples\server\petstore\aspnetcore-3.1\Org.OpenAPITools.sln - ## build C# aspnetcore 3.0 server - #- dotnet build samples\server\petstore\aspnetcore-3.0\Org.OpenAPITools.sln - ## build C# aspnetcore 2.2 server - #- dotnet build samples\server\petstore\aspnetcore\Org.OpenAPITools.sln - ## build C# API client (multiple frameworks) - #- dotnet build samples\client\petstore\csharp\OpenAPIClientCoreAndNet47\Org.OpenAPITools.sln - ## build C# API client (httpclient) - #- dotnet build samples\client\petstore\csharp\OpenAPIClient-httpclient\Org.OpenAPITools.sln - ## build C# API client (generichost) - #- dotnet build samples\client\petstore\csharp\OpenAPIClient-generichost-netstandard2.0\Org.OpenAPITools.sln - ## build C# API client (netcore) - #- dotnet build samples\client\petstore\csharp\OpenAPIClient\Org.OpenAPITools.sln - #- dotnet build samples\client\petstore\csharp\OpenAPIClientCore\Org.OpenAPITools.sln - ## build C# API client (.net framework 4.7) - #- dotnet build samples\client\petstore\csharp\OpenAPIClient-net47\Org.OpenAPITools.sln - ## build C# API client (.net framework 4.8) - #- dotnet build samples\client\petstore\csharp\OpenAPIClient-net48\Org.OpenAPITools.sln - ## build C# API client (.net 5.0) - #- dotnet build samples\client\petstore\csharp\OpenAPIClient-net5.0\Org.OpenAPITools.sln - ## build C# API client (.net 5.0 with ConditionalSerialization) - #- dotnet build samples\client\petstore\csharp\OpenAPIClient-ConditionalSerialization\Org.OpenAPITools.sln - -test_script: - - dotnet test samples\client\petstore\csharp\generichost\latest\ComposedEnum\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\latest\InlineEnumAnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\latest\Tags\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\latest\HelloWorld\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\latest\OneOfList\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - - dotnet test samples\client\petstore\csharp\generichost\net9\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - # - dotnet test samples\client\petstore\csharp\generichost\net9\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj - # - dotnet test samples\client\petstore\csharp\generichost\net9\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net9\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - - dotnet test samples\client\petstore\csharp\generichost\net8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\ManualSourceGenerationTests\ManualTests.Latest.UseSourceGeneration\ManualTests.Latest.UseSourceGeneration.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\ManualPetstoreTests\OpenAPIClient-generichost-manual-tests\OpenAPIClient-generichost-manual-tests.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\NullReferenceTypes\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\SourceGeneration\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - - dotnet test samples\client\petstore\csharp\generichost\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - - dotnet test samples\client\petstore\csharp\generichost\net4.8\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.8\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.8\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.8\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - - dotnet test samples\client\petstore\csharp\generichost\net4.7\AllOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.7\AnyOfNoCompare\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.7\FormModels\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.7\OneOf\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\generichost\net4.7\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - - dotnet test samples\client\petstore\csharp\httpclient\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - - dotnet test samples\client\petstore\csharp\restsharp\net4.7\MultipleFrameworks\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\net4.7\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\net4.8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\net8\ParameterMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\net8\EnumMappings\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\net8\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\net8\UseDateTimeForDate\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\standard2.0\ConditionalSerialization\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - - dotnet test samples\client\petstore\csharp\restsharp\standard2.0\Petstore\src\Org.OpenAPITools.Test\Org.OpenAPITools.Test.csproj - -### TODO: Execute all generators via powershell or other - # generate all petstore clients - # - .\bin\windows\run-all-petstore.cmd - # generate all petstore clients (openapi3) - # - .\bin\openapi3\windows\run-all-petstore.cmd -cache: - - C:\maven\ - - C:\gradle\ - - C:\Users\appveyor\.m2 diff --git a/bin/configs/csharp-restsharp-netstandard2.0.yaml b/bin/configs/csharp-restsharp-netstandard2.0.yaml index c4a6d05757d3..f4b8e5502353 100644 --- a/bin/configs/csharp-restsharp-netstandard2.0.yaml +++ b/bin/configs/csharp-restsharp-netstandard2.0.yaml @@ -2,7 +2,7 @@ generatorName: csharp library: restsharp outputDir: samples/client/petstore/csharp/restsharp/standard2.0/Petstore -inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types-localhost.yaml templateDir: modules/openapi-generator/src/main/resources/csharp additionalProperties: packageGuid: '{321C8C3F-0156-40C1-AE42-D59761FB9B6C}' diff --git a/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types-localhost.yaml b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types-localhost.yaml new file mode 100644 index 000000000000..2f553acba688 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/csharp/petstore-with-fake-endpoints-models-for-testing-with-http-signature-oneof-primitive-types-localhost.yaml @@ -0,0 +1,2808 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /roles/report: + get: + responses: + '200': + description: returns report + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RolesReport' + /hello: + get: + summary: Hello + description: Hello + operationId: Hello + responses: + '200': + description: UUIDs + content: + application/json: + schema: + type: array + items: + type: string + format: uuid + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://localhost/v2' + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '405': + description: Invalid input + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + responses: + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + parameters: + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid tag value + security: + - http_signature_test: [] + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + - api_key_query: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '400': + description: Invalid pet value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + '/pet/{petId}/uploadImage': + post: + tags: + - pet + summary: uploads an image + description: '' + operationId: uploadFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + Set-Cookie: + description: >- + Cookie authentication key for use with the `api_key` + apiKey authentication. + schema: + type: string + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + '598': + description: Not a real HTTP status code + '599': + description: Not a real HTTP status code with a return object + content: + application/json: + schema: + $ref: '#/components/schemas/User' + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + default: '2010-02-01T10:20:10.11111+01:00' + example: '2020-02-02T20:20:20.22222Z' + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Something wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + parameters: + - name: required_string_uuid + in: query + description: Required UUID String + required: true + schema: + type: string + format: uuid + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/additionalProperties-reference: + post: + tags: + - fake + summary: test referenced additionalProperties + description: '' + operationId: testAdditionalPropertiesReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request much reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: requiredNotNullable + in: query + required: true + explode: true + schema: + type: string + nullable: false + - name: requiredNullable + in: query + required: true + explode: true + schema: + type: string + nullable: true + - name: notRequiredNotNullable + in: query + required: false + explode: true + schema: + type: string + nullable: false + - name: notRequiredNullable + in: query + required: false + explode: true + schema: + type: string + nullable: true + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: + # Export data as Excel spreadsheet. + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/array-of-enums: + get: + tags: + - fake + summary: Array of Enums + operationId: getArrayOfEnums + responses: + 200: + description: Got named array of enums + content: + application/json: + schema: + $ref: '#/components/schemas/ArrayOfEnums' + /fake/mixed/anyOf: + get: + tags: + - fake + summary: Test mixed type anyOf deserialization + operationId: getMixedAnyOf + responses: + 200: + description: Got mixed anyOf + content: + application/json: + schema: + $ref: '#/components/schemas/MixedAnyOf' + /fake/mixed/oneOf: + get: + tags: + - fake + summary: Test mixed type oneOf deserialization + operationId: getMixedOneOf + responses: + 200: + description: Got mixed oneOf + content: + application/json: + schema: + $ref: '#/components/schemas/MixedOneOf' + /country: + post: + operationId: getCountry + requestBody: + content: + application/x-www-form-urlencoded: + schema: + allOf: + - required: + - country + type: object + properties: + country: + type: string + responses: + '200': + description: OK + /test: + get: + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/notificationtest-getElements-v1-Response-mPayload' + description: Successful response + operationId: Test + summary: Retrieve an existing Notificationtest's Elements +servers: + - url: 'http://localhost/v2' + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_variable + description: The local server without variables +components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/User' + examples: + simple-list: + summary: Simple list example + description: Should not get into code examples + value: + - username: foo + - username: bar + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: 'http://petstore.swagger.io/api/oauth/dialog' + scopes: + 'write:pets': modify pets in your account + 'read:pets': read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + # Test the 'HTTP signature' security scheme. + # Each HTTP request is cryptographically signed as specified + # in https://datatracker.ietf.org/doc/draft-cavage-http-signatures/ + type: http + scheme: signature + schemas: + RolesReport: + description: Roles report + type: array + items: + $ref: '#/components/schemas/RolesReportsHash' + RolesReportsHash: + description: Role report Hash + type: object + properties: + role_uuid: + type: string + format: uuid + role: + type: object + properties: + name: + type: string + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + example: '2020-02-02T20:20:20.000222Z' + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + objectWithNoDeclaredProps: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for objects + Value must be a map of strings to values. It cannot be the 'null' value. + objectWithNoDeclaredPropsNullable: + type: object + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + description: test code generation for nullable objects. + Value must be a map of strings to values or the 'null' value. + nullable: true + anyTypeProp: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + See https://github.com/OAI/OpenAPI-Specification/issues/1389 + # TODO: this should be supported, currently there are some issues in the code generation. + #anyTypeExceptNullProp: + # description: any type except 'null' + # Here the 'type' attribute is not specified, which means the value can be anything, + # including the null value, string, number, boolean, array or object. + # not: + # type: 'null' + anyTypePropNullable: + description: test code generation for any type + Here the 'type' attribute is not specified, which means the value can be anything, + including the null value, string, number, boolean, array or object. + The 'nullable' attribute does not change the allowed values. + nullable: true + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - $ref: '#/components/schemas/Address' + - type: object + properties: + declawed: + type: boolean + Address: + type: object + additionalProperties: + type: integer + Animal: + type: object + discriminator: + propertyName: className + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + multipleOf: 2 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + unsigned_integer: + type: integer + format: int32 + maximum: 200 + minimum: 20 + x-unsigned: true + int64: + type: integer + format: int64 + unsigned_long: + type: integer + format: int64 + x-unsigned: true + number: + maximum: 543.2 + minimum: 32.1 + type: number + multipleOf: 32.5 + float: + type: number + format: float + maximum: 987.6 + minimum: 54.3 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + example: '2020-02-02' + dateTime: + type: string + format: date-time + example: '2007-12-03T10:15:30+01:00' + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + pattern_with_backslash: + description: None + type: string + pattern: '^(([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Outer_Enum_Test: + type: string + enum: + - UPPER + - lower + - '' + - "Value\twith tab" + - 'Value with " quote' + - 'Value with escaped \" quote' + - "Duplicate\nvalue" + - "Duplicate\r\nvalue" + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + - "Value\twith tab" + - 'Value with " quote' + - 'Value with escaped \" quote' + - "Duplicate\nvalue" + - "Duplicate\r\nvalue" + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + - "Value\twith tab" + - 'Value with " quote' + - 'Value with escaped \" quote' + - "Duplicate\nvalue" + - "Duplicate\r\nvalue" + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_integer_only: + type: integer + enum: + - 2 + - -2 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + anytype_1: {} + map_with_undeclared_properties_anytype_1: + type: object + map_with_undeclared_properties_anytype_2: + type: object + properties: {} + map_with_undeclared_properties_anytype_3: + type: object + additionalProperties: true + empty_map: + type: object + description: an object with no declared properties and no undeclared + properties, hence it's an empty map. + additionalProperties: false + map_with_undeclared_properties_string: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid_with_pattern: + type: string + format: uuid + pattern: "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + x-cls-compliant: true + x-com-visible: true + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + FreeFormObject: + type: object + description: A schema consisting only of additional properties + additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + '_special_model.name_': + type: string + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + RequiredClass: + type: object + properties: + required_nullable_integer_prop: + type: integer + nullable: true + required_notnullableinteger_prop: + type: integer + nullable: false + not_required_nullable_integer_prop: + type: integer + nullable: true + not_required_notnullableinteger_prop: + type: integer + nullable: false + + required_nullable_string_prop: + type: string + nullable: true + required_notnullable_string_prop: + type: string + nullable: false + notrequired_nullable_string_prop: + type: string + nullable: true + notrequired_notnullable_string_prop: + type: string + nullable: false + + required_nullable_boolean_prop: + type: boolean + nullable: true + required_notnullable_boolean_prop: + type: boolean + nullable: false + notrequired_nullable_boolean_prop: + type: boolean + nullable: true + notrequired_notnullable_boolean_prop: + type: boolean + nullable: false + + required_nullable_date_prop: + type: string + format: date + nullable: true + required_not_nullable_date_prop: + type: string + format: date + nullable: false + not_required_nullable_date_prop: + type: string + format: date + nullable: true + not_required_notnullable_date_prop: + type: string + format: date + nullable: false + + required_notnullable_datetime_prop: + type: string + format: date-time + nullable: false + required_nullable_datetime_prop: + type: string + format: date-time + nullable: true + notrequired_nullable_datetime_prop: + type: string + format: date-time + nullable: true + notrequired_notnullable_datetime_prop: + type: string + format: date-time + nullable: false + + required_nullable_enum_integer: + type: integer + format: int32 + nullable: true + enum: + - 1 + - -1 + required_notnullable_enum_integer: + type: integer + format: int32 + nullable: false + enum: + - 1 + - -1 + notrequired_nullable_enum_integer: + type: integer + format: int32 + nullable: true + enum: + - 1 + - -1 + notrequired_notnullable_enum_integer: + type: integer + format: int32 + nullable: false + enum: + - 1 + - -1 + + required_nullable_enum_integer_only: + type: integer + nullable: true + enum: + - 2 + - -2 + required_notnullable_enum_integer_only: + type: integer + nullable: false + enum: + - 2 + - -2 + notrequired_nullable_enum_integer_only: + type: integer + nullable: true + enum: + - 2 + - -2 + notrequired_notnullable_enum_integer_only: + type: integer + nullable: false + enum: + - 2 + - -2 + + required_notnullable_enum_string: + type: string + nullable: false + enum: + - UPPER + - lower + - '' + - "Value\twith tab" + - 'Value with " quote' + - 'Value with escaped \" quote' + - "Duplicate\nvalue" + - "Duplicate\r\nvalue" + required_nullable_enum_string: + type: string + nullable: true + enum: + - UPPER + - lower + - '' + - "Value\twith tab" + - 'Value with " quote' + - 'Value with escaped \" quote' + - "Duplicate\nvalue" + - "Duplicate\r\nvalue" + notrequired_nullable_enum_string: + type: string + nullable: true + enum: + - UPPER + - lower + - '' + - "Value\twith tab" + - 'Value with " quote' + - 'Value with escaped \" quote' + - "Duplicate\nvalue" + - "Duplicate\r\nvalue" + notrequired_notnullable_enum_string: + type: string + nullable: false + enum: + - UPPER + - lower + - '' + - "Value\twith tab" + - 'Value with " quote' + - 'Value with escaped \" quote' + - "Duplicate\nvalue" + - "Duplicate\r\nvalue" + + required_nullable_outerEnumDefaultValue: + nullable: true + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + required_notnullable_outerEnumDefaultValue: + nullable: false + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + notrequired_nullable_outerEnumDefaultValue: + nullable: true + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + notrequired_notnullable_outerEnumDefaultValue: + nullable: false + allOf: + - $ref: '#/components/schemas/OuterEnumDefaultValue' + + required_nullable_uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + nullable: true + required_notnullable_uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + nullable: false + notrequired_nullable_uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + nullable: true + notrequired_notnullable_uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + nullable: false + + required_nullable_array_of_string: + type: array + nullable: true + items: + type: string + required_notnullable_array_of_string: + type: array + nullable: false + items: + type: string + notrequired_nullable_array_of_string: + type: array + nullable: true + items: + type: string + notrequired_notnullable_array_of_string: + type: array + nullable: false + items: + type: string + required: + - required_nullable_boolean_prop + - required_notnullable_boolean_prop + - required_nullable_string_prop + - required_notnullable_string_prop + - required_nullable_integer_prop + - required_notnullableinteger_prop + - required_nullable_date_prop + - required_not_nullable_date_prop + - required_notnullable_datetime_prop + - required_nullable_datetime_prop + - required_nullable_enum_integer + - required_notnullable_enum_integer + - required_nullable_enum_integer_only + - required_notnullable_enum_integer_only + - required_notnullable_enum_string + - required_nullable_enum_string + - required_nullable_outerEnumDefaultValue + - required_notnullable_outerEnumDefaultValue + - required_nullable_uuid + - required_notnullable_uuid + - required_nullable_array_of_string + - required_notnullable_array_of_string + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + fruit: + properties: + color: + type: string + oneOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + # Below additionalProperties is set to false to validate the use + # case when a composed schema has additionalProperties set to false. + additionalProperties: false + apple: + type: object + properties: + cultivar: + type: string + pattern: ^[a-zA-Z\s]*$ + origin: + type: string + pattern: /^[A-Z\s]*$/i + color_code: + type: string + pattern: ^#(([0-9a-fA-F]{2}){3}|([0-9a-fA-F]){3})$ + nullable: true + banana: + type: object + properties: + lengthCm: + type: number + mammal: + oneOf: + - $ref: '#/components/schemas/whale' + - $ref: '#/components/schemas/zebra' + - $ref: '#/components/schemas/Pig' + discriminator: + propertyName: className + whale: + type: object + properties: + hasBaleen: + type: boolean + hasTeeth: + type: boolean + className: + type: string + required: + - className + zebra: + type: object + properties: + type: + type: string + enum: + - plains + - mountain + - grevys + className: + type: string + required: + - className + additionalProperties: true + Pig: + oneOf: + - $ref: '#/components/schemas/BasquePig' + - $ref: '#/components/schemas/DanishPig' + discriminator: + propertyName: className + BasquePig: + type: object + properties: + className: + type: string + required: + - className + DanishPig: + type: object + properties: + className: + type: string + required: + - className + gmFruit: + properties: + color: + type: string + anyOf: + - $ref: '#/components/schemas/apple' + - $ref: '#/components/schemas/banana' + additionalProperties: false + fruitReq: + oneOf: + - type: 'null' + - $ref: '#/components/schemas/appleReq' + - $ref: '#/components/schemas/bananaReq' + additionalProperties: false + appleReq: + type: object + properties: + cultivar: + type: string + mealy: + type: boolean + required: + - cultivar + additionalProperties: false + bananaReq: + type: object + properties: + lengthCm: + type: number + sweet: + type: boolean + required: + - lengthCm + additionalProperties: false + # go-experimental is unable to make Triangle and Quadrilateral models + # correctly https://github.com/OpenAPITools/openapi-generator/issues/6149 + Drawing: + type: object + properties: + mainShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value cannot be null. + $ref: '#/components/schemas/Shape' + shapeOrNull: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because ShapeOrNull has 'null' + # type as a child schema of 'oneOf'. + $ref: '#/components/schemas/ShapeOrNull' + nullableShape: + # A property whose value is a 'oneOf' type, and the type is referenced instead + # of being defined inline. The value may be null because NullableShape has the + # 'nullable: true' attribute. For this specific scenario this is exactly the + # same thing as 'shapeOrNull'. + $ref: '#/components/schemas/NullableShape' + shapes: + type: array + items: + $ref: '#/components/schemas/Shape' + additionalProperties: + # Here the additional properties are specified using a referenced schema. + # This is just to validate the generated code works when using $ref + # under 'additionalProperties'. + $ref: '#/components/schemas/fruit' + Shape: + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + ShapeOrNull: + description: The value may be a shape or the 'null' value. + This is introduced in OAS schema >= 3.1. + oneOf: + - type: 'null' + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + NullableShape: + description: The value may be a shape or the 'null' value. + The 'nullable' attribute was introduced in OAS schema >= 3.0 + and has been deprecated in OAS schema >= 3.1. + oneOf: + - $ref: '#/components/schemas/Triangle' + - $ref: '#/components/schemas/Quadrilateral' + discriminator: + propertyName: shapeType + nullable: true + ShapeInterface: + properties: + shapeType: + type: string + required: + - shapeType + TriangleInterface: + properties: + triangleType: + type: string + required: + - triangleType + Triangle: + oneOf: + - $ref: '#/components/schemas/EquilateralTriangle' + - $ref: '#/components/schemas/IsoscelesTriangle' + - $ref: '#/components/schemas/ScaleneTriangle' + discriminator: + propertyName: triangleType + # Note: the 'additionalProperties' keyword is not specified, which is + # equivalent to allowing undeclared properties of any type. + EquilateralTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + IsoscelesTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + additionalProperties: false + ScaleneTriangle: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/TriangleInterface' + QuadrilateralInterface: + properties: + quadrilateralType: + type: string + required: + - quadrilateralType + Quadrilateral: + oneOf: + - $ref: '#/components/schemas/SimpleQuadrilateral' + - $ref: '#/components/schemas/ComplexQuadrilateral' + discriminator: + propertyName: quadrilateralType + SimpleQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + ComplexQuadrilateral: + allOf: + - $ref: '#/components/schemas/ShapeInterface' + - $ref: '#/components/schemas/QuadrilateralInterface' + GrandparentAnimal: + type: object + required: + - pet_type + properties: + pet_type: + type: string + discriminator: + propertyName: pet_type + ParentPet: + type: object + allOf: + - $ref: '#/components/schemas/GrandparentAnimal' + ChildCat: + allOf: + - $ref: '#/components/schemas/ParentPet' + - type: object + properties: + name: + type: string + pet_type: + x-enum-as-string: true + type: string + enum: + - ChildCat + default: ChildCat + required: + - pet_type + ArrayOfEnums: + type: array + items: + $ref: '#/components/schemas/OuterEnum' + DateTimeTest: + type: string + default: '2010-01-01T10:10:10.000111+01:00' + example: '2010-01-01T10:10:10.000111+01:00' + format: date-time + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + PolymorphicProperty: + oneOf: + - type: boolean + - type: string + - type: object + - type: array + items: + $ref: '#/components/schemas/StringArrayItem' + StringArrayItem: + type: string + format: string + Activity: + description: "test map of maps" + type: object + properties: + activity_outputs: + type: object + additionalProperties: + $ref: '#/components/schemas/ActivityOutputRepresentation' + ActivityOutputRepresentation: + type: array + items: + $ref: '#/components/schemas/ActivityOutputElementRepresentation' + ActivityOutputElementRepresentation: + type: object + properties: + prop1: + type: string + prop2: + type: object + NullableGuidClass: + type: object + properties: + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + nullable: true + DateOnlyClass: + type: object + properties: + dateOnlyProperty: + type: string + format: date + example: "2017-07-21" + TestCollectionEndingWithWordListObject: + type: object + properties: + TestCollectionEndingWithWordList: + type: array + items: + $ref: '#/components/schemas/TestCollectionEndingWithWordList' + TestCollectionEndingWithWordList: + type: object + properties: + value: + type: string + LiteralStringClass: + type: object + properties: + escapedLiteralString: + type: string + default: C:\\Users\\username + unescapedLiteralString: + type: string + default: C:\Users\username + OneOfString: + oneOf: + - type: string + pattern: ^a + - type: string + pattern: ^b + ZeroBasedEnum: + type: string + enum: + - unknown + - notUnknown + ZeroBasedEnumClass: + type: object + properties: + ZeroBasedEnum: + type: string + enum: + - unknown + - notUnknown + Custom-Variableobject-Response: + description: A Variable object without predefined property names + type: object + additionalProperties: true + Field-pkiNotificationtestID: + type: integer + notificationtest-getElements-v1-Response-mPayload: + required: + - pkiNotificationtestID + - a_objVariableobject + type: object + properties: + pkiNotificationtestID: + $ref: '#/components/schemas/Field-pkiNotificationtestID' + a_objVariableobject: + type: array + items: + $ref: '#/components/schemas/Custom-Variableobject-Response' + MixedOneOf: + properties: + content: + oneOf: + - type: string + - type: boolean + # JsonReader will give back C# System.Int64 regardless of format. + - type: integer + format: uint8 + # JsonReader will give back C# System.Double regardless of format. + - type: number + format: float32 + - type: object + $ref: '#/components/schemas/MixedSubId' + description: Mixed oneOf types for testing + MixedAnyOf: + properties: + content: + anyOf: + - type: string + - type: boolean + # JsonReader will give back C# System.Int64 regardless of format. + - type: integer + format: uint8 + # JsonReader will give back C# System.Double regardless of format. + - type: number + format: float32 + - type: object + $ref: '#/components/schemas/MixedSubId' + + description: Mixed anyOf types for testing + MixedSubId: + properties: + id: + type: string diff --git a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator-ignore b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator-ignore index 1e0b5c7bb7f0..366f7ae4c39f 100644 --- a/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator-ignore +++ b/samples/client/petstore/csharp/httpclient/standard2.0/Petstore/.openapi-generator-ignore @@ -22,3 +22,6 @@ # Then explicitly reverse the ignore rule for a single file: #!docs/README.md src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj + + + diff --git a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/.openapi-generator-ignore b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/.openapi-generator-ignore index 7484ee590a38..c5b04829c20a 100644 --- a/samples/client/petstore/csharp/restsharp/net4.7/Petstore/.openapi-generator-ignore +++ b/samples/client/petstore/csharp/restsharp/net4.7/Petstore/.openapi-generator-ignore @@ -21,3 +21,6 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md +# +# +# diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/.openapi-generator-ignore b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/.openapi-generator-ignore index d323263b54ed..cfa01a6287a0 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/.openapi-generator-ignore +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/.openapi-generator-ignore @@ -2,3 +2,5 @@ # This test file has changes required for testing and should not be overwritten src/Org.OpenAPITools.Test/Org.OpenAPITools.Test.csproj + + diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/README.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/README.md index 6ec6a9c7c23d..c28d41f63619 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/README.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/README.md @@ -75,7 +75,7 @@ namespace Example { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new AnotherFakeApi(config); var modelClient = new ModelClient(); // ModelClient | client model @@ -100,7 +100,7 @@ namespace Example ## Documentation for API Endpoints -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml index 886c93019332..16251878c7d2 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/api/openapi.yaml @@ -9,6 +9,7 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: +- url: http://localhost/v2 - description: petstore server url: "http://{server}.swagger.io:{port}/v2" variables: @@ -114,6 +115,7 @@ paths: tags: - pet servers: + - url: http://localhost/v2 - url: http://petstore.swagger.io/v2 - url: http://path-server-test.petstore.local/v2 /pet/findByStatus: diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/AnotherFakeApi.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/AnotherFakeApi.md index 01da3a93e620..3ae670d20f7d 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/AnotherFakeApi.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/AnotherFakeApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.AnotherFakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -29,7 +29,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new AnotherFakeApi(config); var modelClient = new ModelClient(); // ModelClient | client model diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/DefaultApi.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/DefaultApi.md index d9d4abc6ebbc..87a8c5000dfd 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/DefaultApi.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/DefaultApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.DefaultApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -31,7 +31,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try @@ -113,7 +113,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); var country = "country_example"; // string | @@ -198,7 +198,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try @@ -282,7 +282,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try @@ -364,7 +364,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new DefaultApi(config); try diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeApi.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeApi.md index 06309f31e8a5..255136e959ee 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeApi.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.FakeApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -46,7 +46,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -132,7 +132,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var body = true; // bool? | Input boolean as post body (optional) @@ -221,7 +221,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var outerComposite = new OuterComposite(); // OuterComposite | Input composite as post body (optional) @@ -310,7 +310,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var body = 8.14D; // decimal? | Input number as post body (optional) @@ -399,7 +399,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requiredStringUuid = "requiredStringUuid_example"; // Guid | Required UUID String var body = "body_example"; // string | Input string as post body (optional) @@ -488,7 +488,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -572,7 +572,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -656,7 +656,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); try @@ -740,7 +740,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requestBody = new Dictionary(); // Dictionary | request body @@ -827,7 +827,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var fileSchemaTestClass = new FileSchemaTestClass(); // FileSchemaTestClass | @@ -910,7 +910,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var query = "query_example"; // string | var user = new User(); // User | @@ -997,7 +997,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var modelClient = new ModelClient(); // ModelClient | client model @@ -1088,7 +1088,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure HTTP basic authorization: http_basic_test config.Username = "YOUR_USERNAME"; config.Password = "YOUR_PASSWORD"; @@ -1206,7 +1206,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var enumHeaderStringArray = new List(); // List | Header parameter enum test (string array) (optional) var enumHeaderString = "_abc"; // string | Header parameter enum test (string) (optional) (default to -efg) @@ -1308,7 +1308,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure Bearer token for authorization: bearer_test config.AccessToken = "YOUR_BEARER_TOKEN"; @@ -1406,7 +1406,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requestBody = new Dictionary(); // Dictionary | request body @@ -1491,7 +1491,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var testInlineFreeformAdditionalPropertiesRequest = new TestInlineFreeformAdditionalPropertiesRequest(); // TestInlineFreeformAdditionalPropertiesRequest | request body @@ -1576,7 +1576,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var param = "param_example"; // string | field1 var param2 = "param2_example"; // string | field2 @@ -1665,7 +1665,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var pipe = new List(); // List | var ioutil = new List(); // List | @@ -1764,7 +1764,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new FakeApi(config); var requestBody = new Dictionary(); // Dictionary | request body diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeClassnameTags123Api.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeClassnameTags123Api.md index 17c4f35d8a39..5c9c261f72c0 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeClassnameTags123Api.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/FakeClassnameTags123Api.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.FakeClassnameTags123Api -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -29,7 +29,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure API key authorization: api_key_query config.AddApiKey("api_key_query", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/PetApi.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/PetApi.md index 220b1ae30105..deafe1a5653e 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/PetApi.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/PetApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.PetApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -35,7 +35,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -123,7 +123,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -215,7 +215,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -310,7 +310,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -405,7 +405,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure API key authorization: api_key config.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed @@ -505,7 +505,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -595,7 +595,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -687,7 +687,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; @@ -783,7 +783,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure OAuth2 access token for authorization: petstore_auth config.AccessToken = "YOUR_ACCESS_TOKEN"; diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/StoreApi.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/StoreApi.md index 179da0ff637e..c89ac7ed28b5 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/StoreApi.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/StoreApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.StoreApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -32,7 +32,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new StoreApi(config); var orderId = "orderId_example"; // string | ID of the order that needs to be deleted @@ -120,7 +120,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; // Configure API key authorization: api_key config.AddApiKey("api_key", "YOUR_API_KEY"); // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed @@ -211,7 +211,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new StoreApi(config); var orderId = 789L; // long | ID of pet that needs to be fetched @@ -302,7 +302,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new StoreApi(config); var order = new Order(); // Order | order placed for purchasing the pet diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/UserApi.md b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/UserApi.md index 7b8439c45411..414907dcc216 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/UserApi.md +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/docs/UserApi.md @@ -1,6 +1,6 @@ # Org.OpenAPITools.Api.UserApi -All URIs are relative to *http://petstore.swagger.io:80/v2* +All URIs are relative to *http://localhost/v2* | Method | HTTP request | Description | |--------|--------------|-------------| @@ -36,7 +36,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); var user = new User(); // User | Created user object @@ -121,7 +121,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); var user = new List(); // List | List of user object @@ -206,7 +206,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); var user = new List(); // List | List of user object @@ -293,7 +293,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); var username = "username_example"; // string | The name that needs to be deleted @@ -379,7 +379,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); var username = "username_example"; // string | The name that needs to be fetched. Use user1 for testing. @@ -472,7 +472,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); var username = "username_example"; // string | The user name for login var password = "password_example"; // string | The password for login in clear text @@ -564,7 +564,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); try @@ -646,7 +646,7 @@ namespace Example public static void Main() { Configuration config = new Configuration(); - config.BasePath = "http://petstore.swagger.io:80/v2"; + config.BasePath = "http://localhost/v2"; var apiInstance = new UserApi(config); var username = "username_example"; // string | name that need to be deleted var user = new User(); // User | Updated user object diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/ConfigurationTests.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/ConfigurationTests.cs index 5dde15c5b630..2111b10d5817 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/ConfigurationTests.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools.Test/ConfigurationTests.cs @@ -42,16 +42,16 @@ public void GetServerUrlTest() { Configuration c = new Configuration(); // no variable (null) provided - Assert.Equal("https://localhost:8080/v2", c.GetServerUrl(1, null)); + Assert.Equal("https://localhost:8080/v2", c.GetServerUrl(2, null)); // no variable (empty dictionary) provided - Assert.Equal("https://localhost:8080/v2", c.GetServerUrl(1, new Dictionary())); + Assert.Equal("https://localhost:8080/v2", c.GetServerUrl(2, new Dictionary())); - Assert.Equal("https://localhost:8080/v1", c.GetServerUrl(1, new Dictionary() { { "version", "v1" } })); + Assert.Equal("https://localhost:8080/v1", c.GetServerUrl(2, new Dictionary() { { "version", "v1" } })); - Assert.Throws(() => c.GetServerUrl(1, new Dictionary() { { "version", "v3" } })); + Assert.Throws(() => c.GetServerUrl(2, new Dictionary() { { "version", "v3" } })); // test the first server (index 0) - Assert.Equal("http://petstore.swagger.io:80/v2", c.GetServerUrl(0)); + Assert.Equal("http://petstore.swagger.io:80/v2", c.GetServerUrl(1)); } } diff --git a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs index 3ea2a481c169..5c51f02dec47 100644 --- a/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs +++ b/samples/client/petstore/csharp/restsharp/standard2.0/Petstore/src/Org.OpenAPITools/Client/Configuration.cs @@ -119,12 +119,18 @@ public Configuration() { Proxy = null; UserAgent = WebUtility.UrlEncode("OpenAPI-Generator/1.0.0/csharp"); - BasePath = "http://petstore.swagger.io:80/v2"; + BasePath = "http://localhost/v2"; DefaultHeaders = new ConcurrentDictionary(); ApiKey = new ConcurrentDictionary(); ApiKeyPrefix = new ConcurrentDictionary(); Servers = new List>() { + { + new Dictionary { + {"url", "http://localhost/v2"}, + {"description", "No description provided"}, + } + }, { new Dictionary { {"url", "http://{server}.swagger.io:{port}/v2"}, @@ -194,6 +200,13 @@ public Configuration() { "PetApi.AddPet", new List> { + { + new Dictionary + { + {"url", "http://localhost/v2"}, + {"description", "No description provided"} + } + }, { new Dictionary { @@ -213,6 +226,13 @@ public Configuration() { "PetApi.UpdatePet", new List> { + { + new Dictionary + { + {"url", "http://localhost/v2"}, + {"description", "No description provided"} + } + }, { new Dictionary { @@ -243,7 +263,7 @@ public Configuration( IDictionary defaultHeaders, IDictionary apiKey, IDictionary apiKeyPrefix, - string basePath = "http://petstore.swagger.io:80/v2") : this() + string basePath = "http://localhost/v2") : this() { if (string.IsNullOrWhiteSpace(basePath)) throw new ArgumentException("The provided basePath is invalid.", "basePath");