diff --git a/bin/go-gin-petstore-server.sh b/bin/go-gin-petstore-server.sh index 98dd63100a22..bbd7cda31648 100755 --- a/bin/go-gin-petstore-server.sh +++ b/bin/go-gin-petstore-server.sh @@ -25,7 +25,7 @@ then mvn -B clean package fi -SPEC="modules/openapi-generator/src/test/resources/2_0/petstore.yaml" +SPEC="modules/openapi-generator/src/test/resources/3_0/petstore.yaml" GENERATOR="go-gin-server" STUB_DIR="samples/server/petstore/go-gin-api-server" diff --git a/bin/go-petstore-server.sh b/bin/go-petstore-server.sh index e8ac83eba825..d58365c5dbe8 100755 --- a/bin/go-petstore-server.sh +++ b/bin/go-petstore-server.sh @@ -25,7 +25,7 @@ then mvn -B clean package fi -SPEC="modules/openapi-generator/src/test/resources/2_0/petstore.yaml" +SPEC="modules/openapi-generator/src/test/resources/3_0/petstore.yaml" GENERATOR="go-server" STUB_DIR="samples/server/petstore/go-api-server" diff --git a/bin/windows/go-gin-petstore-server.bat b/bin/windows/go-gin-petstore-server.bat index 894976e9991e..1085b4e94188 100644 --- a/bin/windows/go-gin-petstore-server.bat +++ b/bin/windows/go-gin-petstore-server.bat @@ -6,7 +6,7 @@ If Not Exist %executable% ( mvn clean package ) -set SPEC=modules\openapi-generator\src\test\resources\2_0\petstore.yaml +set SPEC=modules\openapi-generator\src\test\resources\3_0\petstore.yaml set GENERATOR=go-gin-server set STUB_DIR=samples\server\petstore\go-gin-api-server diff --git a/bin/windows/go-petstore-server.bat b/bin/windows/go-petstore-server.bat index e520f5b252a8..32ab6977d2f2 100644 --- a/bin/windows/go-petstore-server.bat +++ b/bin/windows/go-petstore-server.bat @@ -6,7 +6,7 @@ If Not Exist %executable% ( mvn clean package ) -set SPEC=modules\openapi-generator\src\test\resources\2_0\petstore.yaml +set SPEC=modules\openapi-generator\src\test\resources\3_0\petstore.yaml set GENERATOR=go-server set STUB_DIR=samples\server\petstore\go-api-server diff --git a/samples/openapi3/server/petstore/go-api-server/.openapi-generator-ignore b/samples/openapi3/server/petstore/go-api-server/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION deleted file mode 100644 index 58592f031f65..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/go-api-server/Dockerfile b/samples/openapi3/server/petstore/go-api-server/Dockerfile deleted file mode 100644 index cfdfbaed0804..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/Dockerfile +++ /dev/null @@ -1,14 +0,0 @@ -FROM golang:1.10 AS build -WORKDIR /go/src -COPY go ./go -COPY main.go . - -ENV CGO_ENABLED=0 -RUN go get -d -v ./... - -RUN go build -a -installsuffix cgo -o petstoreserver . - -FROM scratch AS runtime -COPY --from=build /go/src/petstoreserver ./ -EXPOSE 8080/tcp -ENTRYPOINT ["./petstoreserver"] diff --git a/samples/openapi3/server/petstore/go-api-server/README.md b/samples/openapi3/server/petstore/go-api-server/README.md deleted file mode 100644 index c8907b0052e9..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/README.md +++ /dev/null @@ -1,35 +0,0 @@ -# Go API Server for petstoreserver - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This server was generated by the [openapi-generator] -(https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. -- - -To see how to make this your own, look here: - -[README](https://openapi-generator.tech) - -- API version: 1.0.0 - - -### Running the server -To run the server, follow these simple steps: - -``` -go run main.go -``` - -To run the server in a docker container -``` -docker build --network=host -t petstoreserver . -``` - -Once image is built use -``` -docker run --rm -it petstoreserver -``` - - diff --git a/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml b/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml deleted file mode 100644 index 06a1bb8d4693..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/api/openapi.yaml +++ /dev/null @@ -1,2059 +0,0 @@ -openapi: 3.0.0 -info: - description: 'This spec is mainly for testing Petstore server and contains fake - endpoints, models. Please do not use this for any other purpose. Special characters: - " \' - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- description: petstore server - url: http://{server}.swagger.io:{port}/v2 - variables: - server: - default: petstore - enum: - - petstore - - qa-petstore - - dev-petstore - port: - default: "80" - enum: - - "80" - - "8080" -- description: The local server - url: https://localhost:8080/{version} - variables: - version: - default: v2 - enum: - - v1 - - v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /foo: - get: - responses: - default: - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_default' - description: response - /pet: - post: - operationId: addPet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - 405: - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - put: - operationId: updatePet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - 400: - description: Invalid ID supplied - 404: - description: Pet not found - 405: - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - servers: - - url: http://petstore.swagger.io/v2 - - url: http://path-server-test.petstore.local/v2 - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - 200: - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - 400: - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - /pet/findByTags: - get: - deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - style: form - responses: - 200: - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - 400: - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - explode: false - in: header - name: api_key - required: false - schema: - type: string - style: simple - - description: Pet id to delete - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - 400: - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - 400: - description: Invalid ID supplied - 404: - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object' - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - responses: - 405: - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_1' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - 200: - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - 400: - description: Invalid Order - summary: Place an order for a pet - tags: - - store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - explode: false - in: path - name: order_id - required: true - schema: - type: string - style: simple - responses: - 400: - description: Invalid ID supplied - 404: - description: Order not found - summary: Delete purchase order by ID - tags: - - store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - explode: false - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - style: simple - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - 400: - description: Invalid ID supplied - 404: - description: Order not found - summary: Find purchase order by ID - tags: - - store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - description: successful operation - summary: Create user - tags: - - user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - explode: true - in: query - name: username - required: true - schema: - type: string - style: form - - description: The password for login in clear text - explode: true - in: query - name: password - required: true - schema: - type: string - style: form - responses: - 200: - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - explode: false - schema: - format: int32 - type: integer - style: simple - X-Expires-After: - description: date in UTC when token expires - explode: false - schema: - format: date-time - type: string - style: simple - 400: - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - /user/logout: - get: - operationId: logoutUser - responses: - default: - description: successful operation - summary: Logs out current logged in user session - tags: - - user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - 400: - description: Invalid username supplied - 404: - description: User not found - summary: Delete user - tags: - - user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - 400: - description: Invalid username supplied - 404: - description: User not found - summary: Get user by user name - tags: - - user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - 400: - description: Invalid user supplied - 404: - description: User not found - summary: Updated user - tags: - - user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - explode: true - in: query - name: required_string_group - required: true - schema: - type: integer - style: form - - description: Required Boolean in group parameters - explode: false - in: header - name: required_boolean_group - required: true - schema: - type: boolean - style: simple - - description: Required Integer in group parameters - explode: true - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - style: form - - description: String in group parameters - explode: true - in: query - name: string_group - required: false - schema: - type: integer - style: form - - description: Boolean in group parameters - explode: false - in: header - name: boolean_group - required: false - schema: - type: boolean - style: simple - - description: Integer in group parameters - explode: true - in: query - name: int64_group - required: false - schema: - format: int64 - type: integer - style: form - responses: - 400: - description: Someting wrong - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - explode: false - in: header - name: enum_header_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: simple - - description: Query parameter enum test (string array) - explode: true - in: query - name: enum_query_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - explode: true - in: query - name: enum_query_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_integer - required: false - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_double - required: false - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - style: form - requestBody: - $ref: '#/components/requestBodies/inline_object_2' - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - responses: - 400: - description: Invalid request - 404: - description: Not found - summary: To test enum parameters - tags: - - fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - $ref: '#/components/requestBodies/inline_object_3' - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - responses: - 400: - description: Invalid username supplied - 404: - description: User not found - security: - - http_basic_test: [] - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - $ref: '#/components/requestBodies/inline_object_4' - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - responses: - 200: - description: successful operation - summary: test json serialization of form data - tags: - - fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - 200: - description: successful operation - summary: test inline additionalProperties - tags: - - fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - explode: true - in: query - name: query - required: true - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - 200: - description: Success - tags: - - fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - /fake/body-with-file-schema: - put: - description: For this test, the body for this request much reference a schema - named `File`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - 200: - description: Success - tags: - - fake - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: true - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - 200: - description: Success - tags: - - fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_5' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - /fake/health: - get: - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/HealthCheckResult' - description: The instance started successfully - summary: Health check endpoint - tags: - - fake -components: - requestBodies: - UserArray: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - Client: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - Pet: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' - schemas: - Foo: - example: - bar: bar - properties: - bar: - default: bar - type: string - type: object - Bar: - default: bar - type: string - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - 123Number: - readOnly: true - type: integer - required: - - name - xml: - name: Name - 200_response: - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ - type: string - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one - to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - outerEnumInteger: - $ref: '#/components/schemas/OuterEnumInteger' - outerEnumDefaultValue: - $ref: '#/components/schemas/OuterEnumDefaultValue' - outerEnumIntegerDefaultValue: - $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - 123-list: - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - nullable: true - type: string - OuterEnumInteger: - enum: - - 0 - - 1 - - 2 - type: integer - OuterEnumDefaultValue: - default: placed - enum: - - placed - - approved - - delivered - type: string - OuterEnumIntegerDefaultValue: - default: 0 - enum: - - 0 - - 1 - - 2 - type: integer - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - _special_model.name_: - properties: - $special[property.name]: - format: int64 - type: integer - xml: - name: $special[model.name] - HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable - in hope to get it as pointer in generated model. - example: - NullableMessage: NullableMessage - properties: - NullableMessage: - nullable: true - type: string - type: object - NullableClass: - additionalProperties: - nullable: true - type: object - properties: - integer_prop: - nullable: true - type: integer - number_prop: - nullable: true - type: number - boolean_prop: - nullable: true - type: boolean - string_prop: - nullable: true - type: string - date_prop: - format: date - nullable: true - type: string - datetime_prop: - format: date-time - nullable: true - type: string - array_nullable_prop: - items: - type: object - nullable: true - type: array - array_and_items_nullable_prop: - items: - nullable: true - type: object - nullable: true - type: array - array_items_nullable: - items: - nullable: true - type: object - type: array - object_nullable_prop: - additionalProperties: - type: object - nullable: true - type: object - object_and_items_nullable_prop: - additionalProperties: - nullable: true - type: object - nullable: true - type: object - object_items_nullable: - additionalProperties: - nullable: true - type: object - type: object - type: object - inline_response_default: - example: - string: - bar: bar - properties: - string: - $ref: '#/components/schemas/Foo' - inline_object: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - inline_object_1: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - inline_object_2: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - inline_object_3: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - inline_object_4: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - inline_object_5: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - Cat_allOf: - properties: - declawed: - type: boolean - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http - bearer_test: - bearerFormat: JWT - scheme: bearer - type: http diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_another_fake.go b/samples/openapi3/server/petstore/go-api-server/go/api_another_fake.go deleted file mode 100644 index 804316ecb215..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/api_another_fake.go +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// A AnotherFakeApiController binds http requests to an api service and writes the service results to the http response -type AnotherFakeApiController struct { - service AnotherFakeApiServicer -} - -// NewAnotherFakeApiController creates a default api controller -func NewAnotherFakeApiController(s AnotherFakeApiServicer) Router { - return &AnotherFakeApiController{ service: s } -} - -// Routes returns all of the api route for the AnotherFakeApiController -func (c *AnotherFakeApiController) Routes() Routes { - return Routes{ - { - "Call123TestSpecialTags", - strings.ToUpper("Patch"), - "/v2/another-fake/dummy", - c.Call123TestSpecialTags, - }, - } -} - -// Call123TestSpecialTags - To test special tags -func (c *AnotherFakeApiController) Call123TestSpecialTags(w http.ResponseWriter, r *http.Request) { - client := &Client{} - if err := json.NewDecoder(r.Body).Decode(&client); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.Call123TestSpecialTags(*client) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_default.go b/samples/openapi3/server/petstore/go-api-server/go/api_default.go deleted file mode 100644 index c1618f26c9c6..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/api_default.go +++ /dev/null @@ -1,51 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// A DefaultApiController binds http requests to an api service and writes the service results to the http response -type DefaultApiController struct { - service DefaultApiServicer -} - -// NewDefaultApiController creates a default api controller -func NewDefaultApiController(s DefaultApiServicer) Router { - return &DefaultApiController{ service: s } -} - -// Routes returns all of the api route for the DefaultApiController -func (c *DefaultApiController) Routes() Routes { - return Routes{ - { - "FooGet", - strings.ToUpper("Get"), - "/v2/foo", - c.FooGet, - }, - } -} - -// FooGet - -func (c *DefaultApiController) FooGet(w http.ResponseWriter, r *http.Request) { - result, err := c.service.FooGet() - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_fake.go b/samples/openapi3/server/petstore/go-api-server/go/api_fake.go deleted file mode 100644 index 94b55953254c..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/api_fake.go +++ /dev/null @@ -1,398 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// A FakeApiController binds http requests to an api service and writes the service results to the http response -type FakeApiController struct { - service FakeApiServicer -} - -// NewFakeApiController creates a default api controller -func NewFakeApiController(s FakeApiServicer) Router { - return &FakeApiController{ service: s } -} - -// Routes returns all of the api route for the FakeApiController -func (c *FakeApiController) Routes() Routes { - return Routes{ - { - "FakeHealthGet", - strings.ToUpper("Get"), - "/v2/fake/health", - c.FakeHealthGet, - }, - { - "FakeOuterBooleanSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/boolean", - c.FakeOuterBooleanSerialize, - }, - { - "FakeOuterCompositeSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/composite", - c.FakeOuterCompositeSerialize, - }, - { - "FakeOuterNumberSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/number", - c.FakeOuterNumberSerialize, - }, - { - "FakeOuterStringSerialize", - strings.ToUpper("Post"), - "/v2/fake/outer/string", - c.FakeOuterStringSerialize, - }, - { - "TestBodyWithFileSchema", - strings.ToUpper("Put"), - "/v2/fake/body-with-file-schema", - c.TestBodyWithFileSchema, - }, - { - "TestBodyWithQueryParams", - strings.ToUpper("Put"), - "/v2/fake/body-with-query-params", - c.TestBodyWithQueryParams, - }, - { - "TestClientModel", - strings.ToUpper("Patch"), - "/v2/fake", - c.TestClientModel, - }, - { - "TestEndpointParameters", - strings.ToUpper("Post"), - "/v2/fake", - c.TestEndpointParameters, - }, - { - "TestEnumParameters", - strings.ToUpper("Get"), - "/v2/fake", - c.TestEnumParameters, - }, - { - "TestGroupParameters", - strings.ToUpper("Delete"), - "/v2/fake", - c.TestGroupParameters, - }, - { - "TestInlineAdditionalProperties", - strings.ToUpper("Post"), - "/v2/fake/inline-additionalProperties", - c.TestInlineAdditionalProperties, - }, - { - "TestJsonFormData", - strings.ToUpper("Get"), - "/v2/fake/jsonFormData", - c.TestJsonFormData, - }, - { - "TestQueryParameterCollectionFormat", - strings.ToUpper("Put"), - "/v2/fake/test-query-paramters", - c.TestQueryParameterCollectionFormat, - }, - } -} - -// FakeHealthGet - Health check endpoint -func (c *FakeApiController) FakeHealthGet(w http.ResponseWriter, r *http.Request) { - result, err := c.service.FakeHealthGet() - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// FakeOuterBooleanSerialize - -func (c *FakeApiController) FakeOuterBooleanSerialize(w http.ResponseWriter, r *http.Request) { - body := &bool{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.FakeOuterBooleanSerialize(*body) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// FakeOuterCompositeSerialize - -func (c *FakeApiController) FakeOuterCompositeSerialize(w http.ResponseWriter, r *http.Request) { - outerComposite := &OuterComposite{} - if err := json.NewDecoder(r.Body).Decode(&outerComposite); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.FakeOuterCompositeSerialize(*outerComposite) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// FakeOuterNumberSerialize - -func (c *FakeApiController) FakeOuterNumberSerialize(w http.ResponseWriter, r *http.Request) { - body := &float32{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.FakeOuterNumberSerialize(*body) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// FakeOuterStringSerialize - -func (c *FakeApiController) FakeOuterStringSerialize(w http.ResponseWriter, r *http.Request) { - body := &string{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.FakeOuterStringSerialize(*body) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestBodyWithFileSchema - -func (c *FakeApiController) TestBodyWithFileSchema(w http.ResponseWriter, r *http.Request) { - fileSchemaTestClass := &FileSchemaTestClass{} - if err := json.NewDecoder(r.Body).Decode(&fileSchemaTestClass); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.TestBodyWithFileSchema(*fileSchemaTestClass) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestBodyWithQueryParams - -func (c *FakeApiController) TestBodyWithQueryParams(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - query := query.Get("query") - user := &User{} - if err := json.NewDecoder(r.Body).Decode(&user); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.TestBodyWithQueryParams(query, *user) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestClientModel - To test \"client\" model -func (c *FakeApiController) TestClientModel(w http.ResponseWriter, r *http.Request) { - client := &Client{} - if err := json.NewDecoder(r.Body).Decode(&client); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.TestClientModel(*client) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestEndpointParameters - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -func (c *FakeApiController) TestEndpointParameters(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - if err != nil { - w.WriteHeader(500) - return - } - - number := r.FormValue("number") - double := r.FormValue("double") - patternWithoutDelimiter := r.FormValue("patternWithoutDelimiter") - byte_ := r.FormValue("byte_") - integer := r.FormValue("integer") - int32_ := r.FormValue("int32_") - int64_, err := parseIntParameter( r.FormValue("int64_")) - if err != nil { - w.WriteHeader(500) - return - } - - float := r.FormValue("float") - string_ := r.FormValue("string_") - binary, err := ReadFormFileToTempFile(r, "binary") - if err != nil { - w.WriteHeader(500) - return - } - - date := r.FormValue("date") - dateTime := r.FormValue("dateTime") - password := r.FormValue("password") - callback := r.FormValue("callback") - result, err := c.service.TestEndpointParameters(number, double, patternWithoutDelimiter, byte_, integer, int32_, int64_, float, string_, binary, date, dateTime, password, callback) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestEnumParameters - To test enum parameters -func (c *FakeApiController) TestEnumParameters(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - if err != nil { - w.WriteHeader(500) - return - } - - query := r.URL.Query() - enumHeaderStringArray := r.Header.Get("enumHeaderStringArray") - enumHeaderString := r.Header.Get("enumHeaderString") - enumQueryStringArray := strings.Split(query.Get("enumQueryStringArray"), ",") - enumQueryString := query.Get("enumQueryString") - enumQueryInteger := query.Get("enumQueryInteger") - enumQueryDouble := query.Get("enumQueryDouble") - enumFormStringArray := r.FormValue("enumFormStringArray") - enumFormString := r.FormValue("enumFormString") - result, err := c.service.TestEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestGroupParameters - Fake endpoint to test group parameters (optional) -func (c *FakeApiController) TestGroupParameters(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - requiredStringGroup := query.Get("requiredStringGroup") - requiredBooleanGroup := r.Header.Get("requiredBooleanGroup") - requiredInt64Group, err := parseIntParameter(query.Get("requiredInt64Group")) - if err != nil { - w.WriteHeader(500) - return - } - - stringGroup := query.Get("stringGroup") - booleanGroup := r.Header.Get("booleanGroup") - int64Group, err := parseIntParameter(query.Get("int64Group")) - if err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.TestGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestInlineAdditionalProperties - test inline additionalProperties -func (c *FakeApiController) TestInlineAdditionalProperties(w http.ResponseWriter, r *http.Request) { - requestBody := &map[string]string{} - if err := json.NewDecoder(r.Body).Decode(&requestBody); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.TestInlineAdditionalProperties(*requestBody) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestJsonFormData - test json serialization of form data -func (c *FakeApiController) TestJsonFormData(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - if err != nil { - w.WriteHeader(500) - return - } - - param := r.FormValue("param") - param2 := r.FormValue("param2") - result, err := c.service.TestJsonFormData(param, param2) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// TestQueryParameterCollectionFormat - -func (c *FakeApiController) TestQueryParameterCollectionFormat(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - pipe := strings.Split(query.Get("pipe"), ",") - ioutil := strings.Split(query.Get("ioutil"), ",") - http := strings.Split(query.Get("http"), ",") - url := strings.Split(query.Get("url"), ",") - context := strings.Split(query.Get("context"), ",") - result, err := c.service.TestQueryParameterCollectionFormat(pipe, ioutil, http, url, context) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_fake_classname_tags123.go b/samples/openapi3/server/petstore/go-api-server/go/api_fake_classname_tags123.go deleted file mode 100644 index 998465c23a4c..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/api_fake_classname_tags123.go +++ /dev/null @@ -1,57 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// A FakeClassnameTags123ApiController binds http requests to an api service and writes the service results to the http response -type FakeClassnameTags123ApiController struct { - service FakeClassnameTags123ApiServicer -} - -// NewFakeClassnameTags123ApiController creates a default api controller -func NewFakeClassnameTags123ApiController(s FakeClassnameTags123ApiServicer) Router { - return &FakeClassnameTags123ApiController{ service: s } -} - -// Routes returns all of the api route for the FakeClassnameTags123ApiController -func (c *FakeClassnameTags123ApiController) Routes() Routes { - return Routes{ - { - "TestClassname", - strings.ToUpper("Patch"), - "/v2/fake_classname_test", - c.TestClassname, - }, - } -} - -// TestClassname - To test class name in snake case -func (c *FakeClassnameTags123ApiController) TestClassname(w http.ResponseWriter, r *http.Request) { - client := &Client{} - if err := json.NewDecoder(r.Body).Decode(&client); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.TestClassname(*client) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_pet.go b/samples/openapi3/server/petstore/go-api-server/go/api_pet.go deleted file mode 100644 index 867c12e08952..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/api_pet.go +++ /dev/null @@ -1,273 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// A PetApiController binds http requests to an api service and writes the service results to the http response -type PetApiController struct { - service PetApiServicer -} - -// NewPetApiController creates a default api controller -func NewPetApiController(s PetApiServicer) Router { - return &PetApiController{ service: s } -} - -// Routes returns all of the api route for the PetApiController -func (c *PetApiController) Routes() Routes { - return Routes{ - { - "AddPet", - strings.ToUpper("Post"), - "/v2/pet", - c.AddPet, - }, - { - "DeletePet", - strings.ToUpper("Delete"), - "/v2/pet/{petId}", - c.DeletePet, - }, - { - "FindPetsByStatus", - strings.ToUpper("Get"), - "/v2/pet/findByStatus", - c.FindPetsByStatus, - }, - { - "FindPetsByTags", - strings.ToUpper("Get"), - "/v2/pet/findByTags", - c.FindPetsByTags, - }, - { - "GetPetById", - strings.ToUpper("Get"), - "/v2/pet/{petId}", - c.GetPetById, - }, - { - "UpdatePet", - strings.ToUpper("Put"), - "/v2/pet", - c.UpdatePet, - }, - { - "UpdatePetWithForm", - strings.ToUpper("Post"), - "/v2/pet/{petId}", - c.UpdatePetWithForm, - }, - { - "UploadFile", - strings.ToUpper("Post"), - "/v2/pet/{petId}/uploadImage", - c.UploadFile, - }, - { - "UploadFileWithRequiredFile", - strings.ToUpper("Post"), - "/v2/fake/{petId}/uploadImageWithRequiredFile", - c.UploadFileWithRequiredFile, - }, - } -} - -// AddPet - Add a new pet to the store -func (c *PetApiController) AddPet(w http.ResponseWriter, r *http.Request) { - pet := &Pet{} - if err := json.NewDecoder(r.Body).Decode(&pet); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.AddPet(*pet) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// DeletePet - Deletes a pet -func (c *PetApiController) DeletePet(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - petId, err := parseIntParameter(params["petId"]) - if err != nil { - w.WriteHeader(500) - return - } - - apiKey := r.Header.Get("apiKey") - result, err := c.service.DeletePet(petId, apiKey) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// FindPetsByStatus - Finds Pets by status -func (c *PetApiController) FindPetsByStatus(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - status := strings.Split(query.Get("status"), ",") - result, err := c.service.FindPetsByStatus(status) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// FindPetsByTags - Finds Pets by tags -func (c *PetApiController) FindPetsByTags(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - tags := strings.Split(query.Get("tags"), ",") - result, err := c.service.FindPetsByTags(tags) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// GetPetById - Find pet by ID -func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - petId, err := parseIntParameter(params["petId"]) - if err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.GetPetById(petId) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// UpdatePet - Update an existing pet -func (c *PetApiController) UpdatePet(w http.ResponseWriter, r *http.Request) { - pet := &Pet{} - if err := json.NewDecoder(r.Body).Decode(&pet); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.UpdatePet(*pet) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// UpdatePetWithForm - Updates a pet in the store with form data -func (c *PetApiController) UpdatePetWithForm(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - if err != nil { - w.WriteHeader(500) - return - } - - params := mux.Vars(r) - petId, err := parseIntParameter(params["petId"]) - if err != nil { - w.WriteHeader(500) - return - } - - name := r.FormValue("name") - status := r.FormValue("status") - result, err := c.service.UpdatePetWithForm(petId, name, status) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// UploadFile - uploads an image -func (c *PetApiController) UploadFile(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - if err != nil { - w.WriteHeader(500) - return - } - - params := mux.Vars(r) - petId, err := parseIntParameter(params["petId"]) - if err != nil { - w.WriteHeader(500) - return - } - - additionalMetadata := r.FormValue("additionalMetadata") - file, err := ReadFormFileToTempFile(r, "file") - if err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.UploadFile(petId, additionalMetadata, file) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// UploadFileWithRequiredFile - uploads an image (required) -func (c *PetApiController) UploadFileWithRequiredFile(w http.ResponseWriter, r *http.Request) { - err := r.ParseForm() - if err != nil { - w.WriteHeader(500) - return - } - - params := mux.Vars(r) - petId, err := parseIntParameter(params["petId"]) - if err != nil { - w.WriteHeader(500) - return - } - - requiredFile, err := ReadFormFileToTempFile(r, "requiredFile") - if err != nil { - w.WriteHeader(500) - return - } - - additionalMetadata := r.FormValue("additionalMetadata") - result, err := c.service.UploadFileWithRequiredFile(petId, requiredFile, additionalMetadata) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_store.go b/samples/openapi3/server/petstore/go-api-server/go/api_store.go deleted file mode 100644 index 5867035964e5..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/api_store.go +++ /dev/null @@ -1,117 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// A StoreApiController binds http requests to an api service and writes the service results to the http response -type StoreApiController struct { - service StoreApiServicer -} - -// NewStoreApiController creates a default api controller -func NewStoreApiController(s StoreApiServicer) Router { - return &StoreApiController{ service: s } -} - -// Routes returns all of the api route for the StoreApiController -func (c *StoreApiController) Routes() Routes { - return Routes{ - { - "DeleteOrder", - strings.ToUpper("Delete"), - "/v2/store/order/{order_id}", - c.DeleteOrder, - }, - { - "GetInventory", - strings.ToUpper("Get"), - "/v2/store/inventory", - c.GetInventory, - }, - { - "GetOrderById", - strings.ToUpper("Get"), - "/v2/store/order/{order_id}", - c.GetOrderById, - }, - { - "PlaceOrder", - strings.ToUpper("Post"), - "/v2/store/order", - c.PlaceOrder, - }, - } -} - -// DeleteOrder - Delete purchase order by ID -func (c *StoreApiController) DeleteOrder(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - orderId := params["orderId"] - result, err := c.service.DeleteOrder(orderId) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// GetInventory - Returns pet inventories by status -func (c *StoreApiController) GetInventory(w http.ResponseWriter, r *http.Request) { - result, err := c.service.GetInventory() - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// GetOrderById - Find purchase order by ID -func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - orderId, err := parseIntParameter(params["orderId"]) - if err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.GetOrderById(orderId) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// PlaceOrder - Place an order for a pet -func (c *StoreApiController) PlaceOrder(w http.ResponseWriter, r *http.Request) { - order := &Order{} - if err := json.NewDecoder(r.Body).Decode(&order); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.PlaceOrder(*order) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/api_user.go b/samples/openapi3/server/petstore/go-api-server/go/api_user.go deleted file mode 100644 index 35fd6713eb71..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/api_user.go +++ /dev/null @@ -1,203 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "net/http" - "strings" - - "github.com/gorilla/mux" -) - -// A UserApiController binds http requests to an api service and writes the service results to the http response -type UserApiController struct { - service UserApiServicer -} - -// NewUserApiController creates a default api controller -func NewUserApiController(s UserApiServicer) Router { - return &UserApiController{ service: s } -} - -// Routes returns all of the api route for the UserApiController -func (c *UserApiController) Routes() Routes { - return Routes{ - { - "CreateUser", - strings.ToUpper("Post"), - "/v2/user", - c.CreateUser, - }, - { - "CreateUsersWithArrayInput", - strings.ToUpper("Post"), - "/v2/user/createWithArray", - c.CreateUsersWithArrayInput, - }, - { - "CreateUsersWithListInput", - strings.ToUpper("Post"), - "/v2/user/createWithList", - c.CreateUsersWithListInput, - }, - { - "DeleteUser", - strings.ToUpper("Delete"), - "/v2/user/{username}", - c.DeleteUser, - }, - { - "GetUserByName", - strings.ToUpper("Get"), - "/v2/user/{username}", - c.GetUserByName, - }, - { - "LoginUser", - strings.ToUpper("Get"), - "/v2/user/login", - c.LoginUser, - }, - { - "LogoutUser", - strings.ToUpper("Get"), - "/v2/user/logout", - c.LogoutUser, - }, - { - "UpdateUser", - strings.ToUpper("Put"), - "/v2/user/{username}", - c.UpdateUser, - }, - } -} - -// CreateUser - Create user -func (c *UserApiController) CreateUser(w http.ResponseWriter, r *http.Request) { - user := &User{} - if err := json.NewDecoder(r.Body).Decode(&user); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.CreateUser(*user) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// CreateUsersWithArrayInput - Creates list of users with given input array -func (c *UserApiController) CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request) { - user := &[]User{} - if err := json.NewDecoder(r.Body).Decode(&user); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.CreateUsersWithArrayInput(*user) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// CreateUsersWithListInput - Creates list of users with given input array -func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *http.Request) { - user := &[]User{} - if err := json.NewDecoder(r.Body).Decode(&user); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.CreateUsersWithListInput(*user) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// DeleteUser - Delete user -func (c *UserApiController) DeleteUser(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - username := params["username"] - result, err := c.service.DeleteUser(username) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// GetUserByName - Get user by user name -func (c *UserApiController) GetUserByName(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - username := params["username"] - result, err := c.service.GetUserByName(username) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// LoginUser - Logs user into the system -func (c *UserApiController) LoginUser(w http.ResponseWriter, r *http.Request) { - query := r.URL.Query() - username := query.Get("username") - password := query.Get("password") - result, err := c.service.LoginUser(username, password) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// LogoutUser - Logs out current logged in user session -func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request) { - result, err := c.service.LogoutUser() - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} - -// UpdateUser - Updated user -func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request) { - params := mux.Vars(r) - username := params["username"] - user := &User{} - if err := json.NewDecoder(r.Body).Decode(&user); err != nil { - w.WriteHeader(500) - return - } - - result, err := c.service.UpdateUser(username, *user) - if err != nil { - w.WriteHeader(500) - return - } - - EncodeJSONResponse(result, nil, w) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/logger.go b/samples/openapi3/server/petstore/go-api-server/go/logger.go deleted file mode 100644 index 644ec5e51fb4..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/logger.go +++ /dev/null @@ -1,32 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "log" - "net/http" - "time" -) - -func Logger(inner http.Handler, name string) http.Handler { - return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - start := time.Now() - - inner.ServeHTTP(w, r) - - log.Printf( - "%s %s %s %s", - r.Method, - r.RequestURI, - name, - time.Since(start), - ) - }) -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_200_response.go b/samples/openapi3/server/petstore/go-api-server/go/model_200_response.go deleted file mode 100644 index 217fe24e4378..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_200_response.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// Model200Response - Model for testing model name starting with number -type Model200Response struct { - - Name int32 `json:"name,omitempty"` - - Class string `json:"class,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model__special_model_name_.go b/samples/openapi3/server/petstore/go-api-server/go/model__special_model_name_.go deleted file mode 100644 index ffc27255ae9b..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model__special_model_name_.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type SpecialModelName struct { - - SpecialPropertyName int64 `json:"$special[property.name],omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_additional_properties_class.go b/samples/openapi3/server/petstore/go-api-server/go/model_additional_properties_class.go deleted file mode 100644 index 430177a30074..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_additional_properties_class.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type AdditionalPropertiesClass struct { - - MapProperty map[string]string `json:"map_property,omitempty"` - - MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_animal.go b/samples/openapi3/server/petstore/go-api-server/go/model_animal.go deleted file mode 100644 index 14d9295d875a..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_animal.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Animal struct { - - ClassName string `json:"className"` - - Color string `json:"color,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_api_response.go b/samples/openapi3/server/petstore/go-api-server/go/model_api_response.go deleted file mode 100644 index 380b8dee0089..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_api_response.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ApiResponse struct { - - Code int32 `json:"code,omitempty"` - - Type string `json:"type,omitempty"` - - Message string `json:"message,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_array_of_array_of_number_only.go b/samples/openapi3/server/petstore/go-api-server/go/model_array_of_array_of_number_only.go deleted file mode 100644 index e0347d8260ae..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_array_of_array_of_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ArrayOfArrayOfNumberOnly struct { - - ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_array_of_number_only.go b/samples/openapi3/server/petstore/go-api-server/go/model_array_of_number_only.go deleted file mode 100644 index 04d7c86a5e1e..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_array_of_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ArrayOfNumberOnly struct { - - ArrayNumber []float32 `json:"ArrayNumber,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_array_test_.go b/samples/openapi3/server/petstore/go-api-server/go/model_array_test_.go deleted file mode 100644 index a85e460d8c76..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_array_test_.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ArrayTest struct { - - ArrayOfString []string `json:"array_of_string,omitempty"` - - ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` - - ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_capitalization.go b/samples/openapi3/server/petstore/go-api-server/go/model_capitalization.go deleted file mode 100644 index 1e1cb8acc3fc..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_capitalization.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Capitalization struct { - - SmallCamel string `json:"smallCamel,omitempty"` - - CapitalCamel string `json:"CapitalCamel,omitempty"` - - SmallSnake string `json:"small_Snake,omitempty"` - - CapitalSnake string `json:"Capital_Snake,omitempty"` - - SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty"` - - // Name of the pet - ATT_NAME string `json:"ATT_NAME,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_cat.go b/samples/openapi3/server/petstore/go-api-server/go/model_cat.go deleted file mode 100644 index 78261ede6121..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_cat.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Cat struct { - - ClassName string `json:"className"` - - Color string `json:"color,omitempty"` - - Declawed bool `json:"declawed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go b/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go deleted file mode 100644 index 312c33895f8d..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_cat_all_of.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type CatAllOf struct { - - Declawed bool `json:"declawed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_category.go b/samples/openapi3/server/petstore/go-api-server/go/model_category.go deleted file mode 100644 index 373c419af559..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_category.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Category struct { - - Id int64 `json:"id,omitempty"` - - Name string `json:"name"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_class_model.go b/samples/openapi3/server/petstore/go-api-server/go/model_class_model.go deleted file mode 100644 index d9fcd475b7bc..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_class_model.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// ClassModel - Model for testing model with \"_class\" property -type ClassModel struct { - - Class string `json:"_class,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_client.go b/samples/openapi3/server/petstore/go-api-server/go/model_client.go deleted file mode 100644 index f49c616f021f..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_client.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Client struct { - - Client string `json:"client,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_dog.go b/samples/openapi3/server/petstore/go-api-server/go/model_dog.go deleted file mode 100644 index 04b2a9ba9aae..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_dog.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Dog struct { - - ClassName string `json:"className"` - - Color string `json:"color,omitempty"` - - Breed string `json:"breed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go b/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go deleted file mode 100644 index a36b96b1a0cb..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_dog_all_of.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type DogAllOf struct { - - Breed string `json:"breed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_enum_arrays.go b/samples/openapi3/server/petstore/go-api-server/go/model_enum_arrays.go deleted file mode 100644 index 813af5d87012..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_enum_arrays.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type EnumArrays struct { - - JustSymbol string `json:"just_symbol,omitempty"` - - ArrayEnum []string `json:"array_enum,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_enum_class.go b/samples/openapi3/server/petstore/go-api-server/go/model_enum_class.go deleted file mode 100644 index da4428a5d41d..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_enum_class.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type EnumClass string - -// List of EnumClass -const ( - ABC EnumClass = "_abc" - EFG EnumClass = "-efg" - XYZ EnumClass = "(xyz)" -) diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go b/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go deleted file mode 100644 index 7822fd4e9d4a..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_enum_test_.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type EnumTest struct { - - EnumString string `json:"enum_string,omitempty"` - - EnumStringRequired string `json:"enum_string_required"` - - EnumInteger int32 `json:"enum_integer,omitempty"` - - EnumNumber float64 `json:"enum_number,omitempty"` - - OuterEnum *OuterEnum `json:"outerEnum,omitempty"` - - OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` - - OuterEnumDefaultValue OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` - - OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_file.go b/samples/openapi3/server/petstore/go-api-server/go/model_file.go deleted file mode 100644 index 9bbc4164c2e2..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_file.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// File - Must be named `File` for test. -type File struct { - - // Test capitalization - SourceURI string `json:"sourceURI,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_file_schema_test_class.go b/samples/openapi3/server/petstore/go-api-server/go/model_file_schema_test_class.go deleted file mode 100644 index c9e7600031ea..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_file_schema_test_class.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type FileSchemaTestClass struct { - - File File `json:"file,omitempty"` - - Files []File `json:"files,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_foo.go b/samples/openapi3/server/petstore/go-api-server/go/model_foo.go deleted file mode 100644 index 9e85ac9ab6c7..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_foo.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Foo struct { - - Bar string `json:"bar,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_format_test_.go b/samples/openapi3/server/petstore/go-api-server/go/model_format_test_.go deleted file mode 100644 index eaa3ce019a74..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_format_test_.go +++ /dev/null @@ -1,50 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" - "time" -) - -type FormatTest struct { - - Integer int32 `json:"integer,omitempty"` - - Int32 int32 `json:"int32,omitempty"` - - Int64 int64 `json:"int64,omitempty"` - - Number float32 `json:"number"` - - Float float32 `json:"float,omitempty"` - - Double float64 `json:"double,omitempty"` - - String string `json:"string,omitempty"` - - Byte string `json:"byte"` - - Binary *os.File `json:"binary,omitempty"` - - Date string `json:"date"` - - DateTime time.Time `json:"dateTime,omitempty"` - - Uuid string `json:"uuid,omitempty"` - - Password string `json:"password"` - - // A string that is a 10 digit number. Can have leading zeros. - PatternWithDigits string `json:"pattern_with_digits,omitempty"` - - // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - PatternWithDigitsAndDelimiter string `json:"pattern_with_digits_and_delimiter,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_has_only_read_only.go b/samples/openapi3/server/petstore/go-api-server/go/model_has_only_read_only.go deleted file mode 100644 index d64b0e012c7d..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_has_only_read_only.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type HasOnlyReadOnly struct { - - Bar string `json:"bar,omitempty"` - - Foo string `json:"foo,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_health_check_result.go b/samples/openapi3/server/petstore/go-api-server/go/model_health_check_result.go deleted file mode 100644 index 9cebb74d3cbb..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_health_check_result.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// HealthCheckResult - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. -type HealthCheckResult struct { - - NullableMessage *string `json:"NullableMessage,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_2.go b/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_2.go deleted file mode 100644 index 3babd0cfac99..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_2.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineObject2 struct { - - // Form parameter enum test (string array) - EnumFormStringArray []string `json:"enum_form_string_array,omitempty"` - - // Form parameter enum test (string) - EnumFormString string `json:"enum_form_string,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_3.go b/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_3.go deleted file mode 100644 index 226092059da7..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_3.go +++ /dev/null @@ -1,60 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" - "time" -) - -type InlineObject3 struct { - - // None - Integer int32 `json:"integer,omitempty"` - - // None - Int32 int32 `json:"int32,omitempty"` - - // None - Int64 int64 `json:"int64,omitempty"` - - // None - Number float32 `json:"number"` - - // None - Float float32 `json:"float,omitempty"` - - // None - Double float64 `json:"double"` - - // None - String string `json:"string,omitempty"` - - // None - PatternWithoutDelimiter string `json:"pattern_without_delimiter"` - - // None - Byte string `json:"byte"` - - // None - Binary *os.File `json:"binary,omitempty"` - - // None - Date string `json:"date,omitempty"` - - // None - DateTime time.Time `json:"dateTime,omitempty"` - - // None - Password string `json:"password,omitempty"` - - // None - Callback string `json:"callback,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_4.go b/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_4.go deleted file mode 100644 index 23db282a2e15..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_4.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineObject4 struct { - - // field1 - Param string `json:"param"` - - // field2 - Param2 string `json:"param2"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_5.go b/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_5.go deleted file mode 100644 index 8004ded7ce51..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_5.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" -) - -type InlineObject5 struct { - - // Additional data to pass to server - AdditionalMetadata string `json:"additionalMetadata,omitempty"` - - // file to upload - RequiredFile *os.File `json:"requiredFile"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_inline_response_default.go b/samples/openapi3/server/petstore/go-api-server/go/model_inline_response_default.go deleted file mode 100644 index 50f4bb4f2bd4..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_inline_response_default.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineResponseDefault struct { - - String Foo `json:"string,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_list.go b/samples/openapi3/server/petstore/go-api-server/go/model_list.go deleted file mode 100644 index a6bf160a13c4..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_list.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type List struct { - - Var123List string `json:"123-list,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_map_test_.go b/samples/openapi3/server/petstore/go-api-server/go/model_map_test_.go deleted file mode 100644 index 49a86a792ac9..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_map_test_.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type MapTest struct { - - MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` - - MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` - - DirectMap map[string]bool `json:"direct_map,omitempty"` - - IndirectMap map[string]bool `json:"indirect_map,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/server/petstore/go-api-server/go/model_mixed_properties_and_additional_properties_class.go deleted file mode 100644 index e25d32587cd5..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_mixed_properties_and_additional_properties_class.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "time" -) - -type MixedPropertiesAndAdditionalPropertiesClass struct { - - Uuid string `json:"uuid,omitempty"` - - DateTime time.Time `json:"dateTime,omitempty"` - - Map map[string]Animal `json:"map,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_name.go b/samples/openapi3/server/petstore/go-api-server/go/model_name.go deleted file mode 100644 index cd9a874c4190..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_name.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// Name - Model for testing model name same as property name -type Name struct { - - Name int32 `json:"name"` - - SnakeCase int32 `json:"snake_case,omitempty"` - - Property string `json:"property,omitempty"` - - Var123Number int32 `json:"123Number,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go b/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go deleted file mode 100644 index ba2aa1f86cfa..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_nullable_class.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "time" -) - -type NullableClass struct { - - IntegerProp *int32 `json:"integer_prop,omitempty"` - - NumberProp *float32 `json:"number_prop,omitempty"` - - BooleanProp *bool `json:"boolean_prop,omitempty"` - - StringProp *string `json:"string_prop,omitempty"` - - DateProp *string `json:"date_prop,omitempty"` - - DatetimeProp *time.Time `json:"datetime_prop,omitempty"` - - ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` - - ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` - - ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"` - - ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` - - ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` - - ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_number_only.go b/samples/openapi3/server/petstore/go-api-server/go/model_number_only.go deleted file mode 100644 index ba6f4af64015..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type NumberOnly struct { - - JustNumber float32 `json:"JustNumber,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_order.go b/samples/openapi3/server/petstore/go-api-server/go/model_order.go deleted file mode 100644 index 6849a9f76d69..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_order.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "time" -) - -type Order struct { - - Id int64 `json:"id,omitempty"` - - PetId int64 `json:"petId,omitempty"` - - Quantity int32 `json:"quantity,omitempty"` - - ShipDate time.Time `json:"shipDate,omitempty"` - - // Order Status - Status string `json:"status,omitempty"` - - Complete bool `json:"complete,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_outer_composite.go b/samples/openapi3/server/petstore/go-api-server/go/model_outer_composite.go deleted file mode 100644 index 7534db47c2e4..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_outer_composite.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterComposite struct { - - MyNumber float32 `json:"my_number,omitempty"` - - MyString string `json:"my_string,omitempty"` - - MyBoolean bool `json:"my_boolean,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum.go b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum.go deleted file mode 100644 index d01d988ccda2..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnum string - -// List of OuterEnum -const ( - PLACED OuterEnum = "placed" - APPROVED OuterEnum = "approved" - DELIVERED OuterEnum = "delivered" -) diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_default_value.go b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_default_value.go deleted file mode 100644 index 12881121ff32..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_default_value.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnumDefaultValue string - -// List of OuterEnumDefaultValue -const ( - PLACED OuterEnumDefaultValue = "placed" - APPROVED OuterEnumDefaultValue = "approved" - DELIVERED OuterEnumDefaultValue = "delivered" -) diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer.go b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer.go deleted file mode 100644 index f14b13342aff..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnumInteger int32 - -// List of OuterEnumInteger -const ( - _0 OuterEnumInteger = 0 - _1 OuterEnumInteger = 1 - _2 OuterEnumInteger = 2 -) diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer_default_value.go b/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer_default_value.go deleted file mode 100644 index 94b4bb2077a7..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_outer_enum_integer_default_value.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnumIntegerDefaultValue int32 - -// List of OuterEnumIntegerDefaultValue -const ( - _0 OuterEnumIntegerDefaultValue = 0 - _1 OuterEnumIntegerDefaultValue = 1 - _2 OuterEnumIntegerDefaultValue = 2 -) diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_pet.go b/samples/openapi3/server/petstore/go-api-server/go/model_pet.go deleted file mode 100644 index 2271730674e2..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_pet.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Pet struct { - - Id int64 `json:"id,omitempty"` - - Category Category `json:"category,omitempty"` - - Name string `json:"name"` - - PhotoUrls []string `json:"photoUrls"` - - Tags []Tag `json:"tags,omitempty"` - - // pet status in the store - Status string `json:"status,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_read_only_first.go b/samples/openapi3/server/petstore/go-api-server/go/model_read_only_first.go deleted file mode 100644 index c4192d91ee26..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_read_only_first.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ReadOnlyFirst struct { - - Bar string `json:"bar,omitempty"` - - Baz string `json:"baz,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_return.go b/samples/openapi3/server/petstore/go-api-server/go/model_return.go deleted file mode 100644 index 0ff664525de8..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_return.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// Return - Model for testing reserved words -type Return struct { - - Return int32 `json:"return,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_tag.go b/samples/openapi3/server/petstore/go-api-server/go/model_tag.go deleted file mode 100644 index 29cd4d64ae35..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_tag.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Tag struct { - - Id int64 `json:"id,omitempty"` - - Name string `json:"name,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_user.go b/samples/openapi3/server/petstore/go-api-server/go/model_user.go deleted file mode 100644 index 1eda4c6f763f..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/model_user.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type User struct { - - Id int64 `json:"id,omitempty"` - - Username string `json:"username,omitempty"` - - FirstName string `json:"firstName,omitempty"` - - LastName string `json:"lastName,omitempty"` - - Email string `json:"email,omitempty"` - - Password string `json:"password,omitempty"` - - Phone string `json:"phone,omitempty"` - - // User Status - UserStatus int32 `json:"userStatus,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-api-server/go/routers.go b/samples/openapi3/server/petstore/go-api-server/go/routers.go deleted file mode 100644 index 1a166f390e83..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/go/routers.go +++ /dev/null @@ -1,96 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "encoding/json" - "io/ioutil" - "net/http" - "os" - "strconv" - "github.com/gorilla/mux" -) - -// A Route defines the parameters for an api endpoint -type Route struct { - Name string - Method string - Pattern string - HandlerFunc http.HandlerFunc -} - -// Routes are a collection of defined api endpoints -type Routes []Route - -// Router defines the required methods for retrieving api routes -type Router interface { - Routes() Routes -} - -// NewRouter creates a new router for any number of api routers -func NewRouter(routers ...Router) *mux.Router { - router := mux.NewRouter().StrictSlash(true) - for _, api := range routers { - for _, route := range api.Routes() { - var handler http.Handler - handler = route.HandlerFunc - handler = Logger(handler, route.Name) - - router. - Methods(route.Method). - Path(route.Pattern). - Name(route.Name). - Handler(handler) - } - } - - return router -} - -// EncodeJSONResponse uses the json encoder to write an interface to the http response with an optional status code -func EncodeJSONResponse(i interface{}, status *int, w http.ResponseWriter) error { - w.Header().Set("Content-Type", "application/json; charset=UTF-8") - if status != nil { - w.WriteHeader(*status) - } else { - w.WriteHeader(http.StatusOK) - } - - return json.NewEncoder(w).Encode(i) -} - -// ReadFormFileToTempFile reads file data from a request form and writes it to a temporary file -func ReadFormFileToTempFile(r *http.Request, key string) (*os.File, error) { - r.ParseForm() - formFile, _, err := r.FormFile(key) - if err != nil { - return nil, err - } - - defer formFile.Close() - file, err := ioutil.TempFile("tmp", key) - if err != nil { - return nil, err - } - - defer file.Close() - fileBytes, err := ioutil.ReadAll(formFile) - if err != nil { - return nil, err - } - - file.Write(fileBytes) - return file, nil -} - -// parseIntParameter parses a sting parameter to an int64 -func parseIntParameter(param string) (int64, error) { - return strconv.ParseInt(param, 10, 64) -} diff --git a/samples/openapi3/server/petstore/go-api-server/main.go b/samples/openapi3/server/petstore/go-api-server/main.go deleted file mode 100644 index d4444720003b..000000000000 --- a/samples/openapi3/server/petstore/go-api-server/main.go +++ /dev/null @@ -1,46 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package main - -import ( - "log" - "net/http" - - petstoreserver "github.com/GIT_USER_ID/GIT_REPO_ID/go" -) - -func main() { - log.Printf("Server started") - - AnotherFakeApiService := petstoreserver.NewAnotherFakeApiService() - AnotherFakeApiController := petstoreserver.NewAnotherFakeApiController(AnotherFakeApiService) - - DefaultApiService := petstoreserver.NewDefaultApiService() - DefaultApiController := petstoreserver.NewDefaultApiController(DefaultApiService) - - FakeApiService := petstoreserver.NewFakeApiService() - FakeApiController := petstoreserver.NewFakeApiController(FakeApiService) - - FakeClassnameTags123ApiService := petstoreserver.NewFakeClassnameTags123ApiService() - FakeClassnameTags123ApiController := petstoreserver.NewFakeClassnameTags123ApiController(FakeClassnameTags123ApiService) - - PetApiService := petstoreserver.NewPetApiService() - PetApiController := petstoreserver.NewPetApiController(PetApiService) - - StoreApiService := petstoreserver.NewStoreApiService() - StoreApiController := petstoreserver.NewStoreApiController(StoreApiService) - - UserApiService := petstoreserver.NewUserApiService() - UserApiController := petstoreserver.NewUserApiController(UserApiService) - - router := petstoreserver.NewRouter(AnotherFakeApiController, DefaultApiController, FakeApiController, FakeClassnameTags123ApiController, PetApiController, StoreApiController, UserApiController) - - log.Fatal(http.ListenAndServe(":8080", router)) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator-ignore b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a38..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator-ignore +++ /dev/null @@ -1,23 +0,0 @@ -# OpenAPI Generator Ignore -# Generated by openapi-generator https://github.com/openapitools/openapi-generator - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md diff --git a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION b/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION deleted file mode 100644 index 58592f031f65..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -4.2.3-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/go-gin-api-server/Dockerfile b/samples/openapi3/server/petstore/go-gin-api-server/Dockerfile deleted file mode 100644 index 30e247e622ba..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM golang:1.10 AS build -WORKDIR /go/src -COPY go ./go -COPY main.go . - -ENV CGO_ENABLED=0 -RUN go get -d -v ./... - -RUN go build -a -installsuffix cgo -o petstoreserver . - -FROM scratch AS runtime -ENV GIN_MODE=release -COPY --from=build /go/src/petstoreserver ./ -EXPOSE 8080/tcp -ENTRYPOINT ["./petstoreserver"] diff --git a/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml b/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml deleted file mode 100644 index 06a1bb8d4693..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/api/openapi.yaml +++ /dev/null @@ -1,2059 +0,0 @@ -openapi: 3.0.0 -info: - description: 'This spec is mainly for testing Petstore server and contains fake - endpoints, models. Please do not use this for any other purpose. Special characters: - " \' - license: - name: Apache-2.0 - url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- description: petstore server - url: http://{server}.swagger.io:{port}/v2 - variables: - server: - default: petstore - enum: - - petstore - - qa-petstore - - dev-petstore - port: - default: "80" - enum: - - "80" - - "8080" -- description: The local server - url: https://localhost:8080/{version} - variables: - version: - default: v2 - enum: - - v1 - - v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /foo: - get: - responses: - default: - content: - application/json: - schema: - $ref: '#/components/schemas/inline_response_default' - description: response - /pet: - post: - operationId: addPet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - 405: - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - put: - operationId: updatePet - requestBody: - $ref: '#/components/requestBodies/Pet' - responses: - 400: - description: Invalid ID supplied - 404: - description: Pet not found - 405: - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - servers: - - url: http://petstore.swagger.io/v2 - - url: http://path-server-test.petstore.local/v2 - /pet/findByStatus: - get: - description: Multiple status values can be provided with comma separated strings - operationId: findPetsByStatus - parameters: - - description: Status values that need to be considered for filter - explode: false - in: query - name: status - required: true - schema: - items: - default: available - enum: - - available - - pending - - sold - type: string - type: array - style: form - responses: - 200: - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - 400: - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - /pet/findByTags: - get: - deprecated: true - description: Multiple tags can be provided with comma separated strings. Use - tag1, tag2, tag3 for testing. - operationId: findPetsByTags - parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - style: form - responses: - 200: - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - description: successful operation - 400: - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - explode: false - in: header - name: api_key - required: false - schema: - type: string - style: simple - - description: Pet id to delete - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - 400: - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/Pet' - application/json: - schema: - $ref: '#/components/schemas/Pet' - description: successful operation - 400: - description: Invalid ID supplied - 404: - description: Pet not found - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object' - content: - application/x-www-form-urlencoded: - schema: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - responses: - 405: - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_1' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - /store/inventory: - get: - description: Returns a map of status codes to quantities - operationId: getInventory - responses: - 200: - content: - application/json: - schema: - additionalProperties: - format: int32 - type: integer - type: object - description: successful operation - security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Order' - description: order placed for purchasing the pet - required: true - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - 400: - description: Invalid Order - summary: Place an order for a pet - tags: - - store - /store/order/{order_id}: - delete: - description: For valid response try integer IDs with value < 1000. Anything - above 1000 or nonintegers will generate API errors - operationId: deleteOrder - parameters: - - description: ID of the order that needs to be deleted - explode: false - in: path - name: order_id - required: true - schema: - type: string - style: simple - responses: - 400: - description: Invalid ID supplied - 404: - description: Order not found - summary: Delete purchase order by ID - tags: - - store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generated exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - explode: false - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - style: simple - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $ref: '#/components/schemas/Order' - description: successful operation - 400: - description: Invalid ID supplied - 404: - description: Order not found - summary: Find purchase order by ID - tags: - - store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - description: successful operation - summary: Create user - tags: - - user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - $ref: '#/components/requestBodies/UserArray' - responses: - default: - description: successful operation - summary: Creates list of users with given input array - tags: - - user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - explode: true - in: query - name: username - required: true - schema: - type: string - style: form - - description: The password for login in clear text - explode: true - in: query - name: password - required: true - schema: - type: string - style: form - responses: - 200: - content: - application/xml: - schema: - type: string - application/json: - schema: - type: string - description: successful operation - headers: - X-Rate-Limit: - description: calls per hour allowed by the user - explode: false - schema: - format: int32 - type: integer - style: simple - X-Expires-After: - description: date in UTC when token expires - explode: false - schema: - format: date-time - type: string - style: simple - 400: - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - /user/logout: - get: - operationId: logoutUser - responses: - default: - description: successful operation - summary: Logs out current logged in user session - tags: - - user - /user/{username}: - delete: - description: This can only be done by the logged in user. - operationId: deleteUser - parameters: - - description: The name that needs to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - 400: - description: Invalid username supplied - 404: - description: User not found - summary: Delete user - tags: - - user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - responses: - 200: - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $ref: '#/components/schemas/User' - description: successful operation - 400: - description: Invalid username supplied - 404: - description: User not found - summary: Get user by user name - tags: - - user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - explode: false - in: path - name: username - required: true - schema: - type: string - style: simple - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - 400: - description: Invalid user supplied - 404: - description: User not found - summary: Updated user - tags: - - user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - explode: true - in: query - name: required_string_group - required: true - schema: - type: integer - style: form - - description: Required Boolean in group parameters - explode: false - in: header - name: required_boolean_group - required: true - schema: - type: boolean - style: simple - - description: Required Integer in group parameters - explode: true - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - style: form - - description: String in group parameters - explode: true - in: query - name: string_group - required: false - schema: - type: integer - style: form - - description: Boolean in group parameters - explode: false - in: header - name: boolean_group - required: false - schema: - type: boolean - style: simple - - description: Integer in group parameters - explode: true - in: query - name: int64_group - required: false - schema: - format: int64 - type: integer - style: form - responses: - 400: - description: Someting wrong - security: - - bearer_test: [] - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - get: - description: To test enum parameters - operationId: testEnumParameters - parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - explode: false - in: header - name: enum_header_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: simple - - description: Query parameter enum test (string array) - explode: true - in: query - name: enum_query_string_array - required: false - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - explode: true - in: query - name: enum_query_string - required: false - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_integer - required: false - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - style: form - - description: Query parameter enum test (double) - explode: true - in: query - name: enum_query_double - required: false - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - style: form - requestBody: - $ref: '#/components/requestBodies/inline_object_2' - content: - application/x-www-form-urlencoded: - schema: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - responses: - 400: - description: Invalid request - 404: - description: Not found - summary: To test enum parameters - tags: - - fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - post: - description: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - $ref: '#/components/requestBodies/inline_object_3' - content: - application/x-www-form-urlencoded: - schema: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - responses: - 400: - description: Invalid username supplied - 404: - description: User not found - security: - - http_basic_test: [] - summary: | - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - responses: - 200: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - $ref: '#/components/requestBodies/inline_object_4' - content: - application/x-www-form-urlencoded: - schema: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - responses: - 200: - description: successful operation - summary: test json serialization of form data - tags: - - fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - 200: - description: successful operation - summary: test inline additionalProperties - tags: - - fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - explode: true - in: query - name: query - required: true - schema: - type: string - style: form - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - 200: - description: Success - tags: - - fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - $ref: '#/components/requestBodies/Client' - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - /fake/body-with-file-schema: - put: - description: For this test, the body for this request much reference a schema - named `File`. - operationId: testBodyWithFileSchema - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/FileSchemaTestClass' - required: true - responses: - 200: - description: Success - tags: - - fake - /fake/test-query-paramters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: true - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - style: form - - explode: false - in: query - name: http - required: true - schema: - items: - type: string - type: array - style: spaceDelimited - - explode: false - in: query - name: url - required: true - schema: - items: - type: string - type: array - style: form - - explode: true - in: query - name: context - required: true - schema: - items: - type: string - type: array - style: form - responses: - 200: - description: Success - tags: - - fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - explode: false - in: path - name: petId - required: true - schema: - format: int64 - type: integer - style: simple - requestBody: - $ref: '#/components/requestBodies/inline_object_5' - content: - multipart/form-data: - schema: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - /fake/health: - get: - responses: - 200: - content: - application/json: - schema: - $ref: '#/components/schemas/HealthCheckResult' - description: The instance started successfully - summary: Health check endpoint - tags: - - fake -components: - requestBodies: - UserArray: - content: - application/json: - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - Client: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - Pet: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true - inline_object: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object' - inline_object_1: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_1' - inline_object_2: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_2' - inline_object_3: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_3' - inline_object_4: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/inline_object_4' - inline_object_5: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/inline_object_5' - schemas: - Foo: - example: - bar: bar - properties: - bar: - default: bar - type: string - type: object - Bar: - default: bar - type: string - Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed - properties: - id: - format: int64 - type: integer - petId: - format: int64 - type: integer - quantity: - format: int32 - type: integer - shipDate: - format: date-time - type: string - status: - description: Order Status - enum: - - placed - - approved - - delivered - type: string - complete: - default: false - type: boolean - type: object - xml: - name: Order - Category: - example: - name: default-name - id: 6 - properties: - id: - format: int64 - type: integer - name: - default: default-name - type: string - required: - - name - type: object - xml: - name: Category - User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username - properties: - id: - format: int64 - type: integer - x-is-unique: true - username: - type: string - firstName: - type: string - lastName: - type: string - email: - type: string - password: - type: string - phone: - type: string - userStatus: - description: User Status - format: int32 - type: integer - type: object - xml: - name: User - Tag: - example: - name: name - id: 1 - properties: - id: - format: int64 - type: integer - name: - type: string - type: object - xml: - name: Tag - Pet: - example: - photoUrls: - - photoUrls - - photoUrls - name: doggie - id: 0 - category: - name: default-name - id: 6 - tags: - - name: name - id: 1 - - name: name - id: 1 - status: available - properties: - id: - format: int64 - type: integer - x-is-unique: true - category: - $ref: '#/components/schemas/Category' - name: - example: doggie - type: string - photoUrls: - items: - type: string - type: array - xml: - name: photoUrl - wrapped: true - tags: - items: - $ref: '#/components/schemas/Tag' - type: array - xml: - name: tag - wrapped: true - status: - description: pet status in the store - enum: - - available - - pending - - sold - type: string - required: - - name - - photoUrls - type: object - xml: - name: Pet - ApiResponse: - example: - code: 0 - type: type - message: message - properties: - code: - format: int32 - type: integer - type: - type: string - message: - type: string - type: object - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - xml: - name: Return - Name: - description: Model for testing model name same as property name - properties: - name: - format: int32 - type: integer - snake_case: - format: int32 - readOnly: true - type: integer - property: - type: string - 123Number: - readOnly: true - type: integer - required: - - name - xml: - name: Name - 200_response: - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - Animal: - discriminator: - propertyName: className - properties: - className: - type: string - color: - default: red - type: string - required: - - className - type: object - AnimalFarm: - items: - $ref: '#/components/schemas/Animal' - type: array - format_test: - properties: - integer: - maximum: 100 - minimum: 10 - type: integer - int32: - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - format: int64 - type: integer - number: - maximum: 543.2 - minimum: 32.1 - type: number - float: - format: float - maximum: 987.6 - minimum: 54.3 - type: number - double: - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - pattern: /[a-z]/i - type: string - byte: - format: byte - type: string - binary: - format: binary - type: string - date: - format: date - type: string - dateTime: - format: date-time - type: string - uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid - type: string - password: - format: password - maxLength: 64 - minLength: 10 - type: string - pattern_with_digits: - description: A string that is a 10 digit number. Can have leading zeros. - pattern: ^\d{10}$ - type: string - pattern_with_digits_and_delimiter: - description: A string starting with 'image_' (case insensitive) and one - to three digits following i.e. Image_01. - pattern: /^image_\d{1,3}$/i - type: string - required: - - byte - - date - - number - - password - type: object - EnumClass: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - Enum_Test: - properties: - enum_string: - enum: - - UPPER - - lower - - "" - type: string - enum_string_required: - enum: - - UPPER - - lower - - "" - type: string - enum_integer: - enum: - - 1 - - -1 - format: int32 - type: integer - enum_number: - enum: - - 1.1 - - -1.2 - format: double - type: number - outerEnum: - $ref: '#/components/schemas/OuterEnum' - outerEnumInteger: - $ref: '#/components/schemas/OuterEnumInteger' - outerEnumDefaultValue: - $ref: '#/components/schemas/OuterEnumDefaultValue' - outerEnumIntegerDefaultValue: - $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_property: - additionalProperties: - type: string - type: object - map_of_map_property: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - type: object - MixedPropertiesAndAdditionalPropertiesClass: - properties: - uuid: - format: uuid - type: string - dateTime: - format: date-time - type: string - map: - additionalProperties: - $ref: '#/components/schemas/Animal' - type: object - type: object - List: - properties: - 123-list: - type: string - type: object - Client: - example: - client: client - properties: - client: - type: string - type: object - ReadOnlyFirst: - properties: - bar: - readOnly: true - type: string - baz: - type: string - type: object - hasOnlyReadOnly: - properties: - bar: - readOnly: true - type: string - foo: - readOnly: true - type: string - type: object - Capitalization: - properties: - smallCamel: - type: string - CapitalCamel: - type: string - small_Snake: - type: string - Capital_Snake: - type: string - SCA_ETH_Flow_Points: - type: string - ATT_NAME: - description: | - Name of the pet - type: string - type: object - MapTest: - properties: - map_map_of_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_of_enum_string: - additionalProperties: - enum: - - UPPER - - lower - type: string - type: object - direct_map: - additionalProperties: - type: boolean - type: object - indirect_map: - additionalProperties: - type: boolean - type: object - type: object - ArrayTest: - properties: - array_of_string: - items: - type: string - type: array - array_array_of_integer: - items: - items: - format: int64 - type: integer - type: array - type: array - array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array - type: array - type: object - NumberOnly: - properties: - JustNumber: - type: number - type: object - ArrayOfNumberOnly: - properties: - ArrayNumber: - items: - type: number - type: array - type: object - ArrayOfArrayOfNumberOnly: - properties: - ArrayArrayNumber: - items: - items: - type: number - type: array - type: array - type: object - EnumArrays: - properties: - just_symbol: - enum: - - '>=' - - $ - type: string - array_enum: - items: - enum: - - fish - - crab - type: string - type: array - type: object - OuterEnum: - enum: - - placed - - approved - - delivered - nullable: true - type: string - OuterEnumInteger: - enum: - - 0 - - 1 - - 2 - type: integer - OuterEnumDefaultValue: - default: placed - enum: - - placed - - approved - - delivered - type: string - OuterEnumIntegerDefaultValue: - default: 0 - enum: - - 0 - - 1 - - 2 - type: integer - OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true - properties: - my_number: - type: number - my_string: - type: string - my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object - OuterNumber: - type: number - OuterString: - type: string - OuterBoolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - StringBooleanMap: - additionalProperties: - type: boolean - type: object - FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI - properties: - file: - $ref: '#/components/schemas/File' - files: - items: - $ref: '#/components/schemas/File' - type: array - type: object - File: - description: Must be named `File` for test. - example: - sourceURI: sourceURI - properties: - sourceURI: - description: Test capitalization - type: string - type: object - _special_model.name_: - properties: - $special[property.name]: - format: int64 - type: integer - xml: - name: $special[model.name] - HealthCheckResult: - description: Just a string to inform instance is up and running. Make it nullable - in hope to get it as pointer in generated model. - example: - NullableMessage: NullableMessage - properties: - NullableMessage: - nullable: true - type: string - type: object - NullableClass: - additionalProperties: - nullable: true - type: object - properties: - integer_prop: - nullable: true - type: integer - number_prop: - nullable: true - type: number - boolean_prop: - nullable: true - type: boolean - string_prop: - nullable: true - type: string - date_prop: - format: date - nullable: true - type: string - datetime_prop: - format: date-time - nullable: true - type: string - array_nullable_prop: - items: - type: object - nullable: true - type: array - array_and_items_nullable_prop: - items: - nullable: true - type: object - nullable: true - type: array - array_items_nullable: - items: - nullable: true - type: object - type: array - object_nullable_prop: - additionalProperties: - type: object - nullable: true - type: object - object_and_items_nullable_prop: - additionalProperties: - nullable: true - type: object - nullable: true - type: object - object_items_nullable: - additionalProperties: - nullable: true - type: object - type: object - type: object - inline_response_default: - example: - string: - bar: bar - properties: - string: - $ref: '#/components/schemas/Foo' - inline_object: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - inline_object_1: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - inline_object_2: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - inline_object_3: - properties: - integer: - description: None - maximum: 100 - minimum: 10 - type: integer - int32: - description: None - format: int32 - maximum: 200 - minimum: 20 - type: integer - int64: - description: None - format: int64 - type: integer - number: - description: None - maximum: 543.2 - minimum: 32.1 - type: number - float: - description: None - format: float - maximum: 987.6 - type: number - double: - description: None - format: double - maximum: 123.4 - minimum: 67.8 - type: number - string: - description: None - pattern: /[a-z]/i - type: string - pattern_without_delimiter: - description: None - pattern: ^[A-Z].* - type: string - byte: - description: None - format: byte - type: string - binary: - description: None - format: binary - type: string - date: - description: None - format: date - type: string - dateTime: - description: None - format: date-time - type: string - password: - description: None - format: password - maxLength: 64 - minLength: 10 - type: string - callback: - description: None - type: string - required: - - byte - - double - - number - - pattern_without_delimiter - type: object - inline_object_4: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - inline_object_5: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - Cat_allOf: - properties: - declawed: - type: boolean - securitySchemes: - petstore_auth: - flows: - implicit: - authorizationUrl: http://petstore.swagger.io/api/oauth/dialog - scopes: - write:pets: modify pets in your account - read:pets: read your pets - type: oauth2 - api_key: - in: header - name: api_key - type: apiKey - api_key_query: - in: query - name: api_key_query - type: apiKey - http_basic_test: - scheme: basic - type: http - bearer_test: - bearerFormat: JWT - scheme: bearer - type: http diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/README.md b/samples/openapi3/server/petstore/go-gin-api-server/go/README.md deleted file mode 100644 index dd21f447d5d8..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/README.md +++ /dev/null @@ -1,40 +0,0 @@ -# Go API Server for petstoreserver - -This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - -## Overview -This server was generated by the [openapi-generator] -(https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. -- - -To see how to make this your own, look here: - -[README](https://openapi-generator.tech) - -- API version: 1.0.0 - -### Running the server - -To run the server, follow these simple steps: - -``` -go run main.go -``` - -To run the server in a docker container -``` -docker build --network=host -t petstoreserver . -``` - -Once the image is built, just run -``` -docker run --rm -it petstoreserver -``` - -### Known Issue - -Endpoints sharing a common path may result in issues. For example, `/v2/pet/findByTags` and `/v2/pet/:petId` will result in an issue with the Gin framework. For more information about this known limitation, please refer to [gin-gonic/gin#388](https://github.com/gin-gonic/gin/issues/388) for more information. - -A workaround is to manually update the path and handler. Please refer to [gin-gonic/gin/issues/205#issuecomment-296155497](https://github.com/gin-gonic/gin/issues/205#issuecomment-296155497) for more information. - diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_another_fake.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_another_fake.go deleted file mode 100644 index 93986aa66eee..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_another_fake.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// Call123TestSpecialTags - To test special tags -func Call123TestSpecialTags(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_default.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_default.go deleted file mode 100644 index d19a1886d0ca..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_default.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// FooGet - -func FooGet(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake.go deleted file mode 100644 index 17107d021c5c..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake.go +++ /dev/null @@ -1,86 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// FakeHealthGet - Health check endpoint -func FakeHealthGet(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// FakeOuterBooleanSerialize - -func FakeOuterBooleanSerialize(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// FakeOuterCompositeSerialize - -func FakeOuterCompositeSerialize(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// FakeOuterNumberSerialize - -func FakeOuterNumberSerialize(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// FakeOuterStringSerialize - -func FakeOuterStringSerialize(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestBodyWithFileSchema - -func TestBodyWithFileSchema(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestBodyWithQueryParams - -func TestBodyWithQueryParams(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestClientModel - To test \"client\" model -func TestClientModel(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestEndpointParameters - Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 -func TestEndpointParameters(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestEnumParameters - To test enum parameters -func TestEnumParameters(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestGroupParameters - Fake endpoint to test group parameters (optional) -func TestGroupParameters(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestInlineAdditionalProperties - test inline additionalProperties -func TestInlineAdditionalProperties(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestJsonFormData - test json serialization of form data -func TestJsonFormData(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// TestQueryParameterCollectionFormat - -func TestQueryParameterCollectionFormat(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake_classname_tags123.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake_classname_tags123.go deleted file mode 100644 index 97fd3a46d608..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_fake_classname_tags123.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// TestClassname - To test class name in snake case -func TestClassname(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_pet.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_pet.go deleted file mode 100644 index a24a7d2e5e21..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_pet.go +++ /dev/null @@ -1,61 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// AddPet - Add a new pet to the store -func AddPet(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// DeletePet - Deletes a pet -func DeletePet(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// FindPetsByStatus - Finds Pets by status -func FindPetsByStatus(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// FindPetsByTags - Finds Pets by tags -func FindPetsByTags(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// GetPetById - Find pet by ID -func GetPetById(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// UpdatePet - Update an existing pet -func UpdatePet(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// UpdatePetWithForm - Updates a pet in the store with form data -func UpdatePetWithForm(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// UploadFile - uploads an image -func UploadFile(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// UploadFileWithRequiredFile - uploads an image (required) -func UploadFileWithRequiredFile(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_store.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_store.go deleted file mode 100644 index fd95d3d9541c..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_store.go +++ /dev/null @@ -1,36 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// DeleteOrder - Delete purchase order by ID -func DeleteOrder(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// GetInventory - Returns pet inventories by status -func GetInventory(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// GetOrderById - Find purchase order by ID -func GetOrderById(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// PlaceOrder - Place an order for a pet -func PlaceOrder(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/api_user.go b/samples/openapi3/server/petstore/go-gin-api-server/go/api_user.go deleted file mode 100644 index 710931c2136c..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/api_user.go +++ /dev/null @@ -1,56 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// CreateUser - Create user -func CreateUser(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// CreateUsersWithArrayInput - Creates list of users with given input array -func CreateUsersWithArrayInput(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// CreateUsersWithListInput - Creates list of users with given input array -func CreateUsersWithListInput(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// DeleteUser - Delete user -func DeleteUser(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// GetUserByName - Get user by user name -func GetUserByName(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// LoginUser - Logs user into the system -func LoginUser(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// LogoutUser - Logs out current logged in user session -func LogoutUser(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} - -// UpdateUser - Updated user -func UpdateUser(c *gin.Context) { - c.JSON(http.StatusOK, gin.H{}) -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_200_response.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_200_response.go deleted file mode 100644 index 217fe24e4378..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_200_response.go +++ /dev/null @@ -1,18 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// Model200Response - Model for testing model name starting with number -type Model200Response struct { - - Name int32 `json:"name,omitempty"` - - Class string `json:"class,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model__special_model_name_.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model__special_model_name_.go deleted file mode 100644 index ffc27255ae9b..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model__special_model_name_.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type SpecialModelName struct { - - SpecialPropertyName int64 `json:"$special[property.name],omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_additional_properties_class.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_additional_properties_class.go deleted file mode 100644 index 430177a30074..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_additional_properties_class.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type AdditionalPropertiesClass struct { - - MapProperty map[string]string `json:"map_property,omitempty"` - - MapOfMapProperty map[string]map[string]string `json:"map_of_map_property,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_animal.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_animal.go deleted file mode 100644 index 14d9295d875a..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_animal.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Animal struct { - - ClassName string `json:"className"` - - Color string `json:"color,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_api_response.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_api_response.go deleted file mode 100644 index 380b8dee0089..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_api_response.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ApiResponse struct { - - Code int32 `json:"code,omitempty"` - - Type string `json:"type,omitempty"` - - Message string `json:"message,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_of_array_of_number_only.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_of_array_of_number_only.go deleted file mode 100644 index e0347d8260ae..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_of_array_of_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ArrayOfArrayOfNumberOnly struct { - - ArrayArrayNumber [][]float32 `json:"ArrayArrayNumber,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_of_number_only.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_of_number_only.go deleted file mode 100644 index 04d7c86a5e1e..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_of_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ArrayOfNumberOnly struct { - - ArrayNumber []float32 `json:"ArrayNumber,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_test_.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_test_.go deleted file mode 100644 index a85e460d8c76..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_array_test_.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ArrayTest struct { - - ArrayOfString []string `json:"array_of_string,omitempty"` - - ArrayArrayOfInteger [][]int64 `json:"array_array_of_integer,omitempty"` - - ArrayArrayOfModel [][]ReadOnlyFirst `json:"array_array_of_model,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_capitalization.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_capitalization.go deleted file mode 100644 index 1e1cb8acc3fc..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_capitalization.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Capitalization struct { - - SmallCamel string `json:"smallCamel,omitempty"` - - CapitalCamel string `json:"CapitalCamel,omitempty"` - - SmallSnake string `json:"small_Snake,omitempty"` - - CapitalSnake string `json:"Capital_Snake,omitempty"` - - SCAETHFlowPoints string `json:"SCA_ETH_Flow_Points,omitempty"` - - // Name of the pet - ATT_NAME string `json:"ATT_NAME,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat.go deleted file mode 100644 index 78261ede6121..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Cat struct { - - ClassName string `json:"className"` - - Color string `json:"color,omitempty"` - - Declawed bool `json:"declawed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go deleted file mode 100644 index 312c33895f8d..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_cat_all_of.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type CatAllOf struct { - - Declawed bool `json:"declawed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_category.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_category.go deleted file mode 100644 index 373c419af559..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_category.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Category struct { - - Id int64 `json:"id,omitempty"` - - Name string `json:"name"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_class_model.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_class_model.go deleted file mode 100644 index d9fcd475b7bc..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_class_model.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// ClassModel - Model for testing model with \"_class\" property -type ClassModel struct { - - Class string `json:"_class,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_client.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_client.go deleted file mode 100644 index f49c616f021f..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_client.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Client struct { - - Client string `json:"client,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog.go deleted file mode 100644 index 04b2a9ba9aae..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Dog struct { - - ClassName string `json:"className"` - - Color string `json:"color,omitempty"` - - Breed string `json:"breed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go deleted file mode 100644 index a36b96b1a0cb..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_dog_all_of.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type DogAllOf struct { - - Breed string `json:"breed,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_arrays.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_arrays.go deleted file mode 100644 index 813af5d87012..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_arrays.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type EnumArrays struct { - - JustSymbol string `json:"just_symbol,omitempty"` - - ArrayEnum []string `json:"array_enum,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_class.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_class.go deleted file mode 100644 index da4428a5d41d..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_class.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type EnumClass string - -// List of EnumClass -const ( - ABC EnumClass = "_abc" - EFG EnumClass = "-efg" - XYZ EnumClass = "(xyz)" -) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go deleted file mode 100644 index 7822fd4e9d4a..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_enum_test_.go +++ /dev/null @@ -1,29 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type EnumTest struct { - - EnumString string `json:"enum_string,omitempty"` - - EnumStringRequired string `json:"enum_string_required"` - - EnumInteger int32 `json:"enum_integer,omitempty"` - - EnumNumber float64 `json:"enum_number,omitempty"` - - OuterEnum *OuterEnum `json:"outerEnum,omitempty"` - - OuterEnumInteger OuterEnumInteger `json:"outerEnumInteger,omitempty"` - - OuterEnumDefaultValue OuterEnumDefaultValue `json:"outerEnumDefaultValue,omitempty"` - - OuterEnumIntegerDefaultValue OuterEnumIntegerDefaultValue `json:"outerEnumIntegerDefaultValue,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_file.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_file.go deleted file mode 100644 index 9bbc4164c2e2..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_file.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// File - Must be named `File` for test. -type File struct { - - // Test capitalization - SourceURI string `json:"sourceURI,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_file_schema_test_class.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_file_schema_test_class.go deleted file mode 100644 index c9e7600031ea..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_file_schema_test_class.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type FileSchemaTestClass struct { - - File File `json:"file,omitempty"` - - Files []File `json:"files,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_foo.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_foo.go deleted file mode 100644 index 9e85ac9ab6c7..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_foo.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Foo struct { - - Bar string `json:"bar,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_format_test_.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_format_test_.go deleted file mode 100644 index eaa3ce019a74..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_format_test_.go +++ /dev/null @@ -1,50 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" - "time" -) - -type FormatTest struct { - - Integer int32 `json:"integer,omitempty"` - - Int32 int32 `json:"int32,omitempty"` - - Int64 int64 `json:"int64,omitempty"` - - Number float32 `json:"number"` - - Float float32 `json:"float,omitempty"` - - Double float64 `json:"double,omitempty"` - - String string `json:"string,omitempty"` - - Byte string `json:"byte"` - - Binary *os.File `json:"binary,omitempty"` - - Date string `json:"date"` - - DateTime time.Time `json:"dateTime,omitempty"` - - Uuid string `json:"uuid,omitempty"` - - Password string `json:"password"` - - // A string that is a 10 digit number. Can have leading zeros. - PatternWithDigits string `json:"pattern_with_digits,omitempty"` - - // A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. - PatternWithDigitsAndDelimiter string `json:"pattern_with_digits_and_delimiter,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_has_only_read_only.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_has_only_read_only.go deleted file mode 100644 index d64b0e012c7d..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_has_only_read_only.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type HasOnlyReadOnly struct { - - Bar string `json:"bar,omitempty"` - - Foo string `json:"foo,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_health_check_result.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_health_check_result.go deleted file mode 100644 index 9cebb74d3cbb..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_health_check_result.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// HealthCheckResult - Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. -type HealthCheckResult struct { - - NullableMessage *string `json:"NullableMessage,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_2.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_2.go deleted file mode 100644 index 3babd0cfac99..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_2.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineObject2 struct { - - // Form parameter enum test (string array) - EnumFormStringArray []string `json:"enum_form_string_array,omitempty"` - - // Form parameter enum test (string) - EnumFormString string `json:"enum_form_string,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_3.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_3.go deleted file mode 100644 index 226092059da7..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_3.go +++ /dev/null @@ -1,60 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" - "time" -) - -type InlineObject3 struct { - - // None - Integer int32 `json:"integer,omitempty"` - - // None - Int32 int32 `json:"int32,omitempty"` - - // None - Int64 int64 `json:"int64,omitempty"` - - // None - Number float32 `json:"number"` - - // None - Float float32 `json:"float,omitempty"` - - // None - Double float64 `json:"double"` - - // None - String string `json:"string,omitempty"` - - // None - PatternWithoutDelimiter string `json:"pattern_without_delimiter"` - - // None - Byte string `json:"byte"` - - // None - Binary *os.File `json:"binary,omitempty"` - - // None - Date string `json:"date,omitempty"` - - // None - DateTime time.Time `json:"dateTime,omitempty"` - - // None - Password string `json:"password,omitempty"` - - // None - Callback string `json:"callback,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_4.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_4.go deleted file mode 100644 index 23db282a2e15..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_4.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineObject4 struct { - - // field1 - Param string `json:"param"` - - // field2 - Param2 string `json:"param2"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_5.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_5.go deleted file mode 100644 index 8004ded7ce51..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_5.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "os" -) - -type InlineObject5 struct { - - // Additional data to pass to server - AdditionalMetadata string `json:"additionalMetadata,omitempty"` - - // file to upload - RequiredFile *os.File `json:"requiredFile"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_response_default.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_response_default.go deleted file mode 100644 index 50f4bb4f2bd4..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_response_default.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type InlineResponseDefault struct { - - String Foo `json:"string,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_list.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_list.go deleted file mode 100644 index a6bf160a13c4..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_list.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type List struct { - - Var123List string `json:"123-list,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_map_test_.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_map_test_.go deleted file mode 100644 index 49a86a792ac9..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_map_test_.go +++ /dev/null @@ -1,21 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type MapTest struct { - - MapMapOfString map[string]map[string]string `json:"map_map_of_string,omitempty"` - - MapOfEnumString map[string]string `json:"map_of_enum_string,omitempty"` - - DirectMap map[string]bool `json:"direct_map,omitempty"` - - IndirectMap map[string]bool `json:"indirect_map,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_mixed_properties_and_additional_properties_class.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_mixed_properties_and_additional_properties_class.go deleted file mode 100644 index e25d32587cd5..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_mixed_properties_and_additional_properties_class.go +++ /dev/null @@ -1,23 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "time" -) - -type MixedPropertiesAndAdditionalPropertiesClass struct { - - Uuid string `json:"uuid,omitempty"` - - DateTime time.Time `json:"dateTime,omitempty"` - - Map map[string]Animal `json:"map,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_name.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_name.go deleted file mode 100644 index cd9a874c4190..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_name.go +++ /dev/null @@ -1,22 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// Name - Model for testing model name same as property name -type Name struct { - - Name int32 `json:"name"` - - SnakeCase int32 `json:"snake_case,omitempty"` - - Property string `json:"property,omitempty"` - - Var123Number int32 `json:"123Number,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go deleted file mode 100644 index ba2aa1f86cfa..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_nullable_class.go +++ /dev/null @@ -1,41 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "time" -) - -type NullableClass struct { - - IntegerProp *int32 `json:"integer_prop,omitempty"` - - NumberProp *float32 `json:"number_prop,omitempty"` - - BooleanProp *bool `json:"boolean_prop,omitempty"` - - StringProp *string `json:"string_prop,omitempty"` - - DateProp *string `json:"date_prop,omitempty"` - - DatetimeProp *time.Time `json:"datetime_prop,omitempty"` - - ArrayNullableProp *[]map[string]interface{} `json:"array_nullable_prop,omitempty"` - - ArrayAndItemsNullableProp *[]map[string]interface{} `json:"array_and_items_nullable_prop,omitempty"` - - ArrayItemsNullable []map[string]interface{} `json:"array_items_nullable,omitempty"` - - ObjectNullableProp *map[string]map[string]interface{} `json:"object_nullable_prop,omitempty"` - - ObjectAndItemsNullableProp *map[string]map[string]interface{} `json:"object_and_items_nullable_prop,omitempty"` - - ObjectItemsNullable map[string]map[string]interface{} `json:"object_items_nullable,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_number_only.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_number_only.go deleted file mode 100644 index ba6f4af64015..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_number_only.go +++ /dev/null @@ -1,15 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type NumberOnly struct { - - JustNumber float32 `json:"JustNumber,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_order.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_order.go deleted file mode 100644 index 6849a9f76d69..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_order.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "time" -) - -type Order struct { - - Id int64 `json:"id,omitempty"` - - PetId int64 `json:"petId,omitempty"` - - Quantity int32 `json:"quantity,omitempty"` - - ShipDate time.Time `json:"shipDate,omitempty"` - - // Order Status - Status string `json:"status,omitempty"` - - Complete bool `json:"complete,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_composite.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_composite.go deleted file mode 100644 index 7534db47c2e4..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_composite.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterComposite struct { - - MyNumber float32 `json:"my_number,omitempty"` - - MyString string `json:"my_string,omitempty"` - - MyBoolean bool `json:"my_boolean,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum.go deleted file mode 100644 index d01d988ccda2..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnum string - -// List of OuterEnum -const ( - PLACED OuterEnum = "placed" - APPROVED OuterEnum = "approved" - DELIVERED OuterEnum = "delivered" -) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_default_value.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_default_value.go deleted file mode 100644 index 12881121ff32..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_default_value.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnumDefaultValue string - -// List of OuterEnumDefaultValue -const ( - PLACED OuterEnumDefaultValue = "placed" - APPROVED OuterEnumDefaultValue = "approved" - DELIVERED OuterEnumDefaultValue = "delivered" -) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer.go deleted file mode 100644 index f14b13342aff..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnumInteger int32 - -// List of OuterEnumInteger -const ( - _0 OuterEnumInteger = 0 - _1 OuterEnumInteger = 1 - _2 OuterEnumInteger = 2 -) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer_default_value.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer_default_value.go deleted file mode 100644 index 94b4bb2077a7..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_outer_enum_integer_default_value.go +++ /dev/null @@ -1,19 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type OuterEnumIntegerDefaultValue int32 - -// List of OuterEnumIntegerDefaultValue -const ( - _0 OuterEnumIntegerDefaultValue = 0 - _1 OuterEnumIntegerDefaultValue = 1 - _2 OuterEnumIntegerDefaultValue = 2 -) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_pet.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_pet.go deleted file mode 100644 index 2271730674e2..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_pet.go +++ /dev/null @@ -1,26 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Pet struct { - - Id int64 `json:"id,omitempty"` - - Category Category `json:"category,omitempty"` - - Name string `json:"name"` - - PhotoUrls []string `json:"photoUrls"` - - Tags []Tag `json:"tags,omitempty"` - - // pet status in the store - Status string `json:"status,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_read_only_first.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_read_only_first.go deleted file mode 100644 index c4192d91ee26..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_read_only_first.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type ReadOnlyFirst struct { - - Bar string `json:"bar,omitempty"` - - Baz string `json:"baz,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_return.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_return.go deleted file mode 100644 index 0ff664525de8..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_return.go +++ /dev/null @@ -1,16 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -// Return - Model for testing reserved words -type Return struct { - - Return int32 `json:"return,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_tag.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_tag.go deleted file mode 100644 index 29cd4d64ae35..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_tag.go +++ /dev/null @@ -1,17 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type Tag struct { - - Id int64 `json:"id,omitempty"` - - Name string `json:"name,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_user.go b/samples/openapi3/server/petstore/go-gin-api-server/go/model_user.go deleted file mode 100644 index 1eda4c6f763f..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_user.go +++ /dev/null @@ -1,30 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -type User struct { - - Id int64 `json:"id,omitempty"` - - Username string `json:"username,omitempty"` - - FirstName string `json:"firstName,omitempty"` - - LastName string `json:"lastName,omitempty"` - - Email string `json:"email,omitempty"` - - Password string `json:"password,omitempty"` - - Phone string `json:"phone,omitempty"` - - // User Status - UserStatus int32 `json:"userStatus,omitempty"` -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go b/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go deleted file mode 100644 index 4d05d282f980..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/routers.go +++ /dev/null @@ -1,330 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package petstoreserver - -import ( - "net/http" - - "github.com/gin-gonic/gin" -) - -// Route is the information for every URI. -type Route struct { - // Name is the name of this Route. - Name string - // Method is the string for the HTTP method. ex) GET, POST etc.. - Method string - // Pattern is the pattern of the URI. - Pattern string - // HandlerFunc is the handler function of this route. - HandlerFunc gin.HandlerFunc -} - -// Routes is the list of the generated Route. -type Routes []Route - -// NewRouter returns a new router. -func NewRouter() *gin.Engine { - router := gin.Default() - for _, route := range routes { - switch route.Method { - case http.MethodGet: - router.GET(route.Pattern, route.HandlerFunc) - case http.MethodPost: - router.POST(route.Pattern, route.HandlerFunc) - case http.MethodPut: - router.PUT(route.Pattern, route.HandlerFunc) - case http.MethodDelete: - router.DELETE(route.Pattern, route.HandlerFunc) - } - } - - return router -} - -// Index is the index handler. -func Index(c *gin.Context) { - c.String(http.StatusOK, "Hello World!") -} - -var routes = Routes{ - { - "Index", - http.MethodGet, - "/v2/", - Index, - }, - - { - "Call123TestSpecialTags", - http.MethodPatch, - "/v2/another-fake/dummy", - Call123TestSpecialTags, - }, - - { - "FooGet", - http.MethodGet, - "/v2/foo", - FooGet, - }, - - { - "FakeHealthGet", - http.MethodGet, - "/v2/fake/health", - FakeHealthGet, - }, - - { - "FakeOuterBooleanSerialize", - http.MethodPost, - "/v2/fake/outer/boolean", - FakeOuterBooleanSerialize, - }, - - { - "FakeOuterCompositeSerialize", - http.MethodPost, - "/v2/fake/outer/composite", - FakeOuterCompositeSerialize, - }, - - { - "FakeOuterNumberSerialize", - http.MethodPost, - "/v2/fake/outer/number", - FakeOuterNumberSerialize, - }, - - { - "FakeOuterStringSerialize", - http.MethodPost, - "/v2/fake/outer/string", - FakeOuterStringSerialize, - }, - - { - "TestBodyWithFileSchema", - http.MethodPut, - "/v2/fake/body-with-file-schema", - TestBodyWithFileSchema, - }, - - { - "TestBodyWithQueryParams", - http.MethodPut, - "/v2/fake/body-with-query-params", - TestBodyWithQueryParams, - }, - - { - "TestClientModel", - http.MethodPatch, - "/v2/fake", - TestClientModel, - }, - - { - "TestEndpointParameters", - http.MethodPost, - "/v2/fake", - TestEndpointParameters, - }, - - { - "TestEnumParameters", - http.MethodGet, - "/v2/fake", - TestEnumParameters, - }, - - { - "TestGroupParameters", - http.MethodDelete, - "/v2/fake", - TestGroupParameters, - }, - - { - "TestInlineAdditionalProperties", - http.MethodPost, - "/v2/fake/inline-additionalProperties", - TestInlineAdditionalProperties, - }, - - { - "TestJsonFormData", - http.MethodGet, - "/v2/fake/jsonFormData", - TestJsonFormData, - }, - - { - "TestQueryParameterCollectionFormat", - http.MethodPut, - "/v2/fake/test-query-paramters", - TestQueryParameterCollectionFormat, - }, - - { - "TestClassname", - http.MethodPatch, - "/v2/fake_classname_test", - TestClassname, - }, - - { - "AddPet", - http.MethodPost, - "/v2/pet", - AddPet, - }, - - { - "DeletePet", - http.MethodDelete, - "/v2/pet/:petId", - DeletePet, - }, - - { - "FindPetsByStatus", - http.MethodGet, - "/v2/pet/findByStatus", - FindPetsByStatus, - }, - - { - "FindPetsByTags", - http.MethodGet, - "/v2/pet/findByTags", - FindPetsByTags, - }, - - { - "GetPetById", - http.MethodGet, - "/v2/pet/:petId", - GetPetById, - }, - - { - "UpdatePet", - http.MethodPut, - "/v2/pet", - UpdatePet, - }, - - { - "UpdatePetWithForm", - http.MethodPost, - "/v2/pet/:petId", - UpdatePetWithForm, - }, - - { - "UploadFile", - http.MethodPost, - "/v2/pet/:petId/uploadImage", - UploadFile, - }, - - { - "UploadFileWithRequiredFile", - http.MethodPost, - "/v2/fake/:petId/uploadImageWithRequiredFile", - UploadFileWithRequiredFile, - }, - - { - "DeleteOrder", - http.MethodDelete, - "/v2/store/order/:order_id", - DeleteOrder, - }, - - { - "GetInventory", - http.MethodGet, - "/v2/store/inventory", - GetInventory, - }, - - { - "GetOrderById", - http.MethodGet, - "/v2/store/order/:order_id", - GetOrderById, - }, - - { - "PlaceOrder", - http.MethodPost, - "/v2/store/order", - PlaceOrder, - }, - - { - "CreateUser", - http.MethodPost, - "/v2/user", - CreateUser, - }, - - { - "CreateUsersWithArrayInput", - http.MethodPost, - "/v2/user/createWithArray", - CreateUsersWithArrayInput, - }, - - { - "CreateUsersWithListInput", - http.MethodPost, - "/v2/user/createWithList", - CreateUsersWithListInput, - }, - - { - "DeleteUser", - http.MethodDelete, - "/v2/user/:username", - DeleteUser, - }, - - { - "GetUserByName", - http.MethodGet, - "/v2/user/:username", - GetUserByName, - }, - - { - "LoginUser", - http.MethodGet, - "/v2/user/login", - LoginUser, - }, - - { - "LogoutUser", - http.MethodGet, - "/v2/user/logout", - LogoutUser, - }, - - { - "UpdateUser", - http.MethodPut, - "/v2/user/:username", - UpdateUser, - }, -} diff --git a/samples/openapi3/server/petstore/go-gin-api-server/main.go b/samples/openapi3/server/petstore/go-gin-api-server/main.go deleted file mode 100644 index ce68d62b90fe..000000000000 --- a/samples/openapi3/server/petstore/go-gin-api-server/main.go +++ /dev/null @@ -1,31 +0,0 @@ -/* - * OpenAPI Petstore - * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ - * - * API version: 1.0.0 - * Generated by: OpenAPI Generator (https://openapi-generator.tech) - */ - -package main - -import ( - "log" - - // WARNING! - // Change this to a fully-qualified import path - // once you place this file into your project. - // For example, - // - // sw "github.com/myname/myrepo/go" - // - sw "./go" -) - -func main() { - log.Printf("Server started") - - router := sw.NewRouter() - - log.Fatal(router.Run(":8080")) -} diff --git a/samples/server/petstore/go-api-server/.openapi-generator/FILES b/samples/server/petstore/go-api-server/.openapi-generator/FILES index f78be91ace57..40a9445dadf3 100644 --- a/samples/server/petstore/go-api-server/.openapi-generator/FILES +++ b/samples/server/petstore/go-api-server/.openapi-generator/FILES @@ -12,6 +12,8 @@ go/api_user_service.go go/logger.go go/model_api_response.go go/model_category.go +go/model_inline_object.go +go/model_inline_object_1.go go/model_order.go go/model_pet.go go/model_tag.go diff --git a/samples/server/petstore/go-api-server/api/openapi.yaml b/samples/server/petstore/go-api-server/api/openapi.yaml index 0c61c2099572..26aaeac34b7d 100644 --- a/samples/server/petstore/go-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-api-server/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -7,6 +7,9 @@ info: url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -21,18 +24,18 @@ paths: post: operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -41,28 +44,25 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body put: operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -71,7 +71,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -107,11 +106,9 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -148,11 +145,9 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -161,20 +156,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -188,12 +187,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -205,10 +206,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -219,13 +218,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -236,9 +238,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -252,13 +254,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -270,6 +275,7 @@ paths: description: file to upload format: binary type: string + type: object responses: "200": content: @@ -308,7 +314,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -324,12 +330,10 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body /store/order/{orderId}: delete: description: For valid response try integer IDs with value < 1000. Anything @@ -337,17 +341,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: orderId required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -358,6 +362,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: orderId required: true @@ -366,6 +371,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -377,10 +383,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -391,75 +395,66 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Create user tags: - user - x-codegen-request-body-name: body /user/createWithArray: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/createWithList: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/login: get: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -471,18 +466,29 @@ paths: type: string description: successful operation headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when toekn expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -492,8 +498,9 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Logs out current logged in user session tags: - user @@ -503,18 +510,20 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found + security: + - api_key: [] summary: Delete user tags: - user @@ -522,11 +531,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -538,10 +549,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -551,30 +560,61 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found + security: + - api_key: [] summary: Updated user tags: - user - x-codegen-request-body-name: body components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -622,6 +662,7 @@ components: format: int64 type: integer name: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string title: Pet category type: object @@ -747,6 +788,25 @@ components: type: string title: An uploaded response type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/server/petstore/go-api-server/go/api_pet.go b/samples/server/petstore/go-api-server/go/api_pet.go index f5275ecbef31..f836529089a8 100644 --- a/samples/server/petstore/go-api-server/go/api_pet.go +++ b/samples/server/petstore/go-api-server/go/api_pet.go @@ -83,13 +83,13 @@ func (c *PetApiController) Routes() Routes { // AddPet - Add a new pet to the store func (c *PetApiController) AddPet(w http.ResponseWriter, r *http.Request) { - body := &Pet{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + pet := &Pet{} + if err := json.NewDecoder(r.Body).Decode(&pet); err != nil { w.WriteHeader(500) return } - result, err := c.service.AddPet(*body) + result, err := c.service.AddPet(*pet) if err != nil { w.WriteHeader(500) return @@ -163,13 +163,13 @@ func (c *PetApiController) GetPetById(w http.ResponseWriter, r *http.Request) { // UpdatePet - Update an existing pet func (c *PetApiController) UpdatePet(w http.ResponseWriter, r *http.Request) { - body := &Pet{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + pet := &Pet{} + if err := json.NewDecoder(r.Body).Decode(&pet); err != nil { w.WriteHeader(500) return } - result, err := c.service.UpdatePet(*body) + result, err := c.service.UpdatePet(*pet) if err != nil { w.WriteHeader(500) return diff --git a/samples/server/petstore/go-api-server/go/api_pet_service.go b/samples/server/petstore/go-api-server/go/api_pet_service.go index 815eac5c7a90..cca444d5009c 100644 --- a/samples/server/petstore/go-api-server/go/api_pet_service.go +++ b/samples/server/petstore/go-api-server/go/api_pet_service.go @@ -26,7 +26,7 @@ func NewPetApiService() PetApiServicer { } // AddPet - Add a new pet to the store -func (s *PetApiService) AddPet(body Pet) (interface{}, error) { +func (s *PetApiService) AddPet(pet Pet) (interface{}, error) { // TODO - update AddPet with the required logic for this service method. // Add api_pet_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. return nil, errors.New("service method 'AddPet' not implemented") @@ -61,7 +61,7 @@ func (s *PetApiService) GetPetById(petId int64) (interface{}, error) { } // UpdatePet - Update an existing pet -func (s *PetApiService) UpdatePet(body Pet) (interface{}, error) { +func (s *PetApiService) UpdatePet(pet Pet) (interface{}, error) { // TODO - update UpdatePet with the required logic for this service method. // Add api_pet_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. return nil, errors.New("service method 'UpdatePet' not implemented") diff --git a/samples/server/petstore/go-api-server/go/api_store.go b/samples/server/petstore/go-api-server/go/api_store.go index fc9da3c0ee54..c79f13eeb05d 100644 --- a/samples/server/petstore/go-api-server/go/api_store.go +++ b/samples/server/petstore/go-api-server/go/api_store.go @@ -101,13 +101,13 @@ func (c *StoreApiController) GetOrderById(w http.ResponseWriter, r *http.Request // PlaceOrder - Place an order for a pet func (c *StoreApiController) PlaceOrder(w http.ResponseWriter, r *http.Request) { - body := &Order{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + order := &Order{} + if err := json.NewDecoder(r.Body).Decode(&order); err != nil { w.WriteHeader(500) return } - result, err := c.service.PlaceOrder(*body) + result, err := c.service.PlaceOrder(*order) if err != nil { w.WriteHeader(500) return diff --git a/samples/server/petstore/go-api-server/go/api_store_service.go b/samples/server/petstore/go-api-server/go/api_store_service.go index 749c12cf8526..9bd0b307ba31 100644 --- a/samples/server/petstore/go-api-server/go/api_store_service.go +++ b/samples/server/petstore/go-api-server/go/api_store_service.go @@ -46,7 +46,7 @@ func (s *StoreApiService) GetOrderById(orderId int64) (interface{}, error) { } // PlaceOrder - Place an order for a pet -func (s *StoreApiService) PlaceOrder(body Order) (interface{}, error) { +func (s *StoreApiService) PlaceOrder(order Order) (interface{}, error) { // TODO - update PlaceOrder with the required logic for this service method. // Add api_store_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. return nil, errors.New("service method 'PlaceOrder' not implemented") diff --git a/samples/server/petstore/go-api-server/go/api_user.go b/samples/server/petstore/go-api-server/go/api_user.go index a6618b9d62db..60c0b787a03b 100644 --- a/samples/server/petstore/go-api-server/go/api_user.go +++ b/samples/server/petstore/go-api-server/go/api_user.go @@ -83,13 +83,13 @@ func (c *UserApiController) Routes() Routes { // CreateUser - Create user func (c *UserApiController) CreateUser(w http.ResponseWriter, r *http.Request) { - body := &User{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + user := &User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { w.WriteHeader(500) return } - result, err := c.service.CreateUser(*body) + result, err := c.service.CreateUser(*user) if err != nil { w.WriteHeader(500) return @@ -100,13 +100,13 @@ func (c *UserApiController) CreateUser(w http.ResponseWriter, r *http.Request) { // CreateUsersWithArrayInput - Creates list of users with given input array func (c *UserApiController) CreateUsersWithArrayInput(w http.ResponseWriter, r *http.Request) { - body := &[]User{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + user := &[]User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { w.WriteHeader(500) return } - result, err := c.service.CreateUsersWithArrayInput(*body) + result, err := c.service.CreateUsersWithArrayInput(*user) if err != nil { w.WriteHeader(500) return @@ -117,13 +117,13 @@ func (c *UserApiController) CreateUsersWithArrayInput(w http.ResponseWriter, r * // CreateUsersWithListInput - Creates list of users with given input array func (c *UserApiController) CreateUsersWithListInput(w http.ResponseWriter, r *http.Request) { - body := &[]User{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + user := &[]User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { w.WriteHeader(500) return } - result, err := c.service.CreateUsersWithListInput(*body) + result, err := c.service.CreateUsersWithListInput(*user) if err != nil { w.WriteHeader(500) return @@ -187,13 +187,13 @@ func (c *UserApiController) LogoutUser(w http.ResponseWriter, r *http.Request) { func (c *UserApiController) UpdateUser(w http.ResponseWriter, r *http.Request) { params := mux.Vars(r) username := params["username"] - body := &User{} - if err := json.NewDecoder(r.Body).Decode(&body); err != nil { + user := &User{} + if err := json.NewDecoder(r.Body).Decode(&user); err != nil { w.WriteHeader(500) return } - result, err := c.service.UpdateUser(username, *body) + result, err := c.service.UpdateUser(username, *user) if err != nil { w.WriteHeader(500) return diff --git a/samples/server/petstore/go-api-server/go/api_user_service.go b/samples/server/petstore/go-api-server/go/api_user_service.go index 1136ac01129e..928ed73b0244 100644 --- a/samples/server/petstore/go-api-server/go/api_user_service.go +++ b/samples/server/petstore/go-api-server/go/api_user_service.go @@ -25,21 +25,21 @@ func NewUserApiService() UserApiServicer { } // CreateUser - Create user -func (s *UserApiService) CreateUser(body User) (interface{}, error) { +func (s *UserApiService) CreateUser(user User) (interface{}, error) { // TODO - update CreateUser with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. return nil, errors.New("service method 'CreateUser' not implemented") } // CreateUsersWithArrayInput - Creates list of users with given input array -func (s *UserApiService) CreateUsersWithArrayInput(body []User) (interface{}, error) { +func (s *UserApiService) CreateUsersWithArrayInput(user []User) (interface{}, error) { // TODO - update CreateUsersWithArrayInput with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. return nil, errors.New("service method 'CreateUsersWithArrayInput' not implemented") } // CreateUsersWithListInput - Creates list of users with given input array -func (s *UserApiService) CreateUsersWithListInput(body []User) (interface{}, error) { +func (s *UserApiService) CreateUsersWithListInput(user []User) (interface{}, error) { // TODO - update CreateUsersWithListInput with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. return nil, errors.New("service method 'CreateUsersWithListInput' not implemented") @@ -74,7 +74,7 @@ func (s *UserApiService) LogoutUser() (interface{}, error) { } // UpdateUser - Updated user -func (s *UserApiService) UpdateUser(username string, body User) (interface{}, error) { +func (s *UserApiService) UpdateUser(username string, user User) (interface{}, error) { // TODO - update UpdateUser with the required logic for this service method. // Add api_user_service.go to the .openapi-generator-ignore to avoid overwriting this service implementation when updating open api generation. return nil, errors.New("service method 'UpdateUser' not implemented") diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object.go b/samples/server/petstore/go-api-server/go/model_inline_object.go similarity index 66% rename from samples/openapi3/server/petstore/go-api-server/go/model_inline_object.go rename to samples/server/petstore/go-api-server/go/model_inline_object.go index bcf674af316a..ee13c18c29aa 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object.go +++ b/samples/server/petstore/go-api-server/go/model_inline_object.go @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * API version: 1.0.0 * Generated by: OpenAPI Generator (https://openapi-generator.tech) diff --git a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_1.go b/samples/server/petstore/go-api-server/go/model_inline_object_1.go similarity index 69% rename from samples/openapi3/server/petstore/go-api-server/go/model_inline_object_1.go rename to samples/server/petstore/go-api-server/go/model_inline_object_1.go index aafa96f4352a..b0d0fb4cfc3e 100644 --- a/samples/openapi3/server/petstore/go-api-server/go/model_inline_object_1.go +++ b/samples/server/petstore/go-api-server/go/model_inline_object_1.go @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * API version: 1.0.0 * Generated by: OpenAPI Generator (https://openapi-generator.tech) diff --git a/samples/server/petstore/go-gin-api-server/.openapi-generator/FILES b/samples/server/petstore/go-gin-api-server/.openapi-generator/FILES index 8d594bbb91b3..3818d98f9c43 100644 --- a/samples/server/petstore/go-gin-api-server/.openapi-generator/FILES +++ b/samples/server/petstore/go-gin-api-server/.openapi-generator/FILES @@ -6,6 +6,8 @@ go/api_store.go go/api_user.go go/model_api_response.go go/model_category.go +go/model_inline_object.go +go/model_inline_object_1.go go/model_order.go go/model_pet.go go/model_tag.go diff --git a/samples/server/petstore/go-gin-api-server/api/openapi.yaml b/samples/server/petstore/go-gin-api-server/api/openapi.yaml index 0c61c2099572..26aaeac34b7d 100644 --- a/samples/server/petstore/go-gin-api-server/api/openapi.yaml +++ b/samples/server/petstore/go-gin-api-server/api/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +openapi: 3.0.0 info: description: This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. @@ -7,6 +7,9 @@ info: url: https://www.apache.org/licenses/LICENSE-2.0.html title: OpenAPI Petstore version: 1.0.0 +externalDocs: + description: Find out more about Swagger + url: http://swagger.io servers: - url: http://petstore.swagger.io/v2 tags: @@ -21,18 +24,18 @@ paths: post: operationId: addPet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -41,28 +44,25 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body put: operationId: updatePet requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Pet' - application/xml: - schema: - $ref: '#/components/schemas/Pet' - description: Pet object that needs to be added to the store - required: true + $ref: '#/components/requestBodies/Pet' responses: + "200": + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -71,7 +71,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body /pet/findByStatus: get: description: Multiple status values can be provided with comma separated strings @@ -107,11 +106,9 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by status tags: @@ -148,11 +145,9 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: - - write:pets - read:pets summary: Finds Pets by tags tags: @@ -161,20 +156,24 @@ paths: delete: operationId: deletePet parameters: - - in: header + - explode: false + in: header name: api_key + required: false schema: type: string + style: simple - description: Pet id to delete + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -188,12 +187,14 @@ paths: operationId: getPetById parameters: - description: ID of pet to return + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple responses: "200": content: @@ -205,10 +206,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -219,13 +218,16 @@ paths: operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object' content: application/x-www-form-urlencoded: schema: @@ -236,9 +238,9 @@ paths: status: description: Updated status of the pet type: string + type: object responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -252,13 +254,16 @@ paths: operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: + $ref: '#/components/requestBodies/inline_object_1' content: multipart/form-data: schema: @@ -270,6 +275,7 @@ paths: description: file to upload format: binary type: string + type: object responses: "200": content: @@ -308,7 +314,7 @@ paths: operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -324,12 +330,10 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body /store/order/{orderId}: delete: description: For valid response try integer IDs with value < 1000. Anything @@ -337,17 +341,17 @@ paths: operationId: deleteOrder parameters: - description: ID of the order that needs to be deleted + explode: false in: path name: orderId required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -358,6 +362,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: orderId required: true @@ -366,6 +371,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -377,10 +383,8 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Find purchase order by ID tags: @@ -391,75 +395,66 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Create user tags: - user - x-codegen-request-body-name: body /user/createWithArray: post: operationId: createUsersWithArrayInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/createWithList: post: operationId: createUsersWithListInput requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true + $ref: '#/components/requestBodies/UserArray' responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body /user/login: get: operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -471,18 +466,29 @@ paths: type: string description: successful operation headers: + Set-Cookie: + description: Cookie authentication key for use with the `api_key` apiKey + authentication. + explode: false + schema: + example: AUTH_KEY=abcde12345; Path=/; HttpOnly + type: string + style: simple X-Rate-Limit: description: calls per hour allowed by the user + explode: false schema: format: int32 type: integer + style: simple X-Expires-After: description: date in UTC when toekn expires + explode: false schema: format: date-time type: string + style: simple "400": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -492,8 +498,9 @@ paths: operationId: logoutUser responses: default: - content: {} description: successful operation + security: + - api_key: [] summary: Logs out current logged in user session tags: - user @@ -503,18 +510,20 @@ paths: operationId: deleteUser parameters: - description: The name that needs to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found + security: + - api_key: [] summary: Delete user tags: - user @@ -522,11 +531,13 @@ paths: operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -538,10 +549,8 @@ paths: $ref: '#/components/schemas/User' description: successful operation "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found summary: Get user by user name tags: @@ -551,30 +560,61 @@ paths: operationId: updateUser parameters: - description: name that need to be deleted + explode: false in: path name: username required: true schema: type: string + style: simple requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found + security: + - api_key: [] summary: Updated user tags: - user - x-codegen-request-body-name: body components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true + inline_object: + content: + application/x-www-form-urlencoded: + schema: + $ref: '#/components/schemas/inline_object' + inline_object_1: + content: + multipart/form-data: + schema: + $ref: '#/components/schemas/inline_object_1' schemas: Order: description: An order for a pets from the pet store @@ -622,6 +662,7 @@ components: format: int64 type: integer name: + pattern: ^[a-zA-Z0-9]+[a-zA-Z0-9\.\-_]*[a-zA-Z0-9]+$ type: string title: Pet category type: object @@ -747,6 +788,25 @@ components: type: string title: An uploaded response type: object + inline_object: + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + type: object + inline_object_1: + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + format: binary + type: string + type: object securitySchemes: petstore_auth: flows: diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object.go b/samples/server/petstore/go-gin-api-server/go/model_inline_object.go similarity index 66% rename from samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object.go rename to samples/server/petstore/go-gin-api-server/go/model_inline_object.go index bcf674af316a..ee13c18c29aa 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object.go +++ b/samples/server/petstore/go-gin-api-server/go/model_inline_object.go @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * API version: 1.0.0 * Generated by: OpenAPI Generator (https://openapi-generator.tech) diff --git a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_1.go b/samples/server/petstore/go-gin-api-server/go/model_inline_object_1.go similarity index 69% rename from samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_1.go rename to samples/server/petstore/go-gin-api-server/go/model_inline_object_1.go index aafa96f4352a..b0d0fb4cfc3e 100644 --- a/samples/openapi3/server/petstore/go-gin-api-server/go/model_inline_object_1.go +++ b/samples/server/petstore/go-gin-api-server/go/model_inline_object_1.go @@ -1,7 +1,7 @@ /* * OpenAPI Petstore * - * This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ + * This is a sample server Petstore server. For this sample, you can use the api key `special-key` to test the authorization filters. * * API version: 1.0.0 * Generated by: OpenAPI Generator (https://openapi-generator.tech)