diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index c3d4dac6dea..104e244a112 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -30,9 +30,7 @@ jobs: - samples/openapi3/server/petstore/springboot - samples/server/petstore/springboot-beanvalidation - samples/server/petstore/springboot-useoptional - - samples/openapi3/server/petstore/springboot-useoptional - samples/server/petstore/springboot-reactive - - samples/openapi3/server/petstore/springboot-reactive - samples/server/petstore/springboot-implicitHeaders - samples/openapi3/server/petstore/springboot-implicitHeaders - samples/server/petstore/springboot-delegate diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml deleted file mode 100644 index b1e5245ae85..00000000000 --- a/bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml +++ /dev/null @@ -1,13 +0,0 @@ -generatorName: spring -outputDir: samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable -library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - groupId: org.openapitools.openapi3 - documentationProvider: springdoc - java8: "false" - useBeanValidation: true - artifactId: spring-boot-beanvalidation-no-nullable - hideGenerationTimestamp: "true" - openApiNullable: "false" diff --git a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml index 1457469bc72..718b0a87e9d 100644 --- a/bin/configs/spring-boot-beanvalidation-no-nullable.yaml +++ b/bin/configs/spring-boot-beanvalidation-no-nullable.yaml @@ -1,9 +1,10 @@ generatorName: spring outputDir: samples/server/petstore/springboot-beanvalidation-no-nullable library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + groupId: org.openapitools.openapi3 documentationProvider: springfox java8: "false" useBeanValidation: true diff --git a/bin/configs/spring-boot-beanvalidation.yaml b/bin/configs/spring-boot-beanvalidation.yaml index 4a5daef5845..b43f22721a1 100644 --- a/bin/configs/spring-boot-beanvalidation.yaml +++ b/bin/configs/spring-boot-beanvalidation.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-beanvalidation library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-boot-defaultInterface-unhandledException.yaml b/bin/configs/spring-boot-defaultInterface-unhandledException.yaml index 3d492c12f76..9e096062883 100644 --- a/bin/configs/spring-boot-defaultInterface-unhandledException.yaml +++ b/bin/configs/spring-boot-defaultInterface-unhandledException.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/spring-boot-defaultInterface-unhandledException -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-boot-defaultInterface-unhandledException diff --git a/bin/configs/spring-boot-delegate-j8.yaml b/bin/configs/spring-boot-delegate-j8.yaml index e1fae5805cd..be11dd0dec0 100644 --- a/bin/configs/spring-boot-delegate-j8.yaml +++ b/bin/configs/spring-boot-delegate-j8.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot-delegate-j8 -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-boot-delegate-oas3.yaml b/bin/configs/spring-boot-delegate-oas3.yaml index 8b604d558a9..28ba653ad08 100644 --- a/bin/configs/spring-boot-delegate-oas3.yaml +++ b/bin/configs/spring-boot-delegate-oas3.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-delegate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-boot-delegate.yaml b/bin/configs/spring-boot-delegate.yaml index 228b14d823e..56199a182d1 100644 --- a/bin/configs/spring-boot-delegate.yaml +++ b/bin/configs/spring-boot-delegate.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot-delegate -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-boot-implicitHeaders-oas3.yaml b/bin/configs/spring-boot-implicitHeaders-oas3.yaml index 3d9423cd326..6d204b53c55 100644 --- a/bin/configs/spring-boot-implicitHeaders-oas3.yaml +++ b/bin/configs/spring-boot-implicitHeaders-oas3.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-boot-implicitHeaders.yaml b/bin/configs/spring-boot-implicitHeaders.yaml index d870353a0ff..b9a1a81c146 100644 --- a/bin/configs/spring-boot-implicitHeaders.yaml +++ b/bin/configs/spring-boot-implicitHeaders.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot-implicitHeaders -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: springboot-implicitHeaders diff --git a/bin/configs/spring-boot-reactive-oas3.yaml b/bin/configs/spring-boot-reactive-oas3.yaml deleted file mode 100644 index 3e3fb91657b..00000000000 --- a/bin/configs/spring-boot-reactive-oas3.yaml +++ /dev/null @@ -1,11 +0,0 @@ -generatorName: spring -outputDir: samples/openapi3/server/petstore/springboot-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - groupId: org.openapitools.openapi3 - documentationProvider: springdoc - artifactId: springboot-reactive - reactive: "true" - hideGenerationTimestamp: "true" - delegatePattern: "true" diff --git a/bin/configs/spring-boot-reactive.yaml b/bin/configs/spring-boot-reactive.yaml index b3edff7de11..ed5a1e56239 100644 --- a/bin/configs/spring-boot-reactive.yaml +++ b/bin/configs/spring-boot-reactive.yaml @@ -1,8 +1,9 @@ generatorName: spring outputDir: samples/server/petstore/springboot-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + groupId: org.openapitools.openapi3 artifactId: springboot-reactive documentationProvider: springfox reactive: "true" diff --git a/bin/configs/spring-boot-useoptional-oas3.yaml b/bin/configs/spring-boot-useoptional-oas3.yaml deleted file mode 100644 index ac66d1df148..00000000000 --- a/bin/configs/spring-boot-useoptional-oas3.yaml +++ /dev/null @@ -1,10 +0,0 @@ -generatorName: spring -outputDir: samples/openapi3/server/petstore/springboot-useoptional -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml -templateDir: modules/openapi-generator/src/main/resources/JavaSpring -additionalProperties: - groupId: org.openapitools.openapi3 - documentationProvider: springdoc - useOptional: true - artifactId: spring-boot-useoptional - hideGenerationTimestamp: "true" diff --git a/bin/configs/spring-boot-useoptional.yaml b/bin/configs/spring-boot-useoptional.yaml index 1e028977898..2b3dbdc1a86 100644 --- a/bin/configs/spring-boot-useoptional.yaml +++ b/bin/configs/spring-boot-useoptional.yaml @@ -1,8 +1,9 @@ generatorName: spring outputDir: samples/server/petstore/springboot-useoptional -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: + groupId: org.openapitools.openapi3 documentationProvider: springfox useOptional: true artifactId: spring-boot-useoptional diff --git a/bin/configs/spring-boot-virtualan.yaml b/bin/configs/spring-boot-virtualan.yaml index f1ae90fa859..87a2e30fb91 100644 --- a/bin/configs/spring-boot-virtualan.yaml +++ b/bin/configs/spring-boot-virtualan.yaml @@ -1,7 +1,7 @@ generatorName: spring outputDir: samples/server/petstore/springboot-virtualan library: spring-boot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springdoc diff --git a/bin/configs/spring-boot.yaml b/bin/configs/spring-boot.yaml index 8d3e101cead..3480d1ba174 100644 --- a/bin/configs/spring-boot.yaml +++ b/bin/configs/spring-boot.yaml @@ -1,6 +1,6 @@ generatorName: spring outputDir: samples/server/petstore/springboot -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: documentationProvider: springfox diff --git a/bin/configs/spring-cloud-oas3-fakeapi.yaml b/bin/configs/spring-cloud-oas3-fakeapi.yaml index 5d919d03f24..810aeff5997 100644 --- a/bin/configs/spring-cloud-oas3-fakeapi.yaml +++ b/bin/configs/spring-cloud-oas3-fakeapi.yaml @@ -1,7 +1,7 @@ generatorName: spring library: spring-cloud outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: groupId: org.openapitools.openapi3 diff --git a/bin/configs/spring-http-interface-reactive.yaml b/bin/configs/spring-http-interface-reactive.yaml index 749d6fbf08d..d3cbf25f547 100644 --- a/bin/configs/spring-http-interface-reactive.yaml +++ b/bin/configs/spring-http-interface-reactive.yaml @@ -1,7 +1,7 @@ generatorName: spring library: spring-http-interface outputDir: samples/client/petstore/spring-http-interface-reactive -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-http-interface-reactive diff --git a/bin/configs/spring-http-interface.yaml b/bin/configs/spring-http-interface.yaml index 9c92a629592..39cfec2307f 100644 --- a/bin/configs/spring-http-interface.yaml +++ b/bin/configs/spring-http-interface.yaml @@ -1,7 +1,7 @@ generatorName: spring library: spring-http-interface outputDir: samples/client/petstore/spring-http-interface -inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml +inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaSpring additionalProperties: artifactId: spring-http-interface diff --git a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache index 5d1e340e754..796178329b6 100644 --- a/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache +++ b/modules/openapi-generator/src/main/resources/JavaSpring/pojo.mustache @@ -59,10 +59,10 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#isContainer}} {{#useBeanValidation}}@Valid{{/useBeanValidation}} {{#openApiNullable}} - private {{>nullableDataType}} {{name}} = {{#isNullable}}JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#required}}{{{defaultValue}}}{{/required}}{{^required}}null{{/required}}{{/isNullable}}; + private {{>nullableDataType}} {{name}}{{#isNullable}} = JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isNullable}}; {{/openApiNullable}} {{^openApiNullable}} - private {{>nullableDataType}} {{name}} = {{#required}}{{{defaultValue}}}{{/required}}{{^required}}null{{/required}}; + private {{>nullableDataType}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}; {{/openApiNullable}} {{/isContainer}} {{^isContainer}} @@ -128,16 +128,14 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#openApiNullable}} - {{^required}} if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) { this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}}; } - {{/required}} this.{{name}}{{#isNullable}}.get(){{/isNullable}}.add({{name}}Item); {{/openApiNullable}} {{^openApiNullable}} if (this.{{name}} == null) { - this.{{name}} = {{{defaultValue}}}; + this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}; } this.{{name}}.add({{name}}Item); {{/openApiNullable}} @@ -147,11 +145,9 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}} {{#isMap}} public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) { - {{^required}} if (this.{{name}} == null) { this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}}; } - {{/required}} this.{{name}}.put(key, {{name}}Item); return this; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml similarity index 57% rename from samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml rename to modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml index 658d8a96b30..7f51877150e 100644 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml @@ -1,840 +1,675 @@ -openapi: 3.0.1 +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:\ - \ \" \\" + description: 'This spec is mainly for testing Petstore server and contains fake + endpoints, models. Please do not use this for any other purpose. Special + characters: " \' + version: 1.0.0 + title: OpenAPI Petstore license: name: Apache-2.0 url: https://www.apache.org/licenses/LICENSE-2.0.html - title: OpenAPI Petstore - version: 1.0.0 -servers: -- url: http://petstore.swagger.io:80/v2 tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user paths: /pet: post: + tags: + - pet + summary: Add a new pet to the store + description: "" operationId: addPet 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: {} description: successful operation "405": - content: {} description: Invalid input security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet + - petstore_auth: + - write:pets + - read:pets put: + tags: + - pet + summary: Update an existing pet + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet + - petstore_auth: + - write:pets + - read:pets /pet/findByStatus: get: + tags: + - pet + summary: Finds Pets by status description: Multiple status values can be provided with comma separated strings operationId: findPetsByStatus 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 + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available responses: "200": + description: successful operation content: application/xml: schema: - items: - $ref: '#/components/schemas/Pet' type: array + items: + $ref: "#/components/schemas/Pet" application/json: schema: - items: - $ref: '#/components/schemas/Pet' type: array - description: successful operation + items: + $ref: "#/components/schemas/Pet" "400": - content: {} description: Invalid status value security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet + - petstore_auth: + - write:pets + - read:pets /pet/findByTags: get: - deprecated: true - description: "Multiple tags can be provided with comma separated strings. Use\ - \ tag1, tag2, tag3 for testing." + tags: + - pet + summary: Finds Pets by tags + description: Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. operationId: findPetsByTags parameters: - - description: Tags to filter by - explode: false - in: query - name: tags - required: true - schema: - items: - type: string - type: array - uniqueItems: true - style: form + - name: tags + in: query + description: Tags to filter by + required: true + style: form + explode: false + schema: + type: array + items: + type: string + uniqueItems: true responses: "200": + description: successful operation content: application/xml: schema: - items: - $ref: '#/components/schemas/Pet' type: array uniqueItems: true + items: + $ref: "#/components/schemas/Pet" application/json: schema: - items: - $ref: '#/components/schemas/Pet' type: array uniqueItems: true - description: successful operation + items: + $ref: "#/components/schemas/Pet" "400": - content: {} description: Invalid tag value security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet + - petstore_auth: + - write:pets + - read:pets + deprecated: true + "/pet/{petId}": get: + tags: + - pet + summary: Find pet by ID description: Returns a single pet operationId: getPetById parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 responses: "200": + description: successful operation content: application/xml: schema: - $ref: '#/components/schemas/Pet' + $ref: "#/components/schemas/Pet" application/json: schema: - $ref: '#/components/schemas/Pet' - description: successful operation + $ref: "#/components/schemas/Pet" "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet + - api_key: [] post: + tags: + - pet + summary: Updates a pet in the store with form data + description: "" operationId: updatePetWithForm parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 requestBody: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/updatePetWithForm_request' + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string responses: "405": - content: {} description: Invalid input security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data + - petstore_auth: + - write:pets + - read:pets + delete: tags: - - pet - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: + - pet + summary: Deletes a pet + description: "" + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + "200": + description: successful operation + "400": + description: Invalid pet value + security: + - petstore_auth: + - write:pets + - read:pets + "/pet/{petId}/uploadImage": post: + tags: + - pet + summary: uploads an image + description: "" operationId: uploadFile parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 requestBody: content: multipart/form-data: schema: - $ref: '#/components/schemas/uploadFile_request' + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary responses: "200": + description: successful operation content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: "#/components/schemas/ApiResponse" security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet + - petstore_auth: + - write:pets + - read:pets /store/inventory: get: + tags: + - store + summary: Returns pet inventories by status description: Returns a map of status codes to quantities operationId: getInventory responses: "200": + description: successful operation content: application/json: schema: - additionalProperties: - format: int32 - type: integer type: object - description: successful operation + additionalProperties: + type: integer + format: int32 security: - - api_key: [] - summary: Returns pet inventories by status - tags: - - store - x-accepts: application/json - x-tags: - - tag: store + - api_key: [] /store/order: post: + tags: + - store + summary: Place an order for a pet + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/Order' + $ref: "#/components/schemas/Order" description: order placed for purchasing the pet required: true responses: "200": + description: successful operation content: application/xml: schema: - $ref: '#/components/schemas/Order' + $ref: "#/components/schemas/Order" application/json: schema: - $ref: '#/components/schemas/Order' - description: successful operation + $ref: "#/components/schemas/Order" "400": - content: {} description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: 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 - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store + "/store/order/{order_id}": get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generate exceptions + tags: + - store + summary: Find purchase order by ID + description: For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions operationId: getOrderById parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 responses: "200": + description: successful operation content: application/xml: schema: - $ref: '#/components/schemas/Order' + $ref: "#/components/schemas/Order" application/json: schema: - $ref: '#/components/schemas/Order' - description: successful operation + $ref: "#/components/schemas/Order" "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found - summary: Find purchase order by ID + delete: tags: - - store - x-accepts: application/json - x-tags: - - tag: store + - store + summary: Delete purchase order by ID + description: For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + "400": + description: Invalid ID supplied + "404": + description: Order not found /user: post: + tags: + - user + summary: Create user description: This can only be done by the logged in user. operationId: createUser requestBody: content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" description: Created user object required: true responses: default: - content: {} description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/createWithArray: post: + tags: + - user + summary: Creates list of users with given input array + description: "" 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 - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/createWithList: post: + tags: + - user + summary: Creates list of users with given input array + description: "" 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 - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user /user/login: get: + tags: + - user + summary: Logs user into the system + description: "" operationId: loginUser parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string responses: "200": - 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 schema: - format: int32 type: integer + format: int32 X-Expires-After: description: date in UTC when token expires schema: - format: date-time type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: 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 - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": + format: date-time content: application/xml: schema: - $ref: '#/components/schemas/User' + type: string application/json: schema: - $ref: '#/components/schemas/User' - description: successful operation + type: string + "400": + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: "" + operationId: logoutUser + responses: + default: + description: successful operation + "/user/{username}": + get: + tags: + - user + summary: Get user by user name + description: "" + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + "200": + description: successful operation + content: + application/xml: + schema: + $ref: "#/components/schemas/User" + application/json: + schema: + $ref: "#/components/schemas/User" "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found - summary: Get user by user name - tags: - - user - x-accepts: application/json - x-tags: - - tag: user put: + tags: + - user + summary: Updated user description: This can only be done by the logged in user. operationId: updateUser parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string requestBody: content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" description: Updated user object required: true responses: "400": - content: {} description: Invalid user supplied "404": - content: {} description: User not found - summary: Updated user + delete: tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + "400": + description: Invalid username supplied + "404": + description: User not found /fake_classname_test: patch: + tags: + - fake_classname_tags 123#$%^ + summary: To test class name in snake case description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: "#/components/requestBodies/Client" responses: "200": + description: successful operation content: application/json: schema: - $ref: '#/components/schemas/Client' - description: successful operation + $ref: "#/components/schemas/Client" security: - - api_key_query: [] - summary: To test class name in snake case - tags: - - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ + - api_key_query: [] /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Something wrong - summary: Fake endpoint to test group parameters (optional) + patch: tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + requestBody: + $ref: "#/components/requestBodies/Client" + responses: + "200": + description: successful operation + content: + application/json: + schema: + $ref: "#/components/schemas/Client" get: + tags: + - fake + summary: To test enum parameters description: To test enum parameters operationId: testEnumParameters parameters: - - description: Header parameter enum test (string array) - explode: false - in: header - name: enum_header_string_array - schema: - items: - default: $ - enum: - - '>' - - $ + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ enum: - - '>' - - $ + - _abc + - -efg + - (xyz) + default: -efg + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number + enum: + - _abc + - -efg + - (xyz) + default: -efg + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 requestBody: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/testEnumParameters_request' + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - ">" + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - -efg + - (xyz) + default: -efg responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found - summary: To test enum parameters - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake post: + tags: + - fake + summary: |- + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 description: |- Fake endpoint for testing various parameters 假端點 @@ -845,441 +680,514 @@ paths: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/testEndpointParameters_request' - required: true + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: /[a-z]/i + pattern_without_delimiter: + description: None + type: string + pattern: ^[A-Z].* + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + - http_basic_test: [] + delete: tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake + - fake + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + "400": + description: Something wrong /fake/outer/number: post: + tags: + - fake description: Test serialization of outer number types operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/OuterNumber' + $ref: "#/components/schemas/OuterNumber" description: Input number as post body - required: false responses: "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterNumber" /fake/outer/string: post: + tags: + - fake description: Test serialization of outer string types operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/OuterString' + $ref: "#/components/schemas/OuterString" description: Input string as post body - required: false responses: "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterString" /fake/outer/boolean: post: + tags: + - fake description: Test serialization of outer boolean types operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/OuterBoolean' + $ref: "#/components/schemas/OuterBoolean" description: Input boolean as post body - required: false responses: "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterBoolean" /fake/outer/composite: post: + tags: + - fake description: Test serialization of object with outer number type operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: - $ref: '#/components/schemas/OuterComposite' + $ref: "#/components/schemas/OuterComposite" description: Input composite as post body - required: false responses: "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake + content: + "*/*": + schema: + $ref: "#/components/schemas/OuterComposite" /fake/jsonFormData: get: + tags: + - fake + summary: test json serialization of form data + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: - $ref: '#/components/schemas/testJsonFormData_request' - required: true + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 responses: "200": - content: {} description: successful operation - summary: test json serialization of form data - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake /fake/inline-additionalProperties: post: + tags: + - fake + summary: test inline additionalProperties + description: "" operationId: testInlineAdditionalProperties requestBody: content: application/json: schema: + type: object additionalProperties: type: string - type: object description: request body required: true responses: "200": - content: {} description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/body-with-query-params: put: + tags: + - fake operationId: testBodyWithQueryParams parameters: - - in: query - name: query - required: true - schema: - type: string + - name: query + in: query + required: true + schema: + type: string requestBody: content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: "#/components/schemas/User" required: true responses: "200": - content: {} description: Success - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/create_xml_item: post: - description: this route creates an XmlItem + tags: + - fake operationId: createXmlItem + summary: creates an XmlItem + description: this route creates an XmlItem requestBody: content: application/xml: schema: - $ref: '#/components/schemas/XmlItem' + $ref: "#/components/schemas/XmlItem" application/xml; charset=utf-8: schema: - $ref: '#/components/schemas/XmlItem' + $ref: "#/components/schemas/XmlItem" application/xml; charset=utf-16: schema: - $ref: '#/components/schemas/XmlItem' + $ref: "#/components/schemas/XmlItem" text/xml: schema: - $ref: '#/components/schemas/XmlItem' + $ref: "#/components/schemas/XmlItem" text/xml; charset=utf-8: schema: - $ref: '#/components/schemas/XmlItem' + $ref: "#/components/schemas/XmlItem" text/xml; charset=utf-16: schema: - $ref: '#/components/schemas/XmlItem' + $ref: "#/components/schemas/XmlItem" description: XmlItem Body required: true responses: "200": - content: {} description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-content-type: application/xml - x-accepts: application/json - x-tags: - - tag: fake /another-fake/dummy: patch: + tags: + - $another-fake? + summary: To test special tags description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: "#/components/requestBodies/Client" responses: "200": + description: successful operation content: application/json: schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: $another-fake? + $ref: "#/components/schemas/Client" /fake/body-with-file-schema: put: - description: "For this test, the body for this request much reference a schema\ - \ named `File`." + tags: + - fake + 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' + $ref: "#/components/schemas/FileSchemaTestClass" required: true responses: "200": - content: {} description: Success - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake /fake/test-query-parameters: put: + tags: + - fake description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - 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 + - name: pipe + in: query + required: true + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string responses: "200": - content: {} description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: + "/fake/{petId}/uploadImageWithRequiredFile": post: + tags: + - pet + summary: uploads an image (required) + description: "" operationId: uploadFileWithRequiredFile parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 requestBody: content: multipart/form-data: schema: - $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile responses: "200": + description: successful operation content: application/json: schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation + $ref: "#/components/schemas/ApiResponse" security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image (required) - tags: - - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet + - petstore_auth: + - write:pets + - read:pets +servers: + - url: http://petstore.swagger.io:80/v2 components: + requestBodies: + UserArray: + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/User" + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: "#/components/schemas/Client" + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: "#/components/schemas/Pet" + application/xml: + schema: + $ref: "#/components/schemas/Pet" + description: Pet object that needs to be added to the store + required: true + securitySchemes: + petstore_auth: + type: oauth2 + flows: + implicit: + authorizationUrl: http://petstore.swagger.io/api/oauth/dialog + scopes: + write:pets: modify pets in your account + read:pets: read your pets + api_key: + type: apiKey + name: api_key + in: header + api_key_query: + type: apiKey + name: api_key_query + in: query + http_basic_test: + type: http + scheme: basic schemas: Order: - example: - petId: 6 - quantity: 1 - id: 0 - shipDate: 2000-01-23T04:56:07.000+00:00 - complete: false - status: placed + type: object properties: id: - format: int64 type: integer + format: int64 petId: + type: integer format: int64 - type: integer quantity: - format: int32 type: integer + format: int32 shipDate: - format: date-time type: string + format: date-time status: + type: string description: Order Status enum: - - placed - - approved - - delivered - type: string + - placed + - approved + - delivered complete: - default: false type: boolean - type: object + default: false xml: name: Order Category: - example: - name: default-name - id: 6 + type: object + required: + - name properties: id: - format: int64 type: integer + format: int64 name: - default: default-name type: string - required: - - name - type: object + default: default-name xml: name: Category User: - example: - firstName: firstName - lastName: lastName - password: password - userStatus: 6 - phone: phone - id: 0 - email: email - username: username + type: object properties: id: - format: int64 type: integer + format: int64 x-is-unique: true username: type: string @@ -1294,139 +1202,106 @@ components: phone: type: string userStatus: - description: User Status - format: int32 type: integer - type: object + format: int32 + description: User Status xml: name: User Tag: - example: - name: name - id: 1 + type: object properties: id: - format: int64 type: integer + format: int64 name: type: string - type: object xml: name: Tag Pet: - example: - photoUrls: + type: object + required: + - name - 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 + format: int64 x-is-unique: true category: - $ref: '#/components/schemas/Category' + $ref: "#/components/schemas/Category" name: - example: doggie type: string + example: doggie photoUrls: - items: - type: string type: array uniqueItems: true xml: name: photoUrl wrapped: true - tags: items: - $ref: '#/components/schemas/Tag' + type: string + tags: type: array xml: name: tag wrapped: true + items: + $ref: "#/components/schemas/Tag" status: - description: pet status in the store - enum: - - available - - pending - - sold type: string - required: - - name - - photoUrls - type: object + description: pet status in the store + deprecated: true + enum: + - available + - pending + - sold xml: name: Pet ApiResponse: - example: - code: 0 - type: type - message: message + type: object properties: code: - format: int32 type: integer + format: int32 type: type: string message: type: string - type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: - format: int32 type: integer - type: object + format: int32 xml: name: Return Name: description: Model for testing model name same as property name + required: + - name properties: name: - format: int32 type: integer - snake_case: format: int32 + snake_case: readOnly: true type: integer + format: int32 property: type: string - "123Number": - readOnly: true + 123Number: type: integer - required: - - name - type: object + readOnly: true xml: name: Name - "200_response": + 200_response: description: Model for testing model name starting with number properties: name: - format: int32 type: integer + format: int32 class: type: string - type: object xml: name: Name ClassModel: @@ -1434,287 +1309,291 @@ components: properties: _class: type: string - type: object Dog: allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' + - $ref: "#/components/schemas/Animal" + - type: object + properties: + breed: + type: string Cat: allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' + - $ref: "#/components/schemas/Animal" + - type: object + properties: + declawed: + type: boolean BigCat: allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_allOf' + - $ref: "#/components/schemas/Cat" + - type: object + properties: + kind: + type: string + enum: + - lions + - tigers + - leopards + - jaguars Animal: + type: object discriminator: propertyName: className + required: + - className properties: className: type: string color: - default: red type: string - required: - - className - type: object + default: red AnimalFarm: - items: - $ref: '#/components/schemas/Animal' type: array + items: + $ref: "#/components/schemas/Animal" format_test: + type: object + required: + - number + - byte + - date + - password properties: integer: + type: integer maximum: 100 minimum: 10 - type: integer int32: + type: integer format: int32 maximum: 200 minimum: 20 - type: integer int64: - format: int64 type: integer + format: int64 number: maximum: 543.2 minimum: 32.1 type: number float: + type: number format: float maximum: 987.6 minimum: 54.3 - type: number double: + type: number format: double maximum: 123.4 minimum: 67.8 - type: number string: - pattern: "/[a-z]/i" type: string + pattern: /[a-z]/i byte: + type: string format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - type: string binary: + type: string format: binary - type: string date: + type: string format: date - type: string dateTime: + type: string format: date-time - type: string uuid: - example: 72f98069-206d-4f12-9f12-3d1e525a8e84 - format: uuid type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 password: + type: string format: password maxLength: 64 minLength: 10 - type: string BigDecimal: - format: number type: string - required: - - byte - - date - - number - - password - type: object + format: number EnumClass: + type: string default: -efg enum: - - _abc - - -efg - - (xyz) - type: string + - _abc + - -efg + - (xyz) Enum_Test: + type: object + required: + - enum_string_required properties: enum_string: - enum: - - UPPER - - lower - - "" type: string + enum: + - UPPER + - lower + - "" enum_string_required: - enum: - - UPPER - - lower - - "" type: string + enum: + - UPPER + - lower + - "" enum_integer: - enum: - - 1 - - -1 - format: int32 type: integer - enum_number: + format: int32 enum: - - 1.1 - - -1.2 - format: double + - 1 + - -1 + enum_number: type: number + format: double + enum: + - 1.1 + - -1.2 outerEnum: - $ref: '#/components/schemas/OuterEnum' - required: - - enum_string_required - type: object + $ref: "#/components/schemas/OuterEnum" AdditionalPropertiesClass: + type: object properties: map_string: + type: object additionalProperties: type: string - type: object map_number: + type: object additionalProperties: type: number - type: object map_integer: + type: object additionalProperties: type: integer - type: object map_boolean: + type: object additionalProperties: type: boolean - type: object map_array_integer: + type: object additionalProperties: + type: array items: type: integer - type: array - type: object map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array type: object - map_map_string: additionalProperties: + type: array + items: + type: object + map_map_string: + type: object + additionalProperties: + type: object additionalProperties: type: string - type: object - type: object map_map_anytype: + type: object additionalProperties: - additionalProperties: - properties: {} - type: object type: object - type: object + additionalProperties: + type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: - properties: {} type: object - type: object + properties: {} AdditionalPropertiesString: + type: object + properties: + name: + type: string additionalProperties: type: string + AdditionalPropertiesInteger: + type: object properties: name: type: string - type: object - AdditionalPropertiesInteger: additionalProperties: type: integer + AdditionalPropertiesNumber: + type: object properties: name: type: string - type: object - AdditionalPropertiesNumber: additionalProperties: type: number + AdditionalPropertiesBoolean: + type: object properties: name: type: string - type: object - AdditionalPropertiesBoolean: additionalProperties: type: boolean - properties: - name: - type: string - type: object AdditionalPropertiesArray: + type: object + properties: + name: + type: string additionalProperties: - items: - properties: {} - type: object type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} + items: type: object - type: object + AdditionalPropertiesObject: + type: object properties: name: type: string - type: object - AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object + additionalProperties: + type: object + AdditionalPropertiesAnyType: + type: object properties: name: type: string - type: object + additionalProperties: + type: object MixedPropertiesAndAdditionalPropertiesClass: + type: object properties: uuid: + type: string format: uuid - type: string dateTime: + type: string format: date-time - type: string map: - additionalProperties: - $ref: '#/components/schemas/Animal' type: object - type: object + additionalProperties: + $ref: "#/components/schemas/Animal" List: - properties: - "123-list": - type: string type: object + properties: + 123-list: + type: string Client: - example: - client: client + type: object properties: client: type: string - type: object ReadOnlyFirst: + type: object properties: bar: - readOnly: true type: string + readOnly: true baz: type: string - type: object hasOnlyReadOnly: + type: object properties: bar: - readOnly: true type: string + readOnly: true foo: - readOnly: true type: string - type: object + readOnly: true Capitalization: + type: object properties: smallCamel: type: string @@ -1730,107 +1609,99 @@ components: description: | Name of the pet type: string - type: object MapTest: + type: object properties: map_map_of_string: + type: object additionalProperties: + type: object additionalProperties: type: string - type: object - type: object map_of_enum_string: + type: object additionalProperties: - enum: - - UPPER - - lower type: string - type: object + enum: + - UPPER + - lower direct_map: + type: object additionalProperties: type: boolean - type: object indirect_map: - additionalProperties: - type: boolean - type: object - type: object + $ref: "#/components/schemas/StringBooleanMap" ArrayTest: + type: object properties: array_of_string: + type: array items: type: string - type: array array_array_of_integer: + type: array items: + type: array items: - format: int64 type: integer - type: array - type: array + format: int64 array_array_of_model: - items: - items: - $ref: '#/components/schemas/ReadOnlyFirst' - type: array type: array - type: object + items: + type: array + items: + $ref: "#/components/schemas/ReadOnlyFirst" NumberOnly: + type: object properties: JustNumber: type: number - type: object ArrayOfNumberOnly: + type: object properties: ArrayNumber: + type: array items: type: number - type: array - type: object ArrayOfArrayOfNumberOnly: + type: object properties: ArrayArrayNumber: + type: array items: + type: array items: type: number - type: array - type: array - type: object EnumArrays: + type: object properties: just_symbol: - enum: - - '>=' - - $ type: string + enum: + - ">=" + - $ array_enum: - items: - enum: - - fish - - crab - type: string type: array - type: object + items: + type: string + enum: + - fish + - crab OuterEnum: - enum: - - placed - - approved - - delivered type: string + enum: + - placed + - approved + - delivered OuterComposite: - example: - my_string: my_string - my_number: 0.8008281904610115 - my_boolean: true + type: object properties: my_number: - type: number + $ref: "#/components/schemas/OuterNumber" my_string: - type: string + $ref: "#/components/schemas/OuterString" my_boolean: - type: boolean - x-codegen-body-parameter-name: boolean_post_body - type: object + $ref: "#/components/schemas/OuterBoolean" OuterNumber: type: number OuterString: @@ -1841,445 +1712,297 @@ components: StringBooleanMap: additionalProperties: type: boolean - type: object FileSchemaTestClass: - example: - file: - sourceURI: sourceURI - files: - - sourceURI: sourceURI - - sourceURI: sourceURI + type: object properties: file: - $ref: '#/components/schemas/File' + $ref: "#/components/schemas/File" files: - items: - $ref: '#/components/schemas/File' type: array - type: object + items: + $ref: "#/components/schemas/File" File: + type: object description: Must be named `File` for test. - example: - sourceURI: sourceURI properties: sourceURI: description: Test capitalization type: string - type: object TypeHolderDefault: + type: object + required: + - string_item + - number_item + - integer_item + - bool_item + - array_item properties: string_item: - default: what type: string + default: what number_item: type: number + default: 1.234 integer_item: type: integer + default: -2 bool_item: - default: true type: boolean + default: true array_item: + type: array items: type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object + default: + - 0 + - 1 + - 2 + - 3 TypeHolderExample: + type: object + required: + - string_item + - number_item + - float_item + - integer_item + - bool_item + - array_item properties: string_item: - example: what type: string + example: what number_item: - example: 1.234 type: number + example: 1.234 float_item: + type: number example: 1.234 format: float - type: number integer_item: - example: -2 type: integer + example: -2 bool_item: - example: true type: boolean + example: true array_item: - example: - - 0 - - 1 - - 2 - - 3 + type: array items: type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object + example: + - 0 + - 1 + - 2 + - 3 XmlItem: + type: object + xml: + namespace: http://a.com/schema + prefix: pre properties: attribute_string: - example: string type: string + example: string xml: attribute: true attribute_number: - example: 1.234 type: number + example: 1.234 xml: attribute: true attribute_integer: - example: -2 type: integer + example: -2 xml: attribute: true attribute_boolean: - example: true type: boolean + example: true xml: attribute: true wrapped_array: - items: - type: integer type: array xml: wrapped: true + items: + type: integer name_string: - example: string type: string + example: string xml: name: xml_name_string name_number: - example: 1.234 type: number + example: 1.234 xml: name: xml_name_number name_integer: - example: -2 type: integer + example: -2 xml: name: xml_name_integer name_boolean: - example: true type: boolean + example: true xml: name: xml_name_boolean name_array: + type: array items: type: integer xml: name: xml_name_array_item - type: array name_wrapped_array: + type: array + xml: + wrapped: true + name: xml_name_wrapped_array items: type: integer xml: name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true prefix_string: - example: string type: string + example: string xml: prefix: ab prefix_number: - example: 1.234 type: number + example: 1.234 xml: prefix: cd prefix_integer: - example: -2 type: integer + example: -2 xml: prefix: ef prefix_boolean: - example: true type: boolean + example: true xml: prefix: gh prefix_array: + type: array items: type: integer xml: prefix: ij - type: array prefix_wrapped_array: + type: array + xml: + wrapped: true + prefix: kl items: type: integer xml: prefix: mn - type: array - xml: - prefix: kl - wrapped: true namespace_string: - example: string type: string + example: string xml: namespace: http://a.com/schema namespace_number: - example: 1.234 type: number + example: 1.234 xml: namespace: http://b.com/schema namespace_integer: - example: -2 type: integer + example: -2 xml: namespace: http://c.com/schema namespace_boolean: - example: true type: boolean + example: true xml: namespace: http://d.com/schema namespace_array: + type: array items: type: integer xml: namespace: http://e.com/schema - type: array namespace_wrapped_array: + type: array + xml: + wrapped: true + namespace: http://f.com/schema items: type: integer xml: namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true prefix_ns_string: - example: string type: string + example: string xml: namespace: http://a.com/schema prefix: a prefix_ns_number: - example: 1.234 type: number + example: 1.234 xml: namespace: http://b.com/schema prefix: b prefix_ns_integer: - example: -2 type: integer + example: -2 xml: namespace: http://c.com/schema prefix: c prefix_ns_boolean: - example: true type: boolean + example: true xml: namespace: http://d.com/schema prefix: d prefix_ns_array: + type: array items: type: integer xml: namespace: http://e.com/schema prefix: e - type: array prefix_ns_wrapped_array: + type: array + xml: + wrapped: true + namespace: http://f.com/schema + prefix: f items: type: integer xml: namespace: http://g.com/schema prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - updatePetWithForm_request: + _special_model.name_: properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - uploadFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - testEnumParameters_request: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - testEndpointParameters_request: - properties: - integer: - description: None - format: int32 - maximum: 100 - minimum: 10 + "$special[property.name]": 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 + xml: + name: $special[model.name] + ContainerDefaultValue: + type: object required: - - byte - - double - - number - - pattern_without_delimiter - type: object - testJsonFormData_request: + - required_array + - nullable_required_array properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - uploadFileWithRequiredFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - type: object - example: null - Cat_allOf: - properties: - declawed: - type: boolean - type: object - example: null - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null - 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 -x-original-swagger-version: "2.0" + nullable_array: + type: array + nullable: true + items: + type: string + nullable_required_array: + type: array + nullable: true + items: + type: string + required_array: + type: array + nullable: false + items: + type: string + nullable_array_with_default: + type: array + nullable: true + items: + type: string + default: ["foo", "bar"] diff --git a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..1f114e8f347 100644 --- a/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..1f114e8f347 100644 --- a/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-feign-without-url/src/main/java/org/openapitools/model/Pet.java @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..1f114e8f347 100644 --- a/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..1f114e8f347 100644 --- a/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES b/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES index 1249969fa6d..8f0d232df2e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES +++ b/samples/client/petstore/spring-http-interface-reactive/.openapi-generator/FILES @@ -27,6 +27,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index eb4acdaeeb3..468c8d88bff 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -28,7 +28,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -38,7 +38,7 @@ public interface AnotherFakeApi { contentType = "application/json" ) Mono> call123testSpecialTags( - @RequestBody Mono body + @RequestBody Mono client ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java index 36f82654d0a..4589c980658 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -62,7 +62,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/boolean", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterBooleanSerialize( @RequestBody(required = false) Mono body @@ -73,17 +73,17 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @HttpExchange( method = "POST", value = "/fake/outer/composite", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterCompositeSerialize( - @RequestBody(required = false) Mono body + @RequestBody(required = false) Mono outerComposite ); @@ -98,7 +98,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/number", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterNumberSerialize( @RequestBody(required = false) Mono body @@ -116,7 +116,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/string", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) Mono> fakeOuterStringSerialize( @RequestBody(required = false) Mono body @@ -127,7 +127,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @HttpExchange( @@ -137,7 +137,7 @@ public interface FakeApi { contentType = "application/json" ) Mono> testBodyWithFileSchema( - @RequestBody Mono body + @RequestBody Mono fileSchemaTestClass ); @@ -145,7 +145,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @HttpExchange( @@ -156,7 +156,7 @@ public interface FakeApi { ) Mono> testBodyWithQueryParams( @RequestParam(value = "query", required = true) String query, - @RequestBody Mono body + @RequestBody Mono user ); @@ -164,7 +164,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -174,7 +174,7 @@ public interface FakeApi { contentType = "application/json" ) Mono> testClientModel( - @RequestBody Mono body + @RequestBody Mono client ); @@ -285,8 +285,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -296,12 +297,13 @@ public interface FakeApi { contentType = "application/json" ) Mono> testInlineAdditionalProperties( - @RequestBody Mono> param + @RequestBody Mono> requestBody ); /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -324,7 +326,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -337,7 +338,6 @@ public interface FakeApi { ) Mono> testQueryParameterCollectionFormat( @RequestParam(value = "pipe", required = true) List pipe, - @RequestParam(value = "ioutil", required = true) List ioutil, @RequestParam(value = "http", required = true) List http, @RequestParam(value = "url", required = true) List url, @RequestParam(value = "context", required = true) List context diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 4823b25802c..eba62384f1f 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -28,7 +28,7 @@ public interface FakeClassnameTags123Api { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -38,7 +38,7 @@ public interface FakeClassnameTags123Api { contentType = "application/json" ) Mono> testClassname( - @RequestBody Mono body + @RequestBody Mono client ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java index 48294145ebe..9e4acf4039d 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -28,8 +28,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -40,12 +41,13 @@ public interface PetApi { contentType = "application/json" ) Mono> addPet( - @RequestBody Mono body + @RequestBody Mono pet ); /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -122,8 +124,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -136,12 +139,13 @@ public interface PetApi { contentType = "application/json" ) Mono> updatePet( - @RequestBody Mono body + @RequestBody Mono pet ); /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -163,6 +167,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -184,6 +189,7 @@ public interface PetApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java index bce45b2badd..7c390c674f6 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -80,8 +80,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -89,10 +90,10 @@ public interface StoreApi { method = "POST", value = "/store/order", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> placeOrder( - @RequestBody Mono body + @RequestBody Mono order ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java index 79dda760d32..d895641b2e6 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -30,51 +30,53 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> createUser( - @RequestBody Mono body + @RequestBody Mono user ); /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithArray", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> createUsersWithArrayInput( - @RequestBody Flux body + @RequestBody Flux user ); /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithList", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> createUsersWithListInput( - @RequestBody Flux body + @RequestBody Flux user ); @@ -98,6 +100,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -116,6 +119,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -135,6 +139,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -153,7 +158,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -161,11 +166,11 @@ public interface UserApi { method = "PUT", value = "/user/{username}", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) Mono> updateUser( @PathVariable("username") String username, - @RequestBody Mono body + @RequestBody Mono user ); } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 169b7406f56..446381cac9d 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -25,41 +28,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -291,7 +294,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -300,11 +303,11 @@ public class AdditionalPropertiesClass { * @return anytype2 */ - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -344,13 +347,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index b37936c2134..c5b2fefbaf6 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -24,7 +24,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index eb820544e7d..36367225a25 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -24,7 +24,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 8caa5447995..7d80d25c0ae 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -24,15 +24,15 @@ public class ArrayTest { @JsonProperty("array_of_string") - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..22b58754add --- /dev/null +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,218 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java index 8440fe77122..76034eff1ac 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -97,7 +97,7 @@ public class EnumArrays { @JsonProperty("array_enum") - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index b0d309b5765..b830e931ec5 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -27,7 +27,7 @@ public class FileSchemaTestClass { @JsonProperty("files") - private List files = null; + private List files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java index f9c40fdd60e..1b90373038e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -24,7 +24,7 @@ public class MapTest { @JsonProperty("map_map_of_string") - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -63,15 +63,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 1affd5d8362..efa8052677e 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -34,7 +34,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java index 417eda278e2..c1a92c2d5e9 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") - private List tags = null; + private List tags = new ArrayList<>(); /** * pet status in the store @@ -161,6 +161,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index 90be05037e4..d99aa571dcc 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -17,7 +17,7 @@ import jakarta.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -50,8 +50,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index 8701e55eaa3..799aa25fccd 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -26,17 +26,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -136,6 +136,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 7b3eb0aec7f..ef2f61f81be 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -158,6 +158,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java index e93ad13b463..0a516da0c77 100644 --- a/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/client/petstore/spring-http-interface-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -36,7 +36,7 @@ public class XmlItem { @JsonProperty("wrapped_array") - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -52,11 +52,11 @@ public class XmlItem { @JsonProperty("name_array") - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -72,11 +72,11 @@ public class XmlItem { @JsonProperty("prefix_array") - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -92,11 +92,11 @@ public class XmlItem { @JsonProperty("namespace_array") - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -112,11 +112,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/client/petstore/spring-http-interface/.openapi-generator/FILES b/samples/client/petstore/spring-http-interface/.openapi-generator/FILES index 9c06c7689f4..057a6b03c61 100644 --- a/samples/client/petstore/spring-http-interface/.openapi-generator/FILES +++ b/samples/client/petstore/spring-http-interface/.openapi-generator/FILES @@ -28,6 +28,7 @@ src/main/java/org/openapitools/model/CatDto.java src/main/java/org/openapitools/model/CategoryDto.java src/main/java/org/openapitools/model/ClassModelDto.java src/main/java/org/openapitools/model/ClientDto.java +src/main/java/org/openapitools/model/ContainerDefaultValueDto.java src/main/java/org/openapitools/model/DogAllOfDto.java src/main/java/org/openapitools/model/DogDto.java src/main/java/org/openapitools/model/EnumArraysDto.java diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java index e665db6842b..89b413cf6df 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -24,7 +24,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -34,7 +34,7 @@ public interface AnotherFakeApi { contentType = "application/json" ) ResponseEntity call123testSpecialTags( - @RequestBody ClientDto body + @RequestBody ClientDto clientDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java index 15e5bfa51f6..a6e1f4d89ab 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeApi.java @@ -33,7 +33,7 @@ public interface FakeApi { * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem * - * @param xmlItem XmlItem Body (required) + * @param xmlItemDto XmlItem Body (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -43,7 +43,7 @@ public interface FakeApi { contentType = "application/xml" ) ResponseEntity createXmlItem( - @RequestBody XmlItemDto xmlItem + @RequestBody XmlItemDto xmlItemDto ); @@ -58,7 +58,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/boolean", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterBooleanSerialize( @RequestBody(required = false) Boolean body @@ -69,17 +69,17 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerCompositeDto Input composite as post body (optional) * @return Output composite (status code 200) */ @HttpExchange( method = "POST", value = "/fake/outer/composite", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterCompositeSerialize( - @RequestBody(required = false) OuterCompositeDto body + @RequestBody(required = false) OuterCompositeDto outerCompositeDto ); @@ -94,7 +94,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/number", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterNumberSerialize( @RequestBody(required = false) BigDecimal body @@ -112,7 +112,7 @@ public interface FakeApi { method = "POST", value = "/fake/outer/string", accept = "*/*", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity fakeOuterStringSerialize( @RequestBody(required = false) String body @@ -123,7 +123,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClassDto (required) * @return Success (status code 200) */ @HttpExchange( @@ -133,7 +133,7 @@ public interface FakeApi { contentType = "application/json" ) ResponseEntity testBodyWithFileSchema( - @RequestBody FileSchemaTestClassDto body + @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto ); @@ -141,7 +141,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param userDto (required) * @return Success (status code 200) */ @HttpExchange( @@ -152,7 +152,7 @@ public interface FakeApi { ) ResponseEntity testBodyWithQueryParams( @RequestParam(value = "query", required = true) String query, - @RequestBody UserDto body + @RequestBody UserDto userDto ); @@ -160,7 +160,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -170,7 +170,7 @@ public interface FakeApi { contentType = "application/json" ) ResponseEntity testClientModel( - @RequestBody ClientDto body + @RequestBody ClientDto clientDto ); @@ -281,8 +281,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -292,12 +293,13 @@ public interface FakeApi { contentType = "application/json" ) ResponseEntity testInlineAdditionalProperties( - @RequestBody Map param + @RequestBody Map requestBody ); /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -320,7 +322,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -333,7 +334,6 @@ public interface FakeApi { ) ResponseEntity testQueryParameterCollectionFormat( @RequestParam(value = "pipe", required = true) List pipe, - @RequestParam(value = "ioutil", required = true) List ioutil, @RequestParam(value = "http", required = true) List http, @RequestParam(value = "url", required = true) List url, @RequestParam(value = "context", required = true) List context diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index 5238a57c11a..9c7b1c807b6 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -24,7 +24,7 @@ public interface FakeClassnameTags123Api { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @HttpExchange( @@ -34,7 +34,7 @@ public interface FakeClassnameTags123Api { contentType = "application/json" ) ResponseEntity testClassname( - @RequestBody ClientDto body + @RequestBody ClientDto clientDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java index eb00021ccd6..4cdaa75682a 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/PetApi.java @@ -24,8 +24,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -36,12 +37,13 @@ public interface PetApi { contentType = "application/json" ) ResponseEntity addPet( - @RequestBody PetDto body + @RequestBody PetDto petDto ); /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -118,8 +120,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -132,12 +135,13 @@ public interface PetApi { contentType = "application/json" ) ResponseEntity updatePet( - @RequestBody PetDto body + @RequestBody PetDto petDto ); /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -159,6 +163,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -180,6 +185,7 @@ public interface PetApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java index cadcceedb8a..c68eda93b70 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/StoreApi.java @@ -76,8 +76,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param orderDto order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -85,10 +86,10 @@ public interface StoreApi { method = "POST", value = "/store/order", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity placeOrder( - @RequestBody OrderDto body + @RequestBody OrderDto orderDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java index 423d95850d7..8e230a58c04 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/api/UserApi.java @@ -26,51 +26,53 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param userDto Created user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity createUser( - @RequestBody UserDto body + @RequestBody UserDto userDto ); /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithArray", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity createUsersWithArrayInput( - @RequestBody List body + @RequestBody List userDto ); /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @HttpExchange( method = "POST", value = "/user/createWithList", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity createUsersWithListInput( - @RequestBody List body + @RequestBody List userDto ); @@ -94,6 +96,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -112,6 +115,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -131,6 +135,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -149,7 +154,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param userDto Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -157,11 +162,11 @@ public interface UserApi { method = "PUT", value = "/user/{username}", accept = "application/json", - contentType = "*/*" + contentType = "application/json" ) ResponseEntity updateUser( @PathVariable("username") String username, - @RequestBody UserDto body + @RequestBody UserDto userDto ); } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 6dc80fc64c5..e2aa343d20f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -6,10 +6,13 @@ import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonTypeName; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import jakarta.validation.constraints.NotNull; @@ -27,41 +30,41 @@ public class AdditionalPropertiesClassDto { @JsonProperty("map_string") - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -293,7 +296,7 @@ public class AdditionalPropertiesClassDto { } public AdditionalPropertiesClassDto anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -302,11 +305,11 @@ public class AdditionalPropertiesClassDto { * @return anytype2 */ - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -346,13 +349,24 @@ public class AdditionalPropertiesClassDto { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 0e954981dc9..3ae3538469a 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnlyDto { @JsonProperty("ArrayArrayNumber") - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 26e8636a6a7..b9ac23c6661 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -26,7 +26,7 @@ public class ArrayOfNumberOnlyDto { @JsonProperty("ArrayNumber") - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java index ab8e5b17537..cbf7877faf1 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -26,15 +26,15 @@ public class ArrayTestDto { @JsonProperty("array_of_string") - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTestDto arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java new file mode 100644 index 00000000000..9d13d762de9 --- /dev/null +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -0,0 +1,203 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import jakarta.validation.constraints.NotNull; + + +import java.util.*; +import jakarta.annotation.Generated; + +/** + * ContainerDefaultValueDto + */ + +@JsonTypeName("ContainerDefaultValue") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValueDto { + + @JsonProperty("nullable_array") + + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + public ContainerDefaultValueDto nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValueDto nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValueDto requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValueDto addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValueDto nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValueDto {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java index b01e1a1b904..123810c921e 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -99,7 +99,7 @@ public class EnumArraysDto { @JsonProperty("array_enum") - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index 916fb159a1c..a7fb42c1980 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -29,7 +29,7 @@ public class FileSchemaTestClassDto { @JsonProperty("files") - private List files = null; + private List files = new ArrayList<>(); public FileSchemaTestClassDto file(FileDto file) { this.file = file; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java index ea2eed82d1d..82a99c07ad9 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MapTestDto.java @@ -26,7 +26,7 @@ public class MapTestDto { @JsonProperty("map_map_of_string") - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -65,15 +65,15 @@ public class MapTestDto { @JsonProperty("map_of_enum_string") - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTestDto mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index 8622ea861da..c5a17c21d44 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { @JsonProperty("map") - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClassDto uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java index 4cb33158086..f2536180600 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/PetDto.java @@ -44,7 +44,7 @@ public class PetDto { @JsonProperty("tags") - private List tags = null; + private List tags = new ArrayList<>(); /** * pet status in the store @@ -146,6 +146,9 @@ public class PetDto { } public PetDto addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 6afd2e37646..1818d96452c 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -17,7 +17,7 @@ import jakarta.annotation.Generated; * SpecialModelNameDto */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelNameDto { @@ -50,8 +50,8 @@ public class SpecialModelNameDto { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelNameDto $specialModelName = (SpecialModelNameDto) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelNameDto specialModelName = (SpecialModelNameDto) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 37047d9a2e2..989330c9165 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -28,17 +28,17 @@ public class TypeHolderDefaultDto { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefaultDto stringItem(String stringItem) { this.stringItem = stringItem; @@ -118,6 +118,9 @@ public class TypeHolderDefaultDto { } public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 6ca0eb07b4e..dc6721ab240 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -139,6 +139,9 @@ public class TypeHolderExampleDto { } public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java index d88463882e3..416ed86b17f 100644 --- a/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/client/petstore/spring-http-interface/src/main/java/org/openapitools/model/XmlItemDto.java @@ -38,7 +38,7 @@ public class XmlItemDto { @JsonProperty("wrapped_array") - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -54,11 +54,11 @@ public class XmlItemDto { @JsonProperty("name_array") - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -74,11 +74,11 @@ public class XmlItemDto { @JsonProperty("prefix_array") - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -94,11 +94,11 @@ public class XmlItemDto { @JsonProperty("namespace_array") - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -114,11 +114,11 @@ public class XmlItemDto { @JsonProperty("prefix_ns_array") - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItemDto attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java index 16a192536ec..aa414f42c1e 100644 --- a/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-3/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..ce65ccc5025 100644 --- a/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-async/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES index 682ec1ebc9a..bdc0d268f43 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/.openapi-generator/FILES @@ -26,6 +26,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java index fba9ca70891..cc888cde0fc 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -62,7 +62,7 @@ public interface AnotherFakeApi { consumes = "application/json" ) ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java index 6ad68cc2eb0..0d3020ab885 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeApi.java @@ -92,7 +92,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -103,7 +104,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -119,10 +120,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ); @@ -146,7 +148,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -173,7 +176,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = "*/*" + produces = "*/*", + consumes = "application/json" ) ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -184,7 +188,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -201,7 +205,7 @@ public interface FakeApi { consumes = "application/json" ) ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ); @@ -209,7 +213,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -226,7 +230,7 @@ public interface FakeApi { ) ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ); @@ -234,7 +238,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -255,7 +259,7 @@ public interface FakeApi { consumes = "application/json" ) ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); @@ -395,13 +399,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -413,12 +419,13 @@ public interface FakeApi { consumes = "application/json" ) ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ); /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -427,6 +434,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -448,7 +456,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -468,7 +475,6 @@ public interface FakeApi { ) ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java index b6709980d6b..a26836600fe 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/FakeClassnameTags123Api.java @@ -41,7 +41,7 @@ public interface FakeClassnameTags123Api { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -65,7 +65,7 @@ public interface FakeClassnameTags123Api { consumes = "application/json" ) ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java index 07ead4fcb75..52b514af35a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/PetApi.java @@ -41,14 +41,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -64,12 +66,13 @@ public interface PetApi { consumes = "application/json" ) ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -79,6 +82,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -206,8 +210,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -216,6 +221,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -233,12 +239,13 @@ public interface PetApi { consumes = "application/json" ) ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ); /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -248,6 +255,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -270,6 +278,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -279,6 +288,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -304,6 +314,7 @@ public interface PetApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -313,6 +324,7 @@ public interface PetApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java index 951cd7a58b6..818c087c562 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/StoreApi.java @@ -130,14 +130,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -150,10 +152,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = "application/json" + produces = "application/json", + consumes = "application/json" ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java index 501ff9a7a28..24f42ea5dde 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/api/UserApi.java @@ -43,7 +43,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -57,22 +57,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = "application/json" ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ); /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -80,22 +83,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = "application/json" ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -103,10 +109,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = "application/json" ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ); @@ -139,6 +146,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -148,6 +156,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -170,6 +179,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -179,6 +189,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -201,12 +212,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -226,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -242,11 +255,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = "application/json" ) ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ); } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..66e0aed61c6 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,41 +30,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -302,7 +305,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +315,11 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..ead205932fa 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..7ab62ebdb8f 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..4c5a142ddca 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ArrayTest.java @@ -26,15 +26,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..ae4b8d558ca --- /dev/null +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,207 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..696d07582b9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/EnumArrays.java @@ -99,7 +99,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..9b9f087aaa7 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,7 +29,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..74cab2e2f8c 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MapTest.java @@ -26,7 +26,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -65,15 +65,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..d6b45daabd7 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java index acb7ce6b37b..13d4b0b04b9 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/Pet.java @@ -44,7 +44,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -149,6 +149,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..e0a16a7b89a 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,7 +19,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java index e37caaf5784..76919cfbaaf 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -28,17 +28,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); public TypeHolderDefault stringItem(String stringItem) { this.stringItem = stringItem; @@ -122,6 +122,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java index c821c0257d2..6bcf2fdb5ef 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -144,6 +144,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -153,7 +156,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..03f777866d6 100644 --- a/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model/XmlItem.java @@ -38,7 +38,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -54,11 +54,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -74,11 +74,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -94,11 +94,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -114,11 +114,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..ce65ccc5025 100644 --- a/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..ce65ccc5025 100644 --- a/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-cloud/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..ce65ccc5025 100644 --- a/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs-skip-default-interface/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..ce65ccc5025 100644 --- a/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/client/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..ce65ccc5025 100644 --- a/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/spring-boot-springdoc/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java index 16a192536ec..aa414f42c1e 100644 --- a/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-3/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.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/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES deleted file mode 100644 index 5d716a83385..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ /dev/null @@ -1,71 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/OpenApiGeneratorApplication.java -src/main/java/org/openapitools/RFC3339DateFormat.java -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/SpringDocConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml -src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION deleted file mode 100644 index 7f4d792ec2c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.5.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md deleted file mode 100644 index e6de7e038ce..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenAPI generated server - -Spring Boot Server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. -This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - - -The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). -Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. -The specification is available to download using the following url: -http://localhost:80/v3/api-docs/ - -Start your server as a simple java application - -You can view the api documentation in swagger-ui by pointing to -http://localhost:80/swagger-ui.html - -Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml deleted file mode 100644 index 8a69ba3cda0..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ /dev/null @@ -1,75 +0,0 @@ - - 4.0.0 - org.openapitools.openapi3 - spring-boot-beanvalidation-no-nullable - jar - spring-boot-beanvalidation-no-nullable - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 1.6.14 - 4.15.5 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.data - spring-data-commons - - - - org.springdoc - springdoc-openapi-ui - ${springdoc.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - - org.springframework.boot - spring-boot-starter-validation - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java deleted file mode 100644 index 63641a4e97a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/OpenApiGeneratorApplication.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.openapitools; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; - -@SpringBootApplication( - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -@ComponentScan( - basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -public class OpenApiGeneratorApplication { - - public static void main(String[] args) { - SpringApplication.run(OpenApiGeneratorApplication.class, args); - } - - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/RFC3339DateFormat.java deleted file mode 100644 index bcd3936d8b3..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index 608a1aeac6e..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "$another-fake?", description = "the $another-fake? API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "call123testSpecialTags", - summary = "To test special tags", - description = "To test special tags and operation ID starting with number", - tags = { "$another-fake?" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index c2db7ca5a81..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0cc..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 2fb1c8141af..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,588 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createXmlItem", - summary = "creates an XmlItem", - description = "this route creates an XmlItem", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @Operation( - operationId = "fakeOuterBooleanSerialize", - description = "Test serialization of outer boolean types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @Operation( - operationId = "fakeOuterCompositeSerialize", - description = "Test serialization of object with outer number type", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @Operation( - operationId = "fakeOuterNumberSerialize", - description = "Test serialization of outer number types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @Operation( - operationId = "fakeOuterStringSerialize", - description = "Test serialization of outer string types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithFileSchema", - description = "For this test, the body for this request much reference a schema named `File`.", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithQueryParams", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClientModel", - summary = "To test \"client\" model", - description = "To test \"client\" model", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "testEndpointParameters", - summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - }, - security = { - @SecurityRequirement(name = "http_basic_test") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestParam(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestParam(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestParam(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestParam(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestParam(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @Operation( - operationId = "testEnumParameters", - summary = "To test enum parameters", - description = "To test enum parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid request"), - @ApiResponse(responseCode = "404", description = "Not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - */ - @Operation( - operationId = "testGroupParameters", - summary = "Fake endpoint to test group parameters (optional)", - description = "Fake endpoint to test group parameters (optional)", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Something wrong") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testInlineAdditionalProperties", - summary = "test inline additionalProperties", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testJsonFormData", - summary = "test json serialization of form data", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testQueryParameterCollectionFormat", - description = "To test the collection format in query parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFileWithRequiredFile", - summary = "uploads an image (required)", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index 5ae5d5fed98..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index 29936566e75..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClassname", - summary = "To test class name in snake case", - description = "To test class name in snake case", - tags = { "fake_classname_tags 123#$%^" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key_query") - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 65b695629d4..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index 41c3a646f9a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,383 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "pet", description = "Everything about your Pets") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @Operation( - operationId = "addPet", - summary = "Add a new pet to the store", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @Operation( - operationId = "deletePet", - summary = "Deletes a pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid pet value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @Operation( - operationId = "findPetsByStatus", - summary = "Finds Pets by status", - description = "Multiple status values can be provided with comma separated strings", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid status value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @Operation( - operationId = "findPetsByTags", - summary = "Finds Pets by tags", - description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid tag value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @Operation( - operationId = "getPetById", - summary = "Find pet by ID", - description = "Returns a single pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @Operation( - operationId = "updatePet", - summary = "Update an existing pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @Operation( - operationId = "updatePetWithForm", - summary = "Updates a pet in the store with form data", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFile", - summary = "uploads an image", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index ea6c56e02c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 65a87a295ec..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "store", description = "Access to Petstore orders") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @Operation( - operationId = "deleteOrder", - summary = "Delete purchase order by ID", - description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getInventory", - summary = "Returns pet inventories by status", - description = "Returns a map of status codes to quantities", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @Operation( - operationId = "getOrderById", - summary = "Find purchase order by ID", - description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @Operation( - operationId = "placeOrder", - summary = "Place an order for a pet", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid Order") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index 1292dc0b721..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 13c3f8176e6..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "user", description = "Operations about user") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUser", - summary = "Create user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithArrayInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithListInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "deleteUser", - summary = "Delete user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "getUserByName", - summary = "Get user by user name", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @Operation( - operationId = "loginUser", - summary = "Logs user into the system", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "logoutUser", - summary = "Logs out current logged in user session", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "updateUser", - summary = "Updated user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index ca00184d2a5..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java deleted file mode 100644 index b257cf0a16c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openapitools.configuration; - -import org.openapitools.model.EnumClass; -import org.openapitools.model.OuterEnum; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.convert.converter.Converter; - -@Configuration -public class EnumConverterConfiguration { - - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") - Converter enumClassConverter() { - return new Converter() { - @Override - public EnumClass convert(String source) { - return EnumClass.fromValue(source); - } - }; - } - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") - Converter outerEnumConverter() { - return new Converter() { - @Override - public OuterEnum convert(String source) { - return OuterEnum.fromValue(source); - } - }; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 9aa29284ab5..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java deleted file mode 100644 index a32f1f67787..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.security.SecurityScheme; - -@Configuration -public class SpringDocConfiguration { - - @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") - OpenAPI apiInfo() { - return new OpenAPI() - .info( - new Info() - .title("OpenAPI Petstore") - .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( - new License() - .name("Apache-2.0") - .url("https://www.apache.org/licenses/LICENSE-2.0.html") - ) - .version("1.0.0") - ) - .components( - new Components() - .addSecuritySchemes("petstore_auth", new SecurityScheme() - .type(SecurityScheme.Type.OAUTH2) - ) - .addSecuritySchemes("api_key", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.HEADER) - .name("api_key") - ) - .addSecuritySchemes("api_key_query", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.QUERY) - .name("api_key_query") - ) - .addSecuritySchemes("http_basic_test", new SecurityScheme() - .type(SecurityScheme.Type.HTTP) - .scheme("basic") - ) - ) - ; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index d905906f7bf..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index 3d02e9dd46a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index b7a841170a2..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index c3a18f03786..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,398 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index 9434294daf4..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index 2e3760d2115..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index d4d88060405..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index a4fb298c33b..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index 269a4170ff7..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,139 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - /** - * Default constructor - * @deprecated Use {@link Animal#Animal(String)} - */ - @Deprecated - public Animal() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Animal(String className) { - this.className = className; - } - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 82f57b75f44..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index 30fd1ee2f00..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,94 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index 69d0c66293d..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index f07e9f4b562..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,160 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.Cat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - /** - * Default constructor - * @deprecated Use {@link BigCat#BigCat(String)} - */ - @Deprecated - public BigCat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCat(String className) { - super(className); - } - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public BigCat declawed(Boolean declawed) { - super.setDeclawed(declawed); - return this; - } - - public BigCat className(String className) { - super.setClassName(className); - return this; - } - - public BigCat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index c9532c1e3f1..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index eb734357980..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,202 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index c6048b1335a..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,124 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - /** - * Default constructor - * @deprecated Use {@link Cat#Cat(String)} - */ - @Deprecated - public Cat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Cat(String className) { - super(className); - } - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - public Cat className(String className) { - super.setClassName(className); - return this; - } - - public Cat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index df8376c4a99..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 155f4416d9f..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,122 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - /** - * Default constructor - * @deprecated Use {@link Category#Category(String)} - */ - @Deprecated - public Category() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Category(String name) { - this.name = name; - } - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index 348a9826cbf..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index 082355c8ef4..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 0de88edc8ab..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - /** - * Default constructor - * @deprecated Use {@link Dog#Dog(String)} - */ - @Deprecated - public Dog() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Dog(String className) { - super(className); - } - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - public Dog className(String className) { - super.setClassName(className); - return this; - } - - public Dog color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index 318dcd160d8..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 5c87c8ab9e8..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,188 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index ee89c0fd200..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index cbd60e48575..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,342 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.OuterEnum; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - /** - * Default constructor - * @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTest(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index 87a7c66e2be..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@Schema(name = "File", description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 1c05208a474..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List<@Valid File> files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List<@Valid File> files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid File> getFiles() { - return files; - } - - public void setFiles(List<@Valid File> files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index ae54e71df26..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,433 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - /** - * Default constructor - * @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index b89d14273dd..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,108 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 0655a757b5b..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,228 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index 5247bfb7123..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,146 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 2e6f7a15434..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@Schema(name = "200_response", description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index f807aba2ada..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelFile.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index f269b47311d..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,82 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index d6dc995cbfb..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index 8529857c782..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@Schema(name = "Return", description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index 7835f479ed3..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,171 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@Schema(name = "Name", description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - /** - * Default constructor - * @deprecated Use {@link Name#Name(Integer)} - */ - @Deprecated - public Name() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Name(Integer name) { - this.name = name; - } - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index 6baa3007a5c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 780632475ec..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,243 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index aad108f959c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,131 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 86327bcf4e9..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,57 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 551a899b72c..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,283 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List<@Valid Tag> tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - /** - * Default constructor - * @deprecated Use {@link Pet#Pet(String, Set)} - */ - @Deprecated - public Pet() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Pet(String name, Set photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - if (this.photoUrls == null) { - this.photoUrls = new LinkedHashSet<>(); - } - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List<@Valid Tag> tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid Tag> getTags() { - return tags; - } - - public void setTags(List<@Valid Tag> tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index 20f99f09046..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index 5832d6c123e..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index a194f91e1a7..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,106 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 3f6d4a259b8..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,210 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefault() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 6365a70bc6e..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,235 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExample() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index 5d6889ef891..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,250 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 6d4d39acfa2..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,838 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties deleted file mode 100644 index 9d06609db66..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port=80 -spring.jackson.date-format=org.openapitools.RFC3339DateFormat -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java deleted file mode 100644 index 3681f67e770..00000000000 --- a/samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class OpenApiGeneratorApplicationTests { - - @Test - void contextLoads() { - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES index 3299b46a7b2..16d8f2a6323 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -44,6 +44,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index 6359de03e10..0346e04b53c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -62,9 +62,9 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().call123testSpecialTags(body); + return getDelegate().call123testSpecialTags(client); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2d5e24bcd5f..740965f1686 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -27,11 +27,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 3b04629b3e9..d047a0540c6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -95,7 +95,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -108,7 +109,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -124,12 +125,13 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { - return getDelegate().fakeOuterCompositeSerialize(body); + return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -153,7 +155,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -182,7 +185,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -195,7 +199,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -212,9 +216,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { - return getDelegate().testBodyWithFileSchema(body); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -222,7 +226,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -239,9 +243,9 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) { - return getDelegate().testBodyWithQueryParams(query, body); + return getDelegate().testBodyWithQueryParams(query, user); } @@ -249,7 +253,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -270,9 +274,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClientModel(body); + return getDelegate().testClientModel(client); } @@ -418,13 +422,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -436,14 +442,15 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { - return getDelegate().testInlineAdditionalProperties(param); + return getDelegate().testInlineAdditionalProperties(requestBody); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -452,6 +459,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -475,7 +483,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -495,17 +502,17 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -515,6 +522,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 2cd684b90f5..d1a650378e6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -63,11 +63,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -111,11 +111,11 @@ public interface FakeApiDelegate { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -124,12 +124,12 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default ResponseEntity testBodyWithQueryParams(String query, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,11 +138,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -249,18 +249,20 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default ResponseEntity testInlineAdditionalProperties(Map param) { + default ResponseEntity testInlineAdditionalProperties(Map requestBody) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -278,7 +280,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -286,7 +287,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default ResponseEntity testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context) { @@ -296,6 +296,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index bb8738151f5..2a2b2f9e5f9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -41,7 +41,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -65,9 +65,9 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClassname(body); + return getDelegate().testClassname(client); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index fb689b13f94..a15fd1b7728 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -27,11 +27,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index 90fc021e469..03132cf15f4 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -41,14 +41,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -64,14 +66,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().addPet(body); + return getDelegate().addPet(pet); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -81,6 +84,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -216,8 +220,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -226,6 +231,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -243,14 +249,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().updatePet(body); + return getDelegate().updatePet(pet); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -260,6 +267,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -284,6 +292,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -293,6 +302,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index 1e9ad7f94f4..aded0c3fefc 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -27,19 +27,21 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet body) { + default ResponseEntity addPet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -142,21 +144,23 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet body) { + default ResponseEntity updatePet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -173,6 +177,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index 84c19bbf0f1..23a896b1266 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -136,14 +136,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -156,12 +158,13 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { - return getDelegate().placeOrder(body); + return getDelegate().placeOrder(order); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index c4c812a9bb2..84623f79f76 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -81,13 +81,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 0473503500f..60d713ae895 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -43,7 +43,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -57,24 +57,27 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().createUser(body); + return getDelegate().createUser(user); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -82,24 +85,27 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithArrayInput(body); + return getDelegate().createUsersWithArrayInput(user); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -107,12 +113,13 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithListInput(body); + return getDelegate().createUsersWithListInput(user); } @@ -147,6 +154,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -156,6 +164,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -180,6 +189,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -189,6 +199,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -213,12 +224,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -240,7 +253,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -256,13 +269,14 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().updateUser(username, body); + return getDelegate().updateUser(username, user); } } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index c39231c6b29..f0630c08541 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -29,35 +29,37 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default ResponseEntity createUser(User body) { + default ResponseEntity createUser(User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default ResponseEntity createUsersWithArrayInput(List body) { + default ResponseEntity createUsersWithArrayInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default ResponseEntity createUsersWithListInput(List body) { + default ResponseEntity createUsersWithListInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,6 +80,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -106,6 +109,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -121,6 +125,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -135,13 +140,13 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default ResponseEntity updateUser(String username, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..66e0aed61c6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,41 +30,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -302,7 +305,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +315,11 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..ead205932fa 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..7ab62ebdb8f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..4c5a142ddca 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -26,15 +26,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..55d20539817 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..696d07582b9 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -99,7 +99,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..9b9f087aaa7 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,7 +29,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..74cab2e2f8c 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -26,7 +26,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -65,15 +65,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..d6b45daabd7 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..3f4cf6872f2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -44,7 +44,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..e0a16a7b89a 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,7 +19,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index 67ef036857d..12b55e21185 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -28,17 +28,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -142,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 5b77bee14c1..8b74b97d38f 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -165,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +177,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..03f777866d6 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -38,7 +38,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -54,11 +54,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -74,11 +74,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -94,11 +94,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -114,11 +114,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 5d716a83385..8263ca2ee05 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index 608a1aeac6e..065df164962 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -45,7 +45,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -66,7 +66,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index fa15b51fccc..4e0a224db24 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -100,7 +100,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -114,7 +115,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -130,10 +131,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -169,7 +171,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -199,7 +202,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -213,7 +217,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -230,7 +234,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -241,7 +245,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -258,7 +262,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -269,7 +273,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -290,7 +294,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -451,13 +455,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -469,7 +475,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -478,6 +484,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -486,6 +493,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -510,7 +518,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -530,7 +537,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context @@ -542,6 +548,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -551,6 +558,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 29936566e75..6ff08f7a872 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -45,7 +45,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -69,7 +69,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 407780f0e3c..880f6f7d409 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -45,14 +45,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -68,7 +70,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -77,6 +79,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @return successful operation (status code 200) @@ -85,6 +88,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -268,8 +272,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -278,6 +283,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -295,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -304,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -313,6 +320,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -338,6 +346,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -347,6 +356,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 65a87a295ec..1a630a2a489 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -157,14 +157,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -177,10 +179,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index 13c3f8176e6..140f63bd838 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -47,7 +47,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -61,10 +61,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -73,13 +74,15 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -87,10 +90,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -99,13 +103,15 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -113,10 +119,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -155,6 +162,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -164,6 +172,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -203,6 +212,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -212,6 +222,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -237,12 +248,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -265,7 +278,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -281,11 +294,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..66e0aed61c6 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,41 +30,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -302,7 +305,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +315,11 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..ead205932fa 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..7ab62ebdb8f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..4c5a142ddca 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -26,15 +26,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..55d20539817 --- /dev/null +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..696d07582b9 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -99,7 +99,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..9b9f087aaa7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,7 +29,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..74cab2e2f8c 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -26,7 +26,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -65,15 +65,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..d6b45daabd7 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..3f4cf6872f2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -44,7 +44,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..e0a16a7b89a 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,7 +19,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index 67ef036857d..12b55e21185 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -28,17 +28,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -142,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 5b77bee14c1..8b74b97d38f 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -165,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +177,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) public List getArrayItem() { return arrayItem; } diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..03f777866d6 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -38,7 +38,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -54,11 +54,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -74,11 +74,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -94,11 +94,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -114,11 +114,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/openapi3/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/.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/springboot-reactive/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES deleted file mode 100644 index 1fc07e54e68..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/FILES +++ /dev/null @@ -1,76 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/OpenApiGeneratorApplication.java -src/main/java/org/openapitools/RFC3339DateFormat.java -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeApiDelegate.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/PetApiDelegate.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/StoreApiDelegate.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/api/UserApiDelegate.java -src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml -src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/VERSION deleted file mode 100644 index 7f4d792ec2c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.5.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/README.md b/samples/openapi3/server/petstore/springboot-reactive/README.md deleted file mode 100644 index e6de7e038ce..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenAPI generated server - -Spring Boot Server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. -This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - - -The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). -Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. -The specification is available to download using the following url: -http://localhost:80/v3/api-docs/ - -Start your server as a simple java application - -You can view the api documentation in swagger-ui by pointing to -http://localhost:80/swagger-ui.html - -Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/pom.xml b/samples/openapi3/server/petstore/springboot-reactive/pom.xml deleted file mode 100644 index 2a16a7b42b7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - 4.0.0 - org.openapitools.openapi3 - springboot-reactive - jar - springboot-reactive - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 1.6.14 - 4.15.5 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - org.springframework.boot - spring-boot-starter-webflux - - - org.springframework.data - spring-data-commons - - - - org.springdoc - springdoc-openapi-webflux-ui - ${springdoc.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.2.6 - - - - org.springframework.boot - spring-boot-starter-validation - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java deleted file mode 100644 index 97252a8a940..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/OpenApiGeneratorApplication.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; - -@SpringBootApplication( - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -@ComponentScan( - basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -public class OpenApiGeneratorApplication { - - public static void main(String[] args) { - SpringApplication.run(OpenApiGeneratorApplication.class, args); - } - - @Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule") - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/RFC3339DateFormat.java deleted file mode 100644 index bcd3936d8b3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index 5087077ff35..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "$another-fake?", description = "the $another-fake? API") -public interface AnotherFakeApi { - - default AnotherFakeApiDelegate getDelegate() { - return new AnotherFakeApiDelegate() {}; - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "call123testSpecialTags", - summary = "To test special tags", - description = "To test special tags and operation ID starting with number", - tags = { "$another-fake?" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default Mono> call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().call123testSpecialTags(body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index e27e2fc20ea..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final AnotherFakeApiDelegate delegate; - - public AnotherFakeApiController(@Autowired(required = false) AnotherFakeApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new AnotherFakeApiDelegate() {}); - } - - @Override - public AnotherFakeApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java deleted file mode 100644 index 55b8ba0da1d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link AnotherFakeApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface AnotherFakeApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see AnotherFakeApi#call123testSpecialTags - */ - default Mono> call123testSpecialTags(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 7ed3b0ab28d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.api; - -import java.nio.charset.StandardCharsets; -import org.springframework.core.io.buffer.DefaultDataBuffer; -import org.springframework.core.io.buffer.DefaultDataBufferFactory; -import org.springframework.http.MediaType; -import org.springframework.http.server.reactive.ServerHttpResponse; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Mono; - -public class ApiUtil { - public static Mono getExampleResponse(ServerWebExchange exchange, MediaType mediaType, String example) { - ServerHttpResponse response = exchange.getResponse(); - response.getHeaders().setContentType(mediaType); - - byte[] exampleBytes = example.getBytes(StandardCharsets.UTF_8); - DefaultDataBuffer data = new DefaultDataBufferFactory().wrap(exampleBytes); - return response.writeWith(Mono.just(data)); - } -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index f4826107b05..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,561 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake", description = "the fake API") -public interface FakeApi { - - default FakeApiDelegate getDelegate() { - return new FakeApiDelegate() {}; - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createXmlItem", - summary = "creates an XmlItem", - description = "this route creates an XmlItem", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default Mono> createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody Mono xmlItem, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createXmlItem(xmlItem, exchange); - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @Operation( - operationId = "fakeOuterBooleanSerialize", - description = "Test serialization of outer boolean types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default Mono> fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterBooleanSerialize(body, exchange); - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @Operation( - operationId = "fakeOuterCompositeSerialize", - description = "Test serialization of object with outer number type", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default Mono> fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterCompositeSerialize(body, exchange); - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @Operation( - operationId = "fakeOuterNumberSerialize", - description = "Test serialization of outer number types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default Mono> fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterNumberSerialize(body, exchange); - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @Operation( - operationId = "fakeOuterStringSerialize", - description = "Test serialization of outer string types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default Mono> fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().fakeOuterStringSerialize(body, exchange); - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithFileSchema", - description = "For this test, the body for this request much reference a schema named `File`.", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default Mono> testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testBodyWithFileSchema(body, exchange); - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithQueryParams", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default Mono> testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testBodyWithQueryParams(query, body, exchange); - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClientModel", - summary = "To test \"client\" model", - description = "To test \"client\" model", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default Mono> testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testClientModel(body, exchange); - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "testEndpointParameters", - summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - }, - security = { - @SecurityRequirement(name = "http_basic_test") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestParam(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestParam(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestParam(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestParam(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) Flux binary, - @Parameter(name = "date", description = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestParam(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testEndpointParameters(number, _double, patternWithoutDelimiter, _byte, integer, int32, int64, _float, string, binary, date, dateTime, password, paramCallback, exchange); - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @Operation( - operationId = "testEnumParameters", - summary = "To test enum parameters", - description = "To test enum parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid request"), - @ApiResponse(responseCode = "404", description = "Not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) List enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") String enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) List enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") String enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) Integer enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) Double enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testEnumParameters(enumHeaderStringArray, enumHeaderString, enumQueryStringArray, enumQueryString, enumQueryInteger, enumQueryDouble, enumFormStringArray, enumFormString, exchange); - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - */ - @Operation( - operationId = "testGroupParameters", - summary = "Fake endpoint to test group parameters (optional)", - description = "Fake endpoint to test group parameters (optional)", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Something wrong") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default Mono> testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "string_group", required = false) Integer stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) Boolean booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) Long int64Group, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testGroupParameters(requiredStringGroup, requiredBooleanGroup, requiredInt64Group, stringGroup, booleanGroup, int64Group, exchange); - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testInlineAdditionalProperties", - summary = "test inline additionalProperties", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default Mono> testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Mono> param, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testInlineAdditionalProperties(param, exchange); - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testJsonFormData", - summary = "test json serialization of form data", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testJsonFormData(param, param2, exchange); - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testQueryParameterCollectionFormat", - description = "To test the collection format in query parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default Mono> testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFileWithRequiredFile", - summary = "uploads an image (required)", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default Mono> uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) Flux requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().uploadFileWithRequiredFile(petId, requiredFile, additionalMetadata, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index 726b17779f1..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,54 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeApiController implements FakeApi { - - private final FakeApiDelegate delegate; - - public FakeApiController(@Autowired(required = false) FakeApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new FakeApiDelegate() {}); - } - - @Override - public FakeApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java deleted file mode 100644 index 98fba4fc3d0..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ /dev/null @@ -1,365 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link FakeApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface FakeApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - * @see FakeApi#createXmlItem - */ - default Mono> createXmlItem(Mono xmlItem, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(xmlItem).then(Mono.empty()); - - } - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - * @see FakeApi#fakeOuterBooleanSerialize - */ - default Mono> fakeOuterBooleanSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - * @see FakeApi#fakeOuterCompositeSerialize - */ - default Mono> fakeOuterCompositeSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - * @see FakeApi#fakeOuterNumberSerialize - */ - default Mono> fakeOuterNumberSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - * @see FakeApi#fakeOuterStringSerialize - */ - default Mono> fakeOuterStringSerialize(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithFileSchema - */ - default Mono> testBodyWithFileSchema(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - * @see FakeApi#testBodyWithQueryParams - */ - default Mono> testBodyWithQueryParams(String query, - Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeApi#testClientModel - */ - default Mono> testClientModel(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see FakeApi#testEndpointParameters - */ - default Mono> testEndpointParameters(BigDecimal number, - Double _double, - String patternWithoutDelimiter, - byte[] _byte, - Integer integer, - Integer int32, - Long int64, - Float _float, - String string, - Flux binary, - LocalDate date, - OffsetDateTime dateTime, - String password, - String paramCallback, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - * @see FakeApi#testEnumParameters - */ - default Mono> testEnumParameters(List enumHeaderStringArray, - String enumHeaderString, - List enumQueryStringArray, - String enumQueryString, - Integer enumQueryInteger, - Double enumQueryDouble, - List enumFormStringArray, - String enumFormString, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - * @see FakeApi#testGroupParameters - */ - default Mono> testGroupParameters(Integer requiredStringGroup, - Boolean requiredBooleanGroup, - Long requiredInt64Group, - Integer stringGroup, - Boolean booleanGroup, - Long int64Group, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - * @see FakeApi#testInlineAdditionalProperties - */ - default Mono> testInlineAdditionalProperties(Mono> param, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(param).then(Mono.empty()); - - } - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - * @see FakeApi#testJsonFormData - */ - default Mono> testJsonFormData(String param, - String param2, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - * @see FakeApi#testQueryParameterCollectionFormat - */ - default Mono> testQueryParameterCollectionFormat(List pipe, - List ioutil, - List http, - List url, - List context, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - * @see FakeApi#uploadFileWithRequiredFile - */ - default Mono> uploadFileWithRequiredFile(Long petId, - Flux requiredFile, - String additionalMetadata, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index e9b3ad56131..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") -public interface FakeClassnameTestApi { - - default FakeClassnameTestApiDelegate getDelegate() { - return new FakeClassnameTestApiDelegate() {}; - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClassname", - summary = "To test class name in snake case", - description = "To test class name in snake case", - tags = { "fake_classname_tags 123#$%^" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key_query") - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default Mono> testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().testClassname(body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 21e28fe8b21..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,44 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final FakeClassnameTestApiDelegate delegate; - - public FakeClassnameTestApiController(@Autowired(required = false) FakeClassnameTestApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new FakeClassnameTestApiDelegate() {}); - } - - @Override - public FakeClassnameTestApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java deleted file mode 100644 index 0c2f87127f9..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ /dev/null @@ -1,53 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link FakeClassnameTestApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface FakeClassnameTestApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - * @see FakeClassnameTestApi#testClassname - */ - default Mono> testClassname(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index d96910342a1..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,332 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "pet", description = "Everything about your Pets") -public interface PetApi { - - default PetApiDelegate getDelegate() { - return new PetApiDelegate() {}; - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @Operation( - operationId = "addPet", - summary = "Add a new pet to the store", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default Mono> addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().addPet(body, exchange); - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @Operation( - operationId = "deletePet", - summary = "Deletes a pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid pet value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default Mono> deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) String apiKey, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().deletePet(petId, apiKey, exchange); - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @Operation( - operationId = "findPetsByStatus", - summary = "Finds Pets by status", - description = "Multiple status values can be provided with comma separated strings", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid status value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default Mono>> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().findPetsByStatus(status, exchange); - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @Operation( - operationId = "findPetsByTags", - summary = "Finds Pets by tags", - description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid tag value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default Mono>> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().findPetsByTags(tags, exchange); - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @Operation( - operationId = "getPetById", - summary = "Find pet by ID", - description = "Returns a single pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default Mono> getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getPetById(petId, exchange); - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @Operation( - operationId = "updatePet", - summary = "Update an existing pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default Mono> updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().updatePet(body, exchange); - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @Operation( - operationId = "updatePetWithForm", - summary = "Updates a pet in the store with form data", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default Mono> updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().updatePetWithForm(petId, name, status, exchange); - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFile", - summary = "uploads an image", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default Mono> uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) Flux file, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().uploadFile(petId, additionalMetadata, file, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index 5ef3de965ff..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class PetApiController implements PetApi { - - private final PetApiDelegate delegate; - - public PetApiController(@Autowired(required = false) PetApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new PetApiDelegate() {}); - } - - @Override - public PetApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java deleted file mode 100644 index b53ef4a0fa5..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ /dev/null @@ -1,219 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link PetApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface PetApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - * @see PetApi#addPet - */ - default Mono> addPet(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - * @see PetApi#deletePet - */ - default Mono> deletePet(Long petId, - String apiKey, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - * @see PetApi#findPetsByStatus - */ - default Mono>> findPetsByStatus(List status, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - * @see PetApi#findPetsByTags - */ - @Deprecated - default Mono>> findPetsByTags(Set tags, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * @see PetApi#getPetById - */ - default Mono> getPetById(Long petId, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - * @see PetApi#updatePet - */ - default Mono> updatePet(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - * @see PetApi#updatePetWithForm - */ - default Mono> updatePetWithForm(Long petId, - String name, - String status, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - * @see PetApi#uploadFile - */ - default Mono> uploadFile(Long petId, - String additionalMetadata, - Flux file, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 989e0285182..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "store", description = "Access to Petstore orders") -public interface StoreApi { - - default StoreApiDelegate getDelegate() { - return new StoreApiDelegate() {}; - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @Operation( - operationId = "deleteOrder", - summary = "Delete purchase order by ID", - description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default Mono> deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().deleteOrder(orderId, exchange); - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getInventory", - summary = "Returns pet inventories by status", - description = "Returns a map of status codes to quantities", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default Mono>> getInventory( - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getInventory(exchange); - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @Operation( - operationId = "getOrderById", - summary = "Find purchase order by ID", - description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default Mono> getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getOrderById(orderId, exchange); - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @Operation( - operationId = "placeOrder", - summary = "Place an order for a pet", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid Order") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default Mono> placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().placeOrder(body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index e9e29a41b4f..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,45 +0,0 @@ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class StoreApiController implements StoreApi { - - private final StoreApiDelegate delegate; - - public StoreApiController(@Autowired(required = false) StoreApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new StoreApiDelegate() {}); - } - - @Override - public StoreApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java deleted file mode 100644 index ec665c3cd61..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ /dev/null @@ -1,120 +0,0 @@ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link StoreApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface StoreApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#deleteOrder - */ - default Mono> deleteOrder(String orderId, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - * @see StoreApi#getInventory - */ - default Mono>> getInventory(ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - * @see StoreApi#getOrderById - */ - default Mono> getOrderById(Long orderId, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - * @see StoreApi#placeOrder - */ - default Mono> placeOrder(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 654a54daf89..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,279 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "user", description = "Operations about user") -public interface UserApi { - - default UserApiDelegate getDelegate() { - return new UserApiDelegate() {}; - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUser", - summary = "Create user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default Mono> createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createUser(body, exchange); - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithArrayInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default Mono> createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody Flux body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createUsersWithArrayInput(body, exchange); - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithListInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default Mono> createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody Flux body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().createUsersWithListInput(body, exchange); - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "deleteUser", - summary = "Delete user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default Mono> deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().deleteUser(username, exchange); - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "getUserByName", - summary = "Get user by user name", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default Mono> getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().getUserByName(username, exchange); - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @Operation( - operationId = "loginUser", - summary = "Logs user into the system", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default Mono> loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().loginUser(username, password, exchange); - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "logoutUser", - summary = "Logs out current logged in user session", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default Mono> logoutUser( - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().logoutUser(exchange); - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "updateUser", - summary = "Updated user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default Mono> updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody Mono body, - @Parameter(hidden = true) final ServerWebExchange exchange - ) { - return getDelegate().updateUser(username, body, exchange); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index 1b48d4a9444..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class UserApiController implements UserApi { - - private final UserApiDelegate delegate; - - public UserApiController(@Autowired(required = false) UserApiDelegate delegate) { - this.delegate = Optional.ofNullable(delegate).orElse(new UserApiDelegate() {}); - } - - @Override - public UserApiDelegate getDelegate() { - return delegate; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java deleted file mode 100644 index 8a589951350..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ /dev/null @@ -1,174 +0,0 @@ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.server.ServerWebExchange; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; -import org.springframework.http.codec.multipart.Part; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -/** - * A delegate to be called by the {@link UserApiController}}. - * Implement this interface with a {@link org.springframework.stereotype.Service} annotated class. - */ -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public interface UserApiDelegate { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUser - */ - default Mono> createUser(Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithArrayInput - */ - default Mono> createUsersWithArrayInput(Flux body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); - - } - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - * @see UserApi#createUsersWithListInput - */ - default Mono> createUsersWithListInput(Flux body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); - - } - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#deleteUser - */ - default Mono> deleteUser(String username, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#getUserByName - */ - default Mono> getUserByName(String username, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - for (MediaType mediaType : exchange.getRequest().getHeaders().getAccept()) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - result = ApiUtil.getExampleResponse(exchange, mediaType, exampleString); - break; - } - } - return result.then(Mono.empty()); - - } - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - * @see UserApi#loginUser - */ - default Mono> loginUser(String username, - String password, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - * @see UserApi#logoutUser - */ - default Mono> logoutUser(ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(Mono.empty()); - - } - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - * @see UserApi#updateUser - */ - default Mono> updateUser(String username, - Mono body, - ServerWebExchange exchange) { - Mono result = Mono.empty(); - exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java deleted file mode 100644 index b257cf0a16c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openapitools.configuration; - -import org.openapitools.model.EnumClass; -import org.openapitools.model.OuterEnum; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.convert.converter.Converter; - -@Configuration -public class EnumConverterConfiguration { - - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") - Converter enumClassConverter() { - return new Converter() { - @Override - public EnumClass convert(String source) { - return EnumClass.fromValue(source); - } - }; - } - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") - Converter outerEnumConverter() { - return new Converter() { - @Override - public OuterEnum convert(String source) { - return OuterEnum.fromValue(source); - } - }; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index cf658246a9d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,29 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.reactive.function.server.RouterFunction; -import org.springframework.web.reactive.function.server.ServerResponse; -import java.net.URI; - -import static org.springframework.web.reactive.function.server.RequestPredicates.GET; -import static org.springframework.web.reactive.function.server.RouterFunctions.route; - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @Bean - RouterFunction index() { - return route( - GET("/"), - req -> ServerResponse.temporaryRedirect(URI.create("swagger-ui.html")).build() - ); - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index 0661c1a9a8d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index a3f9c905789..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index db5f8d3ce35..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index 14e13504a8c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,399 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index ff0d6d7241e..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index cc212be855d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 7c74b7de08d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index 6087e70dba7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index 1ecf10efc5c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - /** - * Default constructor - * @deprecated Use {@link Animal#Animal(String)} - */ - @Deprecated - public Animal() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Animal(String className) { - this.className = className; - } - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 42600354f74..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index 2f6c19a8344..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index 23ee84ce8b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 8c5453c4a5b..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.Cat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - /** - * Default constructor - * @deprecated Use {@link BigCat#BigCat(String)} - */ - @Deprecated - public BigCat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCat(String className) { - super(className); - } - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public BigCat declawed(Boolean declawed) { - super.setDeclawed(declawed); - return this; - } - - public BigCat className(String className) { - super.setClassName(className); - return this; - } - - public BigCat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index 741de9f41a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 0c56400050b..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index a2feece8de8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - /** - * Default constructor - * @deprecated Use {@link Cat#Cat(String)} - */ - @Deprecated - public Cat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Cat(String className) { - super(className); - } - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - public Cat className(String className) { - super.setClassName(className); - return this; - } - - public Cat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 50a9c2cdce9..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 7ee1fde0646..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - /** - * Default constructor - * @deprecated Use {@link Category#Category(String)} - */ - @Deprecated - public Category() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Category(String name) { - this.name = name; - } - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index a1942e9c404..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index c38b26829be..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 1bb3d6b5102..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - /** - * Default constructor - * @deprecated Use {@link Dog#Dog(String)} - */ - @Deprecated - public Dog() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Dog(String className) { - super(className); - } - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - public Dog className(String className) { - super.setClassName(className); - return this; - } - - public Dog color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index 256925a7841..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 2720e81c227..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index 4e6027d16c4..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index 6f08d4ee9fb..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - /** - * Default constructor - * @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTest(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index bf750ccdcb7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@Schema(name = "File", description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 8b196d5d7de..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List<@Valid File> files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List<@Valid File> files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid File> getFiles() { - return files; - } - - public void setFiles(List<@Valid File> files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 06e9dde8e89..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,434 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - /** - * Default constructor - * @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index c218d0e02b8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 9811806e0c8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index bcf0155a1b2..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 9ca96d114aa..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@Schema(name = "200_response", description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 06c806057b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index de11d272cc3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index f168748f6a2..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index 641c56cd81c..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@Schema(name = "Return", description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index d6dcb665651..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@Schema(name = "Name", description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - /** - * Default constructor - * @deprecated Use {@link Name#Name(Integer)} - */ - @Deprecated - public Name() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Name(Integer name) { - this.name = name; - } - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index 4a3b6beffa2..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 9a5b61bad43..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,244 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index b66d6d38afb..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 7fdf6f47de3..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 6adaaba97d7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,281 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List<@Valid Tag> tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - /** - * Default constructor - * @deprecated Use {@link Pet#Pet(String, Set)} - */ - @Deprecated - public Pet() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Pet(String name, Set photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List<@Valid Tag> tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid Tag> getTags() { - return tags; - } - - public void setTags(List<@Valid Tag> tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index 8c43e7e8c30..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index c3d3aa9182e..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 03d5607e29b..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 67ef036857d..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefault() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 5b77bee14c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,233 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExample() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index e09df9be7b7..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 1a4455cdaa8..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,839 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/application.properties deleted file mode 100644 index 9d06609db66..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port=80 -spring.jackson.date-format=org.openapitools.RFC3339DateFormat -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml deleted file mode 100644 index 658d8a96b30..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ /dev/null @@ -1,2285 +0,0 @@ -openapi: 3.0.1 -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: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - 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 - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet - 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 - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet - /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": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: 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 - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - 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 - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/updatePetWithForm_request' - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/uploadFile_request' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: 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 - x-accepts: application/json - x-tags: - - tag: store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - 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": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: 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 - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generate exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $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: - - store - x-accepts: application/json - x-tags: - - tag: store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - 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 - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: 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 - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $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: - - user - x-accepts: application/json - x-tags: - - tag: user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - 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#$%^ - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Something wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - 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 - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testEnumParameters_request' - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testEndpointParameters_request' - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testJsonFormData_request' - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-content-type: application/xml - x-accepts: application/json - x-tags: - - tag: fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: $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": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - 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": - content: {} - description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true - 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 - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet -components: - schemas: - 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 - uniqueItems: true - 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 - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - 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 - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_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 - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - 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 - BigDecimal: - format: number - 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' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - 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 - type: string - 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 - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - updatePetWithForm_request: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - uploadFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - testEnumParameters_request: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - testEndpointParameters_request: - properties: - integer: - description: None - format: int32 - 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 - testJsonFormData_request: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - uploadFileWithRequiredFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - type: object - example: null - Cat_allOf: - properties: - declawed: - type: boolean - type: object - example: null - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null - 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 -x-original-swagger-version: "2.0" diff --git a/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java deleted file mode 100644 index 3681f67e770..00000000000 --- a/samples/openapi3/server/petstore/springboot-reactive/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class OpenApiGeneratorApplicationTests { - - @Test - void contextLoads() { - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java index 4f55bcef672..081e4813a03 100644 --- a/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot-source/src/main/java/org/openapitools/model/Pet.java @@ -40,7 +40,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -159,6 +159,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator-ignore b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator-ignore deleted file mode 100644 index 7484ee590a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/.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/springboot-useoptional/.openapi-generator/FILES b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES deleted file mode 100644 index 5d716a83385..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ /dev/null @@ -1,71 +0,0 @@ -README.md -pom.xml -src/main/java/org/openapitools/OpenApiGeneratorApplication.java -src/main/java/org/openapitools/RFC3339DateFormat.java -src/main/java/org/openapitools/api/AnotherFakeApi.java -src/main/java/org/openapitools/api/AnotherFakeApiController.java -src/main/java/org/openapitools/api/ApiUtil.java -src/main/java/org/openapitools/api/FakeApi.java -src/main/java/org/openapitools/api/FakeApiController.java -src/main/java/org/openapitools/api/FakeClassnameTestApi.java -src/main/java/org/openapitools/api/FakeClassnameTestApiController.java -src/main/java/org/openapitools/api/PetApi.java -src/main/java/org/openapitools/api/PetApiController.java -src/main/java/org/openapitools/api/StoreApi.java -src/main/java/org/openapitools/api/StoreApiController.java -src/main/java/org/openapitools/api/UserApi.java -src/main/java/org/openapitools/api/UserApiController.java -src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java -src/main/java/org/openapitools/configuration/HomeController.java -src/main/java/org/openapitools/configuration/SpringDocConfiguration.java -src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/main/java/org/openapitools/model/AdditionalPropertiesArray.java -src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java -src/main/java/org/openapitools/model/AdditionalPropertiesClass.java -src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/main/java/org/openapitools/model/AdditionalPropertiesObject.java -src/main/java/org/openapitools/model/AdditionalPropertiesString.java -src/main/java/org/openapitools/model/Animal.java -src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayOfNumberOnly.java -src/main/java/org/openapitools/model/ArrayTest.java -src/main/java/org/openapitools/model/BigCat.java -src/main/java/org/openapitools/model/BigCatAllOf.java -src/main/java/org/openapitools/model/Capitalization.java -src/main/java/org/openapitools/model/Cat.java -src/main/java/org/openapitools/model/CatAllOf.java -src/main/java/org/openapitools/model/Category.java -src/main/java/org/openapitools/model/ClassModel.java -src/main/java/org/openapitools/model/Client.java -src/main/java/org/openapitools/model/Dog.java -src/main/java/org/openapitools/model/DogAllOf.java -src/main/java/org/openapitools/model/EnumArrays.java -src/main/java/org/openapitools/model/EnumClass.java -src/main/java/org/openapitools/model/EnumTest.java -src/main/java/org/openapitools/model/File.java -src/main/java/org/openapitools/model/FileSchemaTestClass.java -src/main/java/org/openapitools/model/FormatTest.java -src/main/java/org/openapitools/model/HasOnlyReadOnly.java -src/main/java/org/openapitools/model/MapTest.java -src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java -src/main/java/org/openapitools/model/Model200Response.java -src/main/java/org/openapitools/model/ModelApiResponse.java -src/main/java/org/openapitools/model/ModelList.java -src/main/java/org/openapitools/model/ModelReturn.java -src/main/java/org/openapitools/model/Name.java -src/main/java/org/openapitools/model/NumberOnly.java -src/main/java/org/openapitools/model/Order.java -src/main/java/org/openapitools/model/OuterComposite.java -src/main/java/org/openapitools/model/OuterEnum.java -src/main/java/org/openapitools/model/Pet.java -src/main/java/org/openapitools/model/ReadOnlyFirst.java -src/main/java/org/openapitools/model/SpecialModelName.java -src/main/java/org/openapitools/model/Tag.java -src/main/java/org/openapitools/model/TypeHolderDefault.java -src/main/java/org/openapitools/model/TypeHolderExample.java -src/main/java/org/openapitools/model/User.java -src/main/java/org/openapitools/model/XmlItem.java -src/main/resources/application.properties -src/main/resources/openapi.yaml -src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java diff --git a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/VERSION b/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/VERSION deleted file mode 100644 index 7f4d792ec2c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.5.0-SNAPSHOT \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/README.md b/samples/openapi3/server/petstore/springboot-useoptional/README.md deleted file mode 100644 index e6de7e038ce..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/README.md +++ /dev/null @@ -1,21 +0,0 @@ -# OpenAPI generated server - -Spring Boot Server - -## Overview -This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. -By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub. -This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework. - - -The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org). -Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes. -The specification is available to download using the following url: -http://localhost:80/v3/api-docs/ - -Start your server as a simple java application - -You can view the api documentation in swagger-ui by pointing to -http://localhost:80/swagger-ui.html - -Change default port value in application.properties \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml b/samples/openapi3/server/petstore/springboot-useoptional/pom.xml deleted file mode 100644 index 93fdc77cc30..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - 4.0.0 - org.openapitools.openapi3 - spring-boot-useoptional - jar - spring-boot-useoptional - 1.0.0 - - 1.8 - ${java.version} - ${java.version} - UTF-8 - 1.6.14 - 4.15.5 - - - org.springframework.boot - spring-boot-starter-parent - 2.7.6 - - - - src/main/java - - - org.springframework.boot - spring-boot-maven-plugin - - - - - - org.springframework.boot - spring-boot-starter-web - - - org.springframework.data - spring-data-commons - - - - org.springdoc - springdoc-openapi-ui - ${springdoc.version} - - - - com.google.code.findbugs - jsr305 - 3.0.2 - - - com.fasterxml.jackson.dataformat - jackson-dataformat-yaml - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - org.openapitools - jackson-databind-nullable - 0.2.6 - - - - org.springframework.boot - spring-boot-starter-validation - - - com.fasterxml.jackson.core - jackson-databind - - - org.springframework.boot - spring-boot-starter-test - test - - - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java deleted file mode 100644 index 97252a8a940..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/OpenApiGeneratorApplication.java +++ /dev/null @@ -1,30 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.Module; -import org.openapitools.jackson.nullable.JsonNullableModule; -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.ComponentScan; -import org.springframework.context.annotation.FilterType; -import org.springframework.context.annotation.FullyQualifiedAnnotationBeanNameGenerator; - -@SpringBootApplication( - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -@ComponentScan( - basePackages = {"org.openapitools", "org.openapitools.api" , "org.openapitools.configuration"}, - nameGenerator = FullyQualifiedAnnotationBeanNameGenerator.class -) -public class OpenApiGeneratorApplication { - - public static void main(String[] args) { - SpringApplication.run(OpenApiGeneratorApplication.class, args); - } - - @Bean(name = "org.openapitools.OpenApiGeneratorApplication.jsonNullableModule") - public Module jsonNullableModule() { - return new JsonNullableModule(); - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/RFC3339DateFormat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/RFC3339DateFormat.java deleted file mode 100644 index bcd3936d8b3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/RFC3339DateFormat.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.openapitools; - -import com.fasterxml.jackson.databind.util.StdDateFormat; - -import java.text.DateFormat; -import java.text.FieldPosition; -import java.text.ParsePosition; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.TimeZone; - -public class RFC3339DateFormat extends DateFormat { - private static final long serialVersionUID = 1L; - private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); - - public RFC3339DateFormat() { - this.calendar = new GregorianCalendar(); - } - - @Override - public Date parse(String source, ParsePosition pos) { - return fmt.parse(source, pos); - } - - @Override - public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { - return fmt.format(date, toAppendTo, fieldPosition); - } - - @Override - public Object clone() { - return this; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java deleted file mode 100644 index 608a1aeac6e..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ /dev/null @@ -1,84 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "$another-fake?", description = "the $another-fake? API") -public interface AnotherFakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /another-fake/dummy : To test special tags - * To test special tags and operation ID starting with number - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "call123testSpecialTags", - summary = "To test special tags", - description = "To test special tags and operation ID starting with number", - tags = { "$another-fake?" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/another-fake/dummy", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java deleted file mode 100644 index c2db7ca5a81..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class AnotherFakeApiController implements AnotherFakeApi { - - private final NativeWebRequest request; - - @Autowired - public AnotherFakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/ApiUtil.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/ApiUtil.java deleted file mode 100644 index 1245b1dd0cc..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/ApiUtil.java +++ /dev/null @@ -1,19 +0,0 @@ -package org.openapitools.api; - -import org.springframework.web.context.request.NativeWebRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.IOException; - -public class ApiUtil { - public static void setExampleResponse(NativeWebRequest req, String contentType, String example) { - try { - HttpServletResponse res = req.getNativeResponse(HttpServletResponse.class); - res.setCharacterEncoding("UTF-8"); - res.addHeader("Content-Type", contentType); - res.getWriter().print(example); - } catch (IOException e) { - throw new RuntimeException(e); - } - } -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java deleted file mode 100644 index 3ae4970c5f6..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ /dev/null @@ -1,588 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake", description = "the fake API") -public interface FakeApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /fake/create_xml_item : creates an XmlItem - * this route creates an XmlItem - * - * @param xmlItem XmlItem Body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createXmlItem", - summary = "creates an XmlItem", - description = "this route creates an XmlItem", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/create_xml_item", - consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } - ) - default ResponseEntity createXmlItem( - @Parameter(name = "XmlItem", description = "XmlItem Body", required = true) @Valid @RequestBody XmlItem xmlItem - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/boolean - * Test serialization of outer boolean types - * - * @param body Input boolean as post body (optional) - * @return Output boolean (status code 200) - */ - @Operation( - operationId = "fakeOuterBooleanSerialize", - description = "Test serialization of outer boolean types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output boolean", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = Boolean.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/boolean", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterBooleanSerialize( - @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/composite - * Test serialization of object with outer number type - * - * @param body Input composite as post body (optional) - * @return Output composite (status code 200) - */ - @Operation( - operationId = "fakeOuterCompositeSerialize", - description = "Test serialization of object with outer number type", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output composite", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = OuterComposite.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/composite", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { - String exampleString = "{ \"my_string\" : \"my_string\", \"my_number\" : 0.8008281904610115, \"my_boolean\" : true }"; - ApiUtil.setExampleResponse(request, "*/*", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/number - * Test serialization of outer number types - * - * @param body Input number as post body (optional) - * @return Output number (status code 200) - */ - @Operation( - operationId = "fakeOuterNumberSerialize", - description = "Test serialization of outer number types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output number", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = BigDecimal.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/number", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterNumberSerialize( - @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/outer/string - * Test serialization of outer string types - * - * @param body Input string as post body (optional) - * @return Output string (status code 200) - */ - @Operation( - operationId = "fakeOuterStringSerialize", - description = "Test serialization of outer string types", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Output string", content = { - @Content(mediaType = "*/*", schema = @Schema(implementation = String.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/outer/string", - produces = { "*/*" } - ) - default ResponseEntity fakeOuterStringSerialize( - @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-file-schema - * For this test, the body for this request much reference a schema named `File`. - * - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithFileSchema", - description = "For this test, the body for this request much reference a schema named `File`.", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-file-schema", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/body-with-query-params - * - * @param query (required) - * @param body (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testBodyWithQueryParams", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/body-with-query-params", - consumes = { "application/json" } - ) - default ResponseEntity testBodyWithQueryParams( - @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PATCH /fake : To test \"client\" model - * To test \"client\" model - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClientModel", - summary = "To test \"client\" model", - description = "To test \"client\" model", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake : Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 - * - * @param number None (required) - * @param _double None (required) - * @param patternWithoutDelimiter None (required) - * @param _byte None (required) - * @param integer None (optional) - * @param int32 None (optional) - * @param int64 None (optional) - * @param _float None (optional) - * @param string None (optional) - * @param binary None (optional) - * @param date None (optional) - * @param dateTime None (optional) - * @param password None (optional) - * @param paramCallback None (optional) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "testEndpointParameters", - summary = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - description = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - }, - security = { - @SecurityRequirement(name = "http_basic_test") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEndpointParameters( - @Parameter(name = "number", description = "None", required = true) @Valid @RequestParam(value = "number", required = true) BigDecimal number, - @Parameter(name = "double", description = "None", required = true) @Valid @RequestParam(value = "double", required = true) Double _double, - @Parameter(name = "pattern_without_delimiter", description = "None", required = true) @Valid @RequestParam(value = "pattern_without_delimiter", required = true) String patternWithoutDelimiter, - @Parameter(name = "byte", description = "None", required = true) @Valid @RequestParam(value = "byte", required = true) byte[] _byte, - @Parameter(name = "integer", description = "None") @Valid @RequestParam(value = "integer", required = false) Integer integer, - @Parameter(name = "int32", description = "None") @Valid @RequestParam(value = "int32", required = false) Integer int32, - @Parameter(name = "int64", description = "None") @Valid @RequestParam(value = "int64", required = false) Long int64, - @Parameter(name = "float", description = "None") @Valid @RequestParam(value = "float", required = false) Float _float, - @Parameter(name = "string", description = "None") @Valid @RequestParam(value = "string", required = false) String string, - @Parameter(name = "binary", description = "None") @RequestPart(value = "binary", required = false) MultipartFile binary, - @Parameter(name = "date", description = "None") @Valid @RequestParam(value = "date", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date, - @Parameter(name = "dateTime", description = "None") @Valid @RequestParam(value = "dateTime", required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) OffsetDateTime dateTime, - @Parameter(name = "password", description = "None") @Valid @RequestParam(value = "password", required = false) String password, - @Parameter(name = "callback", description = "None") @Valid @RequestParam(value = "callback", required = false) String paramCallback - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake : To test enum parameters - * To test enum parameters - * - * @param enumHeaderStringArray Header parameter enum test (string array) (optional) - * @param enumHeaderString Header parameter enum test (string) (optional, default to -efg) - * @param enumQueryStringArray Query parameter enum test (string array) (optional) - * @param enumQueryString Query parameter enum test (string) (optional, default to -efg) - * @param enumQueryInteger Query parameter enum test (double) (optional) - * @param enumQueryDouble Query parameter enum test (double) (optional) - * @param enumFormStringArray Form parameter enum test (string array) (optional, default to $) - * @param enumFormString Form parameter enum test (string) (optional, default to -efg) - * @return Invalid request (status code 400) - * or Not found (status code 404) - */ - @Operation( - operationId = "testEnumParameters", - summary = "To test enum parameters", - description = "To test enum parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid request"), - @ApiResponse(responseCode = "404", description = "Not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testEnumParameters( - @Parameter(name = "enum_header_string_array", description = "Header parameter enum test (string array)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string_array", required = false) Optional> enumHeaderStringArray, - @Parameter(name = "enum_header_string", description = "Header parameter enum test (string)", in = ParameterIn.HEADER) @RequestHeader(value = "enum_header_string", required = false, defaultValue = "-efg") Optional enumHeaderString, - @Parameter(name = "enum_query_string_array", description = "Query parameter enum test (string array)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string_array", required = false) Optional> enumQueryStringArray, - @Parameter(name = "enum_query_string", description = "Query parameter enum test (string)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_string", required = false, defaultValue = "-efg") Optional enumQueryString, - @Parameter(name = "enum_query_integer", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_integer", required = false) Optional enumQueryInteger, - @Parameter(name = "enum_query_double", description = "Query parameter enum test (double)", in = ParameterIn.QUERY) @Valid @RequestParam(value = "enum_query_double", required = false) Optional enumQueryDouble, - @Parameter(name = "enum_form_string_array", description = "Form parameter enum test (string array)") @Valid @RequestPart(value = "enum_form_string_array", required = false) List enumFormStringArray, - @Parameter(name = "enum_form_string", description = "Form parameter enum test (string)") @Valid @RequestParam(value = "enum_form_string", required = false) String enumFormString - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /fake : Fake endpoint to test group parameters (optional) - * Fake endpoint to test group parameters (optional) - * - * @param requiredStringGroup Required String in group parameters (required) - * @param requiredBooleanGroup Required Boolean in group parameters (required) - * @param requiredInt64Group Required Integer in group parameters (required) - * @param stringGroup String in group parameters (optional) - * @param booleanGroup Boolean in group parameters (optional) - * @param int64Group Integer in group parameters (optional) - * @return Something wrong (status code 400) - */ - @Operation( - operationId = "testGroupParameters", - summary = "Fake endpoint to test group parameters (optional)", - description = "Fake endpoint to test group parameters (optional)", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "400", description = "Something wrong") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/fake" - ) - default ResponseEntity testGroupParameters( - @NotNull @Parameter(name = "required_string_group", description = "Required String in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_string_group", required = true) Integer requiredStringGroup, - @NotNull @Parameter(name = "required_boolean_group", description = "Required Boolean in group parameters", required = true, in = ParameterIn.HEADER) @RequestHeader(value = "required_boolean_group", required = true) Boolean requiredBooleanGroup, - @NotNull @Parameter(name = "required_int64_group", description = "Required Integer in group parameters", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "required_int64_group", required = true) Long requiredInt64Group, - @Parameter(name = "string_group", description = "String in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "string_group", required = false) Optional stringGroup, - @Parameter(name = "boolean_group", description = "Boolean in group parameters", in = ParameterIn.HEADER) @RequestHeader(value = "boolean_group", required = false) Optional booleanGroup, - @Parameter(name = "int64_group", description = "Integer in group parameters", in = ParameterIn.QUERY) @Valid @RequestParam(value = "int64_group", required = false) Optional int64Group - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/inline-additionalProperties : test inline additionalProperties - * - * @param param request body (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testInlineAdditionalProperties", - summary = "test inline additionalProperties", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/inline-additionalProperties", - consumes = { "application/json" } - ) - default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /fake/jsonFormData : test json serialization of form data - * - * @param param field1 (required) - * @param param2 field2 (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testJsonFormData", - summary = "test json serialization of form data", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/fake/jsonFormData", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity testJsonFormData( - @Parameter(name = "param", description = "field1", required = true) @Valid @RequestParam(value = "param", required = true) String param, - @Parameter(name = "param2", description = "field2", required = true) @Valid @RequestParam(value = "param2", required = true) String param2 - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /fake/test-query-parameters - * To test the collection format in query parameters - * - * @param pipe (required) - * @param ioutil (required) - * @param http (required) - * @param url (required) - * @param context (required) - * @return Success (status code 200) - */ - @Operation( - operationId = "testQueryParameterCollectionFormat", - description = "To test the collection format in query parameters", - tags = { "fake" }, - responses = { - @ApiResponse(responseCode = "200", description = "Success") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/fake/test-query-parameters" - ) - default ResponseEntity testQueryParameterCollectionFormat( - @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, - @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, - @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, - @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) - * - * @param petId ID of pet to update (required) - * @param requiredFile file to upload (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFileWithRequiredFile", - summary = "uploads an image (required)", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/fake/{petId}/uploadImageWithRequiredFile", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFileWithRequiredFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "requiredFile", description = "file to upload", required = true) @RequestPart(value = "requiredFile", required = true) MultipartFile requiredFile, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java deleted file mode 100644 index 5ae5d5fed98..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApiController.java +++ /dev/null @@ -1,56 +0,0 @@ -package org.openapitools.api; - -import java.math.BigDecimal; -import org.openapitools.model.Client; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.model.FileSchemaTestClass; -import java.time.LocalDate; -import java.util.Map; -import org.openapitools.model.ModelApiResponse; -import java.time.OffsetDateTime; -import org.openapitools.model.OuterComposite; -import org.openapitools.model.User; -import org.openapitools.model.XmlItem; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeApiController implements FakeApi { - - private final NativeWebRequest request; - - @Autowired - public FakeApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java deleted file mode 100644 index 29936566e75..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.Client; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "fake_classname_tags 123#$%^", description = "the fake_classname_tags 123#$%^ API") -public interface FakeClassnameTestApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * PATCH /fake_classname_test : To test class name in snake case - * To test class name in snake case - * - * @param body client model (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "testClassname", - summary = "To test class name in snake case", - description = "To test class name in snake case", - tags = { "fake_classname_tags 123#$%^" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Client.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key_query") - } - ) - @RequestMapping( - method = RequestMethod.PATCH, - value = "/fake_classname_test", - produces = { "application/json" }, - consumes = { "application/json" } - ) - default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"client\" : \"client\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java deleted file mode 100644 index 65b695629d4..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApiController.java +++ /dev/null @@ -1,46 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.Client; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class FakeClassnameTestApiController implements FakeClassnameTestApi { - - private final NativeWebRequest request; - - @Autowired - public FakeClassnameTestApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java deleted file mode 100644 index fb0435a4a64..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ /dev/null @@ -1,383 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "pet", description = "Everything about your Pets") -public interface PetApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /pet : Add a new pet to the store - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid input (status code 405) - */ - @Operation( - operationId = "addPet", - summary = "Add a new pet to the store", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /pet/{petId} : Deletes a pet - * - * @param petId Pet id to delete (required) - * @param apiKey (optional) - * @return successful operation (status code 200) - * or Invalid pet value (status code 400) - */ - @Operation( - operationId = "deletePet", - summary = "Deletes a pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid pet value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/pet/{petId}" - ) - default ResponseEntity deletePet( - @Parameter(name = "petId", description = "Pet id to delete", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "api_key", description = "", in = ParameterIn.HEADER) @RequestHeader(value = "api_key", required = false) Optional apiKey - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByStatus : Finds Pets by status - * Multiple status values can be provided with comma separated strings - * - * @param status Status values that need to be considered for filter (required) - * @return successful operation (status code 200) - * or Invalid status value (status code 400) - */ - @Operation( - operationId = "findPetsByStatus", - summary = "Finds Pets by status", - description = "Multiple status values can be provided with comma separated strings", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid status value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByStatus", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByStatus( - @NotNull @Parameter(name = "status", description = "Status values that need to be considered for filter", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "status", required = true) List status - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/findByTags : Finds Pets by tags - * Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing. - * - * @param tags Tags to filter by (required) - * @return successful operation (status code 200) - * or Invalid tag value (status code 400) - * @deprecated - */ - @Deprecated - @Operation( - operationId = "findPetsByTags", - summary = "Finds Pets by tags", - description = "Multiple tags can be provided with comma separated strings. Use tag1, tag2, tag3 for testing.", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", array = @ArraySchema(schema = @Schema(implementation = Pet.class))), - @Content(mediaType = "application/json", array = @ArraySchema(schema = @Schema(implementation = Pet.class))) - }), - @ApiResponse(responseCode = "400", description = "Invalid tag value") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/findByTags", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity> findPetsByTags( - @NotNull @Parameter(name = "tags", description = "Tags to filter by", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "tags", required = true) Set tags - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "[ { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }, { \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" } ]"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /pet/{petId} : Find pet by ID - * Returns a single pet - * - * @param petId ID of pet to return (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - */ - @Operation( - operationId = "getPetById", - summary = "Find pet by ID", - description = "Returns a single pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Pet.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Pet.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found") - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/pet/{petId}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getPetById( - @Parameter(name = "petId", description = "ID of pet to return", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"photoUrls\" : [ \"photoUrls\", \"photoUrls\" ], \"name\" : \"doggie\", \"id\" : 0, \"category\" : { \"name\" : \"default-name\", \"id\" : 6 }, \"tags\" : [ { \"name\" : \"name\", \"id\" : 1 }, { \"name\" : \"name\", \"id\" : 1 } ], \"status\" : \"available\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 aeiou doggie aeiou 123456789 aeiou aeiou "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /pet : Update an existing pet - * - * @param body Pet object that needs to be added to the store (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Pet not found (status code 404) - * or Validation exception (status code 405) - */ - @Operation( - operationId = "updatePet", - summary = "Update an existing pet", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation"), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Pet not found"), - @ApiResponse(responseCode = "405", description = "Validation exception") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/pet", - consumes = { "application/json", "application/xml" } - ) - default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId} : Updates a pet in the store with form data - * - * @param petId ID of pet that needs to be updated (required) - * @param name Updated name of the pet (optional) - * @param status Updated status of the pet (optional) - * @return Invalid input (status code 405) - */ - @Operation( - operationId = "updatePetWithForm", - summary = "Updates a pet in the store with form data", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "405", description = "Invalid input") - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}", - consumes = { "application/x-www-form-urlencoded" } - ) - default ResponseEntity updatePetWithForm( - @Parameter(name = "petId", description = "ID of pet that needs to be updated", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "name", description = "Updated name of the pet") @Valid @RequestParam(value = "name", required = false) String name, - @Parameter(name = "status", description = "Updated status of the pet") @Valid @RequestParam(value = "status", required = false) String status - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /pet/{petId}/uploadImage : uploads an image - * - * @param petId ID of pet to update (required) - * @param additionalMetadata Additional data to pass to server (optional) - * @param file file to upload (optional) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "uploadFile", - summary = "uploads an image", - tags = { "pet" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = ModelApiResponse.class)) - }) - }, - security = { - @SecurityRequirement(name = "petstore_auth", scopes={ "write:pets", "read:pets" }) - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/pet/{petId}/uploadImage", - produces = { "application/json" }, - consumes = { "multipart/form-data" } - ) - default ResponseEntity uploadFile( - @Parameter(name = "petId", description = "ID of pet to update", required = true, in = ParameterIn.PATH) @PathVariable("petId") Long petId, - @Parameter(name = "additionalMetadata", description = "Additional data to pass to server") @Valid @RequestParam(value = "additionalMetadata", required = false) String additionalMetadata, - @Parameter(name = "file", description = "file to upload") @RequestPart(value = "file", required = false) MultipartFile file - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"code\" : 0, \"type\" : \"type\", \"message\" : \"message\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java deleted file mode 100644 index ea6c56e02c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import org.openapitools.model.ModelApiResponse; -import org.openapitools.model.Pet; -import java.util.Set; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class PetApiController implements PetApi { - - private final NativeWebRequest request; - - @Autowired - public PetApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java deleted file mode 100644 index 65a87a295ec..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ /dev/null @@ -1,203 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "store", description = "Access to Petstore orders") -public interface StoreApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * DELETE /store/order/{order_id} : Delete purchase order by ID - * For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors - * - * @param orderId ID of the order that needs to be deleted (required) - * @return Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @Operation( - operationId = "deleteOrder", - summary = "Delete purchase order by ID", - description = "For valid response try integer IDs with value < 1000. Anything above 1000 or nonintegers will generate API errors", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/store/order/{order_id}" - ) - default ResponseEntity deleteOrder( - @Parameter(name = "order_id", description = "ID of the order that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("order_id") String orderId - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/inventory : Returns pet inventories by status - * Returns a map of status codes to quantities - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "getInventory", - summary = "Returns pet inventories by status", - description = "Returns a map of status codes to quantities", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/json", schema = @Schema(implementation = Map.class)) - }) - }, - security = { - @SecurityRequirement(name = "api_key") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/inventory", - produces = { "application/json" } - ) - default ResponseEntity> getInventory( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /store/order/{order_id} : Find purchase order by ID - * For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions - * - * @param orderId ID of pet that needs to be fetched (required) - * @return successful operation (status code 200) - * or Invalid ID supplied (status code 400) - * or Order not found (status code 404) - */ - @Operation( - operationId = "getOrderById", - summary = "Find purchase order by ID", - description = "For valid response try integer IDs with value <= 5 or > 10. Other values will generate exceptions", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid ID supplied"), - @ApiResponse(responseCode = "404", description = "Order not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/store/order/{order_id}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getOrderById( - @Min(1L) @Max(5L) @Parameter(name = "order_id", description = "ID of pet that needs to be fetched", required = true, in = ParameterIn.PATH) @PathVariable("order_id") Long orderId - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /store/order : Place an order for a pet - * - * @param body order placed for purchasing the pet (required) - * @return successful operation (status code 200) - * or Invalid Order (status code 400) - */ - @Operation( - operationId = "placeOrder", - summary = "Place an order for a pet", - tags = { "store" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = Order.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = Order.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid Order") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/store/order", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"petId\" : 6, \"quantity\" : 1, \"id\" : 0, \"shipDate\" : \"2000-01-23T04:56:07.000+00:00\", \"complete\" : false, \"status\" : \"placed\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 123456789 123 2000-01-23T04:56:07.000Z aeiou true "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java deleted file mode 100644 index 1292dc0b721..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApiController.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.openapitools.api; - -import java.util.Map; -import org.openapitools.model.Order; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class StoreApiController implements StoreApi { - - private final NativeWebRequest request; - - @Autowired - public StoreApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java deleted file mode 100644 index 13c3f8176e6..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ /dev/null @@ -1,294 +0,0 @@ -/** - * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech) (6.5.0-SNAPSHOT). - * https://openapi-generator.tech - * Do not edit the class manually. - */ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; -import io.swagger.v3.oas.annotations.ExternalDocumentation; -import io.swagger.v3.oas.annotations.Operation; -import io.swagger.v3.oas.annotations.Parameter; -import io.swagger.v3.oas.annotations.Parameters; -import io.swagger.v3.oas.annotations.media.ArraySchema; -import io.swagger.v3.oas.annotations.media.Content; -import io.swagger.v3.oas.annotations.media.Schema; -import io.swagger.v3.oas.annotations.responses.ApiResponse; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.enums.ParameterIn; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.validation.annotation.Validated; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.context.request.NativeWebRequest; -import org.springframework.web.multipart.MultipartFile; - -import javax.validation.Valid; -import javax.validation.constraints.*; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Validated -@Tag(name = "user", description = "Operations about user") -public interface UserApi { - - default Optional getRequest() { - return Optional.empty(); - } - - /** - * POST /user : Create user - * This can only be done by the logged in user. - * - * @param body Created user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUser", - summary = "Create user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user" - ) - default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithArray : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithArrayInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithArray" - ) - default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * POST /user/createWithList : Creates list of users with given input array - * - * @param body List of user object (required) - * @return successful operation (status code 200) - */ - @Operation( - operationId = "createUsersWithListInput", - summary = "Creates list of users with given input array", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.POST, - value = "/user/createWithList" - ) - default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * DELETE /user/{username} : Delete user - * This can only be done by the logged in user. - * - * @param username The name that needs to be deleted (required) - * @return Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "deleteUser", - summary = "Delete user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.DELETE, - value = "/user/{username}" - ) - default ResponseEntity deleteUser( - @Parameter(name = "username", description = "The name that needs to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/{username} : Get user by user name - * - * @param username The name that needs to be fetched. Use user1 for testing. (required) - * @return successful operation (status code 200) - * or Invalid username supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "getUserByName", - summary = "Get user by user name", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = User.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = User.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/{username}", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity getUserByName( - @Parameter(name = "username", description = "The name that needs to be fetched. Use user1 for testing.", required = true, in = ParameterIn.PATH) @PathVariable("username") String username - ) { - getRequest().ifPresent(request -> { - for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { - if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { - String exampleString = "{ \"firstName\" : \"firstName\", \"lastName\" : \"lastName\", \"password\" : \"password\", \"userStatus\" : 6, \"phone\" : \"phone\", \"id\" : 0, \"email\" : \"email\", \"username\" : \"username\" }"; - ApiUtil.setExampleResponse(request, "application/json", exampleString); - break; - } - if (mediaType.isCompatibleWith(MediaType.valueOf("application/xml"))) { - String exampleString = " 123456789 aeiou aeiou aeiou aeiou aeiou aeiou 123 "; - ApiUtil.setExampleResponse(request, "application/xml", exampleString); - break; - } - } - }); - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/login : Logs user into the system - * - * @param username The user name for login (required) - * @param password The password for login in clear text (required) - * @return successful operation (status code 200) - * or Invalid username/password supplied (status code 400) - */ - @Operation( - operationId = "loginUser", - summary = "Logs user into the system", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "200", description = "successful operation", content = { - @Content(mediaType = "application/xml", schema = @Schema(implementation = String.class)), - @Content(mediaType = "application/json", schema = @Schema(implementation = String.class)) - }), - @ApiResponse(responseCode = "400", description = "Invalid username/password supplied") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/login", - produces = { "application/xml", "application/json" } - ) - default ResponseEntity loginUser( - @NotNull @Parameter(name = "username", description = "The user name for login", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "username", required = true) String username, - @NotNull @Parameter(name = "password", description = "The password for login in clear text", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "password", required = true) String password - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * GET /user/logout : Logs out current logged in user session - * - * @return successful operation (status code 200) - */ - @Operation( - operationId = "logoutUser", - summary = "Logs out current logged in user session", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "default", description = "successful operation") - } - ) - @RequestMapping( - method = RequestMethod.GET, - value = "/user/logout" - ) - default ResponseEntity logoutUser( - - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - - - /** - * PUT /user/{username} : Updated user - * This can only be done by the logged in user. - * - * @param username name that need to be deleted (required) - * @param body Updated user object (required) - * @return Invalid user supplied (status code 400) - * or User not found (status code 404) - */ - @Operation( - operationId = "updateUser", - summary = "Updated user", - description = "This can only be done by the logged in user.", - tags = { "user" }, - responses = { - @ApiResponse(responseCode = "400", description = "Invalid user supplied"), - @ApiResponse(responseCode = "404", description = "User not found") - } - ) - @RequestMapping( - method = RequestMethod.PUT, - value = "/user/{username}" - ) - default ResponseEntity updateUser( - @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body - ) { - return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); - - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java deleted file mode 100644 index ca00184d2a5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApiController.java +++ /dev/null @@ -1,48 +0,0 @@ -package org.openapitools.api; - -import java.util.List; -import java.time.OffsetDateTime; -import org.openapitools.model.User; - - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.MediaType; -import org.springframework.http.ResponseEntity; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestHeader; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.CookieValue; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.RequestPart; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.context.request.NativeWebRequest; - -import javax.validation.constraints.*; -import javax.validation.Valid; - -import java.util.List; -import java.util.Map; -import java.util.Optional; -import javax.annotation.Generated; - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -@Controller -@RequestMapping("${openapi.openAPIPetstore.base-path:/v2}") -public class UserApiController implements UserApi { - - private final NativeWebRequest request; - - @Autowired - public UserApiController(NativeWebRequest request) { - this.request = request; - } - - @Override - public Optional getRequest() { - return Optional.ofNullable(request); - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java deleted file mode 100644 index b257cf0a16c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java +++ /dev/null @@ -1,32 +0,0 @@ -package org.openapitools.configuration; - -import org.openapitools.model.EnumClass; -import org.openapitools.model.OuterEnum; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; -import org.springframework.core.convert.converter.Converter; - -@Configuration -public class EnumConverterConfiguration { - - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.enumClassConverter") - Converter enumClassConverter() { - return new Converter() { - @Override - public EnumClass convert(String source) { - return EnumClass.fromValue(source); - } - }; - } - @Bean(name = "org.openapitools.configuration.EnumConverterConfiguration.outerEnumConverter") - Converter outerEnumConverter() { - return new Converter() { - @Override - public OuterEnum convert(String source) { - return OuterEnum.fromValue(source); - } - }; - } - -} diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java deleted file mode 100644 index 9aa29284ab5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/HomeController.java +++ /dev/null @@ -1,20 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.GetMapping; - -/** - * Home redirection to OpenAPI api documentation - */ -@Controller -public class HomeController { - - @RequestMapping("/") - public String index() { - return "redirect:swagger-ui.html"; - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java deleted file mode 100644 index a32f1f67787..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/configuration/SpringDocConfiguration.java +++ /dev/null @@ -1,52 +0,0 @@ -package org.openapitools.configuration; - -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -import io.swagger.v3.oas.models.OpenAPI; -import io.swagger.v3.oas.models.info.Info; -import io.swagger.v3.oas.models.info.Contact; -import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.Components; -import io.swagger.v3.oas.models.security.SecurityScheme; - -@Configuration -public class SpringDocConfiguration { - - @Bean(name = "org.openapitools.configuration.SpringDocConfiguration.apiInfo") - OpenAPI apiInfo() { - return new OpenAPI() - .info( - new Info() - .title("OpenAPI Petstore") - .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( - new License() - .name("Apache-2.0") - .url("https://www.apache.org/licenses/LICENSE-2.0.html") - ) - .version("1.0.0") - ) - .components( - new Components() - .addSecuritySchemes("petstore_auth", new SecurityScheme() - .type(SecurityScheme.Type.OAUTH2) - ) - .addSecuritySchemes("api_key", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.HEADER) - .name("api_key") - ) - .addSecuritySchemes("api_key_query", new SecurityScheme() - .type(SecurityScheme.Type.APIKEY) - .in(SecurityScheme.In.QUERY) - .name("api_key_query") - ) - .addSecuritySchemes("http_basic_test", new SecurityScheme() - .type(SecurityScheme.Type.HTTP) - .scheme("basic") - ) - ) - ; - } -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java deleted file mode 100644 index 0661c1a9a8d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesAnyType - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesAnyType extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesAnyType name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java deleted file mode 100644 index a3f9c905789..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesArray.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesArray - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesArray extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesArray name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java deleted file mode 100644 index db5f8d3ce35..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesBoolean - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesBoolean extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesBoolean name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesBoolean {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java deleted file mode 100644 index 14e13504a8c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ /dev/null @@ -1,399 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesClass { - - @JsonProperty("map_string") - @Valid - private Map mapString = null; - - @JsonProperty("map_number") - @Valid - private Map mapNumber = null; - - @JsonProperty("map_integer") - @Valid - private Map mapInteger = null; - - @JsonProperty("map_boolean") - @Valid - private Map mapBoolean = null; - - @JsonProperty("map_array_integer") - @Valid - private Map> mapArrayInteger = null; - - @JsonProperty("map_array_anytype") - @Valid - private Map> mapArrayAnytype = null; - - @JsonProperty("map_map_string") - @Valid - private Map> mapMapString = null; - - @JsonProperty("map_map_anytype") - @Valid - private Map> mapMapAnytype = null; - - @JsonProperty("anytype_1") - private Object anytype1; - - @JsonProperty("anytype_2") - private Object anytype2; - - @JsonProperty("anytype_3") - private Object anytype3; - - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; - return this; - } - - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); - } - this.mapString.put(key, mapStringItem); - return this; - } - - /** - * Get mapString - * @return mapString - */ - - @Schema(name = "map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapString() { - return mapString; - } - - public void setMapString(Map mapString) { - this.mapString = mapString; - } - - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return this; - } - - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); - } - this.mapNumber.put(key, mapNumberItem); - return this; - } - - /** - * Get mapNumber - * @return mapNumber - */ - @Valid - @Schema(name = "map_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapNumber() { - return mapNumber; - } - - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - } - - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - /** - * Get mapInteger - * @return mapInteger - */ - - @Schema(name = "map_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapInteger() { - return mapInteger; - } - - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - /** - * Get mapBoolean - * @return mapBoolean - */ - - @Schema(name = "map_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapBoolean() { - return mapBoolean; - } - - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - /** - * Get mapArrayInteger - * @return mapArrayInteger - */ - @Valid - @Schema(name = "map_array_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - /** - * Get mapArrayAnytype - * @return mapArrayAnytype - */ - @Valid - @Schema(name = "map_array_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - /** - * Get mapMapString - * @return mapMapString - */ - @Valid - @Schema(name = "map_map_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapString() { - return mapMapString; - } - - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - /** - * Get mapMapAnytype - * @return mapMapAnytype - */ - @Valid - @Schema(name = "map_map_anytype", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - /** - * Get anytype1 - * @return anytype1 - */ - - @Schema(name = "anytype_1", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype1() { - return anytype1; - } - - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - /** - * Get anytype2 - * @return anytype2 - */ - - @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { - return anytype2; - } - - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - /** - * Get anytype3 - * @return anytype3 - */ - - @Schema(name = "anytype_3", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype3() { - return anytype3; - } - - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesClass additionalPropertiesClass = (AdditionalPropertiesClass) o; - return Objects.equals(this.mapString, additionalPropertiesClass.mapString) && - Objects.equals(this.mapNumber, additionalPropertiesClass.mapNumber) && - Objects.equals(this.mapInteger, additionalPropertiesClass.mapInteger) && - Objects.equals(this.mapBoolean, additionalPropertiesClass.mapBoolean) && - Objects.equals(this.mapArrayInteger, additionalPropertiesClass.mapArrayInteger) && - Objects.equals(this.mapArrayAnytype, additionalPropertiesClass.mapArrayAnytype) && - Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && - Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && - Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && - Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); - } - - @Override - public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesClass {\n"); - sb.append(" mapString: ").append(toIndentedString(mapString)).append("\n"); - sb.append(" mapNumber: ").append(toIndentedString(mapNumber)).append("\n"); - sb.append(" mapInteger: ").append(toIndentedString(mapInteger)).append("\n"); - sb.append(" mapBoolean: ").append(toIndentedString(mapBoolean)).append("\n"); - sb.append(" mapArrayInteger: ").append(toIndentedString(mapArrayInteger)).append("\n"); - sb.append(" mapArrayAnytype: ").append(toIndentedString(mapArrayAnytype)).append("\n"); - sb.append(" mapMapString: ").append(toIndentedString(mapMapString)).append("\n"); - sb.append(" mapMapAnytype: ").append(toIndentedString(mapMapAnytype)).append("\n"); - sb.append(" anytype1: ").append(toIndentedString(anytype1)).append("\n"); - sb.append(" anytype2: ").append(toIndentedString(anytype2)).append("\n"); - sb.append(" anytype3: ").append(toIndentedString(anytype3)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index ff0d6d7241e..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesInteger - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesInteger extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesInteger additionalPropertiesInteger = (AdditionalPropertiesInteger) o; - return Objects.equals(this.name, additionalPropertiesInteger.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesInteger {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index cc212be855d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,88 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesNumber - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesNumber extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesNumber additionalPropertiesNumber = (AdditionalPropertiesNumber) o; - return Objects.equals(this.name, additionalPropertiesNumber.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesNumber {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index 7c74b7de08d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesObject - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesObject extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesObject additionalPropertiesObject = (AdditionalPropertiesObject) o; - return Objects.equals(this.name, additionalPropertiesObject.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesObject {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index 6087e70dba7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * AdditionalPropertiesString - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class AdditionalPropertiesString extends HashMap { - - @JsonProperty("name") - private String name; - - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - AdditionalPropertiesString additionalPropertiesString = (AdditionalPropertiesString) o; - return Objects.equals(this.name, additionalPropertiesString.name) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(name, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesString {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java deleted file mode 100644 index 1ecf10efc5c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Animal.java +++ /dev/null @@ -1,140 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.BigCat; -import org.openapitools.model.Cat; -import org.openapitools.model.Dog; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Animal - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat"), - @JsonSubTypes.Type(value = Cat.class, name = "Cat"), - @JsonSubTypes.Type(value = Dog.class, name = "Dog") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Animal { - - @JsonProperty("className") - private String className; - - @JsonProperty("color") - private String color = "red"; - - /** - * Default constructor - * @deprecated Use {@link Animal#Animal(String)} - */ - @Deprecated - public Animal() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Animal(String className) { - this.className = className; - } - - public Animal className(String className) { - this.className = className; - return this; - } - - /** - * Get className - * @return className - */ - @NotNull - @Schema(name = "className", requiredMode = Schema.RequiredMode.REQUIRED) - public String getClassName() { - return className; - } - - public void setClassName(String className) { - this.className = className; - } - - public Animal color(String color) { - this.color = color; - return this; - } - - /** - * Get color - * @return color - */ - - @Schema(name = "color", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getColor() { - return color; - } - - public void setColor(String color) { - this.color = color; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Animal animal = (Animal) o; - return Objects.equals(this.className, animal.className) && - Objects.equals(this.color, animal.color); - } - - @Override - public int hashCode() { - return Objects.hash(className, color); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Animal {\n"); - sb.append(" className: ").append(toIndentedString(className)).append("\n"); - sb.append(" color: ").append(toIndentedString(color)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java deleted file mode 100644 index 42600354f74..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfArrayOfNumberOnly { - - @JsonProperty("ArrayArrayNumber") - @Valid - private List> arrayArrayNumber = null; - - public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - return this; - } - - public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List arrayArrayNumberItem) { - if (this.arrayArrayNumber == null) { - this.arrayArrayNumber = new ArrayList<>(); - } - this.arrayArrayNumber.add(arrayArrayNumberItem); - return this; - } - - /** - * Get arrayArrayNumber - * @return arrayArrayNumber - */ - @Valid - @Schema(name = "ArrayArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayNumber() { - return arrayArrayNumber; - } - - public void setArrayArrayNumber(List> arrayArrayNumber) { - this.arrayArrayNumber = arrayArrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfArrayOfNumberOnly arrayOfArrayOfNumberOnly = (ArrayOfArrayOfNumberOnly) o; - return Objects.equals(this.arrayArrayNumber, arrayOfArrayOfNumberOnly.arrayArrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayArrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfArrayOfNumberOnly {\n"); - sb.append(" arrayArrayNumber: ").append(toIndentedString(arrayArrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java deleted file mode 100644 index 2f6c19a8344..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ /dev/null @@ -1,95 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayOfNumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayOfNumberOnly { - - @JsonProperty("ArrayNumber") - @Valid - private List arrayNumber = null; - - public ArrayOfNumberOnly arrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - return this; - } - - public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) { - if (this.arrayNumber == null) { - this.arrayNumber = new ArrayList<>(); - } - this.arrayNumber.add(arrayNumberItem); - return this; - } - - /** - * Get arrayNumber - * @return arrayNumber - */ - @Valid - @Schema(name = "ArrayNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayNumber() { - return arrayNumber; - } - - public void setArrayNumber(List arrayNumber) { - this.arrayNumber = arrayNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayOfNumberOnly arrayOfNumberOnly = (ArrayOfNumberOnly) o; - return Objects.equals(this.arrayNumber, arrayOfNumberOnly.arrayNumber); - } - - @Override - public int hashCode() { - return Objects.hash(arrayNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayOfNumberOnly {\n"); - sb.append(" arrayNumber: ").append(toIndentedString(arrayNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java deleted file mode 100644 index 23ee84ce8b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.model.ReadOnlyFirst; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ArrayTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ArrayTest { - - @JsonProperty("array_of_string") - @Valid - private List arrayOfString = null; - - @JsonProperty("array_array_of_integer") - @Valid - private List> arrayArrayOfInteger = null; - - @JsonProperty("array_array_of_model") - @Valid - private List> arrayArrayOfModel = null; - - public ArrayTest arrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - return this; - } - - public ArrayTest addArrayOfStringItem(String arrayOfStringItem) { - if (this.arrayOfString == null) { - this.arrayOfString = new ArrayList<>(); - } - this.arrayOfString.add(arrayOfStringItem); - return this; - } - - /** - * Get arrayOfString - * @return arrayOfString - */ - - @Schema(name = "array_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayOfString() { - return arrayOfString; - } - - public void setArrayOfString(List arrayOfString) { - this.arrayOfString = arrayOfString; - } - - public ArrayTest arrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - return this; - } - - public ArrayTest addArrayArrayOfIntegerItem(List arrayArrayOfIntegerItem) { - if (this.arrayArrayOfInteger == null) { - this.arrayArrayOfInteger = new ArrayList<>(); - } - this.arrayArrayOfInteger.add(arrayArrayOfIntegerItem); - return this; - } - - /** - * Get arrayArrayOfInteger - * @return arrayArrayOfInteger - */ - @Valid - @Schema(name = "array_array_of_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfInteger() { - return arrayArrayOfInteger; - } - - public void setArrayArrayOfInteger(List> arrayArrayOfInteger) { - this.arrayArrayOfInteger = arrayArrayOfInteger; - } - - public ArrayTest arrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - return this; - } - - public ArrayTest addArrayArrayOfModelItem(List<@Valid ReadOnlyFirst> arrayArrayOfModelItem) { - if (this.arrayArrayOfModel == null) { - this.arrayArrayOfModel = new ArrayList<>(); - } - this.arrayArrayOfModel.add(arrayArrayOfModelItem); - return this; - } - - /** - * Get arrayArrayOfModel - * @return arrayArrayOfModel - */ - @Valid - @Schema(name = "array_array_of_model", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List> getArrayArrayOfModel() { - return arrayArrayOfModel; - } - - public void setArrayArrayOfModel(List> arrayArrayOfModel) { - this.arrayArrayOfModel = arrayArrayOfModel; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ArrayTest arrayTest = (ArrayTest) o; - return Objects.equals(this.arrayOfString, arrayTest.arrayOfString) && - Objects.equals(this.arrayArrayOfInteger, arrayTest.arrayArrayOfInteger) && - Objects.equals(this.arrayArrayOfModel, arrayTest.arrayArrayOfModel); - } - - @Override - public int hashCode() { - return Objects.hash(arrayOfString, arrayArrayOfInteger, arrayArrayOfModel); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ArrayTest {\n"); - sb.append(" arrayOfString: ").append(toIndentedString(arrayOfString)).append("\n"); - sb.append(" arrayArrayOfInteger: ").append(toIndentedString(arrayArrayOfInteger)).append("\n"); - sb.append(" arrayArrayOfModel: ").append(toIndentedString(arrayArrayOfModel)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 8c5453c4a5b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,161 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.Cat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCat - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCat extends Cat { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - /** - * Default constructor - * @deprecated Use {@link BigCat#BigCat(String)} - */ - @Deprecated - public BigCat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public BigCat(String className) { - super(className); - } - - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - public BigCat declawed(Boolean declawed) { - super.setDeclawed(declawed); - return this; - } - - public BigCat className(String className) { - super.setClassName(className); - return this; - } - - public BigCat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCat bigCat = (BigCat) o; - return Objects.equals(this.kind, bigCat.kind) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(kind, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java deleted file mode 100644 index 741de9f41a3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/BigCatAllOf.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * BigCatAllOf - */ - -@JsonTypeName("BigCat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class BigCatAllOf { - - /** - * Gets or Sets kind - */ - public enum KindEnum { - LIONS("lions"), - - TIGERS("tigers"), - - LEOPARDS("leopards"), - - JAGUARS("jaguars"); - - private String value; - - KindEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static KindEnum fromValue(String value) { - for (KindEnum b : KindEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("kind") - private KindEnum kind; - - public BigCatAllOf kind(KindEnum kind) { - this.kind = kind; - return this; - } - - /** - * Get kind - * @return kind - */ - - @Schema(name = "kind", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public KindEnum getKind() { - return kind; - } - - public void setKind(KindEnum kind) { - this.kind = kind; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - BigCatAllOf bigCatAllOf = (BigCatAllOf) o; - return Objects.equals(this.kind, bigCatAllOf.kind); - } - - @Override - public int hashCode() { - return Objects.hash(kind); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class BigCatAllOf {\n"); - sb.append(" kind: ").append(toIndentedString(kind)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java deleted file mode 100644 index 0c56400050b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Capitalization.java +++ /dev/null @@ -1,203 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Capitalization - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Capitalization { - - @JsonProperty("smallCamel") - private String smallCamel; - - @JsonProperty("CapitalCamel") - private String capitalCamel; - - @JsonProperty("small_Snake") - private String smallSnake; - - @JsonProperty("Capital_Snake") - private String capitalSnake; - - @JsonProperty("SCA_ETH_Flow_Points") - private String scAETHFlowPoints; - - @JsonProperty("ATT_NAME") - private String ATT_NAME; - - public Capitalization smallCamel(String smallCamel) { - this.smallCamel = smallCamel; - return this; - } - - /** - * Get smallCamel - * @return smallCamel - */ - - @Schema(name = "smallCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallCamel() { - return smallCamel; - } - - public void setSmallCamel(String smallCamel) { - this.smallCamel = smallCamel; - } - - public Capitalization capitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - return this; - } - - /** - * Get capitalCamel - * @return capitalCamel - */ - - @Schema(name = "CapitalCamel", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalCamel() { - return capitalCamel; - } - - public void setCapitalCamel(String capitalCamel) { - this.capitalCamel = capitalCamel; - } - - public Capitalization smallSnake(String smallSnake) { - this.smallSnake = smallSnake; - return this; - } - - /** - * Get smallSnake - * @return smallSnake - */ - - @Schema(name = "small_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSmallSnake() { - return smallSnake; - } - - public void setSmallSnake(String smallSnake) { - this.smallSnake = smallSnake; - } - - public Capitalization capitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - return this; - } - - /** - * Get capitalSnake - * @return capitalSnake - */ - - @Schema(name = "Capital_Snake", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getCapitalSnake() { - return capitalSnake; - } - - public void setCapitalSnake(String capitalSnake) { - this.capitalSnake = capitalSnake; - } - - public Capitalization scAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - return this; - } - - /** - * Get scAETHFlowPoints - * @return scAETHFlowPoints - */ - - @Schema(name = "SCA_ETH_Flow_Points", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getScAETHFlowPoints() { - return scAETHFlowPoints; - } - - public void setScAETHFlowPoints(String scAETHFlowPoints) { - this.scAETHFlowPoints = scAETHFlowPoints; - } - - public Capitalization ATT_NAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - return this; - } - - /** - * Name of the pet - * @return ATT_NAME - */ - - @Schema(name = "ATT_NAME", description = "Name of the pet ", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getATTNAME() { - return ATT_NAME; - } - - public void setATTNAME(String ATT_NAME) { - this.ATT_NAME = ATT_NAME; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Capitalization capitalization = (Capitalization) o; - return Objects.equals(this.smallCamel, capitalization.smallCamel) && - Objects.equals(this.capitalCamel, capitalization.capitalCamel) && - Objects.equals(this.smallSnake, capitalization.smallSnake) && - Objects.equals(this.capitalSnake, capitalization.capitalSnake) && - Objects.equals(this.scAETHFlowPoints, capitalization.scAETHFlowPoints) && - Objects.equals(this.ATT_NAME, capitalization.ATT_NAME); - } - - @Override - public int hashCode() { - return Objects.hash(smallCamel, capitalCamel, smallSnake, capitalSnake, scAETHFlowPoints, ATT_NAME); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Capitalization {\n"); - sb.append(" smallCamel: ").append(toIndentedString(smallCamel)).append("\n"); - sb.append(" capitalCamel: ").append(toIndentedString(capitalCamel)).append("\n"); - sb.append(" smallSnake: ").append(toIndentedString(smallSnake)).append("\n"); - sb.append(" capitalSnake: ").append(toIndentedString(capitalSnake)).append("\n"); - sb.append(" scAETHFlowPoints: ").append(toIndentedString(scAETHFlowPoints)).append("\n"); - sb.append(" ATT_NAME: ").append(toIndentedString(ATT_NAME)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java deleted file mode 100644 index a2feece8de8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Cat.java +++ /dev/null @@ -1,125 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.model.BigCat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Cat - */ - -@JsonIgnoreProperties( - value = "className", // ignore manually set className, it will be automatically generated by Jackson during serialization - allowSetters = true // allows the className to be set during deserialization -) -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "className", visible = true) -@JsonSubTypes({ - @JsonSubTypes.Type(value = BigCat.class, name = "BigCat") -}) - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Cat extends Animal { - - @JsonProperty("declawed") - private Boolean declawed; - - /** - * Default constructor - * @deprecated Use {@link Cat#Cat(String)} - */ - @Deprecated - public Cat() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Cat(String className) { - super(className); - } - - public Cat declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - public Cat className(String className) { - super.setClassName(className); - return this; - } - - public Cat color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Cat cat = (Cat) o; - return Objects.equals(this.declawed, cat.declawed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(declawed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Cat {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java deleted file mode 100644 index 50a9c2cdce9..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/CatAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * CatAllOf - */ - -@JsonTypeName("Cat_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class CatAllOf { - - @JsonProperty("declawed") - private Boolean declawed; - - public CatAllOf declawed(Boolean declawed) { - this.declawed = declawed; - return this; - } - - /** - * Get declawed - * @return declawed - */ - - @Schema(name = "declawed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getDeclawed() { - return declawed; - } - - public void setDeclawed(Boolean declawed) { - this.declawed = declawed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - CatAllOf catAllOf = (CatAllOf) o; - return Objects.equals(this.declawed, catAllOf.declawed); - } - - @Override - public int hashCode() { - return Objects.hash(declawed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class CatAllOf {\n"); - sb.append(" declawed: ").append(toIndentedString(declawed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java deleted file mode 100644 index 7ee1fde0646..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Category.java +++ /dev/null @@ -1,123 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Category - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Category { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name = "default-name"; - - /** - * Default constructor - * @deprecated Use {@link Category#Category(String)} - */ - @Deprecated - public Category() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Category(String name) { - this.name = name; - } - - public Category id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Category name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Category category = (Category) o; - return Objects.equals(this.id, category.id) && - Objects.equals(this.name, category.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Category {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java deleted file mode 100644 index a1942e9c404..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ClassModel.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model with \"_class\" property - */ - -@Schema(name = "ClassModel", description = "Model for testing model with \"_class\" property") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ClassModel { - - @JsonProperty("_class") - private String propertyClass; - - public ClassModel propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "_class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ClassModel classModel = (ClassModel) o; - return Objects.equals(this.propertyClass, classModel.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ClassModel {\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java deleted file mode 100644 index c38b26829be..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Client.java +++ /dev/null @@ -1,83 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Client - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Client { - - @JsonProperty("client") - private String client; - - public Client client(String client) { - this.client = client; - return this; - } - - /** - * Get client - * @return client - */ - - @Schema(name = "client", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getClient() { - return client; - } - - public void setClient(String client) { - this.client = client; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Client client = (Client) o; - return Objects.equals(this.client, client.client); - } - - @Override - public int hashCode() { - return Objects.hash(client); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Client {\n"); - sb.append(" client: ").append(toIndentedString(client)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java deleted file mode 100644 index 1bb3d6b5102..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Dog.java +++ /dev/null @@ -1,116 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import org.openapitools.model.Animal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Dog - */ - - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Dog extends Animal { - - @JsonProperty("breed") - private String breed; - - /** - * Default constructor - * @deprecated Use {@link Dog#Dog(String)} - */ - @Deprecated - public Dog() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Dog(String className) { - super(className); - } - - public Dog breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - public Dog className(String className) { - super.setClassName(className); - return this; - } - - public Dog color(String color) { - super.setColor(color); - return this; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Dog dog = (Dog) o; - return Objects.equals(this.breed, dog.breed) && - super.equals(o); - } - - @Override - public int hashCode() { - return Objects.hash(breed, super.hashCode()); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Dog {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java deleted file mode 100644 index 256925a7841..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/DogAllOf.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * DogAllOf - */ - -@JsonTypeName("Dog_allOf") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class DogAllOf { - - @JsonProperty("breed") - private String breed; - - public DogAllOf breed(String breed) { - this.breed = breed; - return this; - } - - /** - * Get breed - * @return breed - */ - - @Schema(name = "breed", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBreed() { - return breed; - } - - public void setBreed(String breed) { - this.breed = breed; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - DogAllOf dogAllOf = (DogAllOf) o; - return Objects.equals(this.breed, dogAllOf.breed); - } - - @Override - public int hashCode() { - return Objects.hash(breed); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class DogAllOf {\n"); - sb.append(" breed: ").append(toIndentedString(breed)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java deleted file mode 100644 index 2720e81c227..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ /dev/null @@ -1,189 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumArrays - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumArrays { - - /** - * Gets or Sets justSymbol - */ - public enum JustSymbolEnum { - GREATER_THAN_OR_EQUAL_TO(">="), - - DOLLAR("$"); - - private String value; - - JustSymbolEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static JustSymbolEnum fromValue(String value) { - for (JustSymbolEnum b : JustSymbolEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("just_symbol") - private JustSymbolEnum justSymbol; - - /** - * Gets or Sets arrayEnum - */ - public enum ArrayEnumEnum { - FISH("fish"), - - CRAB("crab"); - - private String value; - - ArrayEnumEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static ArrayEnumEnum fromValue(String value) { - for (ArrayEnumEnum b : ArrayEnumEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("array_enum") - @Valid - private List arrayEnum = null; - - public EnumArrays justSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - return this; - } - - /** - * Get justSymbol - * @return justSymbol - */ - - @Schema(name = "just_symbol", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public JustSymbolEnum getJustSymbol() { - return justSymbol; - } - - public void setJustSymbol(JustSymbolEnum justSymbol) { - this.justSymbol = justSymbol; - } - - public EnumArrays arrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - return this; - } - - public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) { - if (this.arrayEnum == null) { - this.arrayEnum = new ArrayList<>(); - } - this.arrayEnum.add(arrayEnumItem); - return this; - } - - /** - * Get arrayEnum - * @return arrayEnum - */ - - @Schema(name = "array_enum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getArrayEnum() { - return arrayEnum; - } - - public void setArrayEnum(List arrayEnum) { - this.arrayEnum = arrayEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumArrays enumArrays = (EnumArrays) o; - return Objects.equals(this.justSymbol, enumArrays.justSymbol) && - Objects.equals(this.arrayEnum, enumArrays.arrayEnum); - } - - @Override - public int hashCode() { - return Objects.hash(justSymbol, arrayEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumArrays {\n"); - sb.append(" justSymbol: ").append(toIndentedString(justSymbol)).append("\n"); - sb.append(" arrayEnum: ").append(toIndentedString(arrayEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java deleted file mode 100644 index 4e6027d16c4..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumClass.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets EnumClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum EnumClass { - - _ABC("_abc"), - - _EFG("-efg"), - - _XYZ_("(xyz)"); - - private String value; - - EnumClass(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumClass fromValue(String value) { - for (EnumClass b : EnumClass.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java deleted file mode 100644 index 6f08d4ee9fb..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumTest.java +++ /dev/null @@ -1,343 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.model.OuterEnum; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * EnumTest - */ - -@JsonTypeName("Enum_Test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class EnumTest { - - /** - * Gets or Sets enumString - */ - public enum EnumStringEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringEnum fromValue(String value) { - for (EnumStringEnum b : EnumStringEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string") - private EnumStringEnum enumString; - - /** - * Gets or Sets enumStringRequired - */ - public enum EnumStringRequiredEnum { - UPPER("UPPER"), - - LOWER("lower"), - - EMPTY(""); - - private String value; - - EnumStringRequiredEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumStringRequiredEnum fromValue(String value) { - for (EnumStringRequiredEnum b : EnumStringRequiredEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_string_required") - private EnumStringRequiredEnum enumStringRequired; - - /** - * Gets or Sets enumInteger - */ - public enum EnumIntegerEnum { - NUMBER_1(1), - - NUMBER_MINUS_1(-1); - - private Integer value; - - EnumIntegerEnum(Integer value) { - this.value = value; - } - - @JsonValue - public Integer getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumIntegerEnum fromValue(Integer value) { - for (EnumIntegerEnum b : EnumIntegerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_integer") - private EnumIntegerEnum enumInteger; - - /** - * Gets or Sets enumNumber - */ - public enum EnumNumberEnum { - NUMBER_1_DOT_1(1.1), - - NUMBER_MINUS_1_DOT_2(-1.2); - - private Double value; - - EnumNumberEnum(Double value) { - this.value = value; - } - - @JsonValue - public Double getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static EnumNumberEnum fromValue(Double value) { - for (EnumNumberEnum b : EnumNumberEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("enum_number") - private EnumNumberEnum enumNumber; - - @JsonProperty("outerEnum") - private OuterEnum outerEnum; - - /** - * Default constructor - * @deprecated Use {@link EnumTest#EnumTest(EnumStringRequiredEnum)} - */ - @Deprecated - public EnumTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public EnumTest(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumString(EnumStringEnum enumString) { - this.enumString = enumString; - return this; - } - - /** - * Get enumString - * @return enumString - */ - - @Schema(name = "enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumStringEnum getEnumString() { - return enumString; - } - - public void setEnumString(EnumStringEnum enumString) { - this.enumString = enumString; - } - - public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - return this; - } - - /** - * Get enumStringRequired - * @return enumStringRequired - */ - @NotNull - @Schema(name = "enum_string_required", requiredMode = Schema.RequiredMode.REQUIRED) - public EnumStringRequiredEnum getEnumStringRequired() { - return enumStringRequired; - } - - public void setEnumStringRequired(EnumStringRequiredEnum enumStringRequired) { - this.enumStringRequired = enumStringRequired; - } - - public EnumTest enumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - return this; - } - - /** - * Get enumInteger - * @return enumInteger - */ - - @Schema(name = "enum_integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumIntegerEnum getEnumInteger() { - return enumInteger; - } - - public void setEnumInteger(EnumIntegerEnum enumInteger) { - this.enumInteger = enumInteger; - } - - public EnumTest enumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - return this; - } - - /** - * Get enumNumber - * @return enumNumber - */ - - @Schema(name = "enum_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public EnumNumberEnum getEnumNumber() { - return enumNumber; - } - - public void setEnumNumber(EnumNumberEnum enumNumber) { - this.enumNumber = enumNumber; - } - - public EnumTest outerEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - return this; - } - - /** - * Get outerEnum - * @return outerEnum - */ - @Valid - @Schema(name = "outerEnum", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OuterEnum getOuterEnum() { - return outerEnum; - } - - public void setOuterEnum(OuterEnum outerEnum) { - this.outerEnum = outerEnum; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnumTest enumTest = (EnumTest) o; - return Objects.equals(this.enumString, enumTest.enumString) && - Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && - Objects.equals(this.enumInteger, enumTest.enumInteger) && - Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); - } - - @Override - public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class EnumTest {\n"); - sb.append(" enumString: ").append(toIndentedString(enumString)).append("\n"); - sb.append(" enumStringRequired: ").append(toIndentedString(enumStringRequired)).append("\n"); - sb.append(" enumInteger: ").append(toIndentedString(enumInteger)).append("\n"); - sb.append(" enumNumber: ").append(toIndentedString(enumNumber)).append("\n"); - sb.append(" outerEnum: ").append(toIndentedString(outerEnum)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java deleted file mode 100644 index bf750ccdcb7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/File.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Must be named `File` for test. - */ - -@Schema(name = "File", description = "Must be named `File` for test.") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class File { - - @JsonProperty("sourceURI") - private String sourceURI; - - public File sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - - @Schema(name = "sourceURI", description = "Test capitalization", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - File file = (File) o; - return Objects.equals(this.sourceURI, file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class File {\n"); - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java deleted file mode 100644 index 8b196d5d7de..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ /dev/null @@ -1,119 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.io.File; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FileSchemaTestClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FileSchemaTestClass { - - @JsonProperty("file") - private File file; - - @JsonProperty("files") - @Valid - private List<@Valid File> files = null; - - public FileSchemaTestClass file(File file) { - this.file = file; - return this; - } - - /** - * Get file - * @return file - */ - @Valid - @Schema(name = "file", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public File getFile() { - return file; - } - - public void setFile(File file) { - this.file = file; - } - - public FileSchemaTestClass files(List<@Valid File> files) { - this.files = files; - return this; - } - - public FileSchemaTestClass addFilesItem(File filesItem) { - if (this.files == null) { - this.files = new ArrayList<>(); - } - this.files.add(filesItem); - return this; - } - - /** - * Get files - * @return files - */ - @Valid - @Schema(name = "files", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid File> getFiles() { - return files; - } - - public void setFiles(List<@Valid File> files) { - this.files = files; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FileSchemaTestClass fileSchemaTestClass = (FileSchemaTestClass) o; - return Objects.equals(this.file, fileSchemaTestClass.file) && - Objects.equals(this.files, fileSchemaTestClass.files); - } - - @Override - public int hashCode() { - return Objects.hash(file, files); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FileSchemaTestClass {\n"); - sb.append(" file: ").append(toIndentedString(file)).append("\n"); - sb.append(" files: ").append(toIndentedString(files)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java deleted file mode 100644 index 06e9dde8e89..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FormatTest.java +++ /dev/null @@ -1,434 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.math.BigDecimal; -import java.time.LocalDate; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.UUID; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * FormatTest - */ - -@JsonTypeName("format_test") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class FormatTest { - - @JsonProperty("integer") - private Integer integer; - - @JsonProperty("int32") - private Integer int32; - - @JsonProperty("int64") - private Long int64; - - @JsonProperty("number") - private BigDecimal number; - - @JsonProperty("float") - private Float _float; - - @JsonProperty("double") - private Double _double; - - @JsonProperty("string") - private String string; - - @JsonProperty("byte") - private byte[] _byte; - - @JsonProperty("binary") - private org.springframework.core.io.Resource binary; - - @JsonProperty("date") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) - private LocalDate date; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("password") - private String password; - - @JsonProperty("BigDecimal") - private BigDecimal bigDecimal; - - /** - * Default constructor - * @deprecated Use {@link FormatTest#FormatTest(BigDecimal, byte[], LocalDate, String)} - */ - @Deprecated - public FormatTest() { - super(); - } - - /** - * Constructor with only required parameters - */ - public FormatTest(BigDecimal number, byte[] _byte, LocalDate date, String password) { - this.number = number; - this._byte = _byte; - this.date = date; - this.password = password; - } - - public FormatTest integer(Integer integer) { - this.integer = integer; - return this; - } - - /** - * Get integer - * minimum: 10 - * maximum: 100 - * @return integer - */ - @Min(10) @Max(100) - @Schema(name = "integer", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInteger() { - return integer; - } - - public void setInteger(Integer integer) { - this.integer = integer; - } - - public FormatTest int32(Integer int32) { - this.int32 = int32; - return this; - } - - /** - * Get int32 - * minimum: 20 - * maximum: 200 - * @return int32 - */ - @Min(20) @Max(200) - @Schema(name = "int32", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getInt32() { - return int32; - } - - public void setInt32(Integer int32) { - this.int32 = int32; - } - - public FormatTest int64(Long int64) { - this.int64 = int64; - return this; - } - - /** - * Get int64 - * @return int64 - */ - - @Schema(name = "int64", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getInt64() { - return int64; - } - - public void setInt64(Long int64) { - this.int64 = int64; - } - - public FormatTest number(BigDecimal number) { - this.number = number; - return this; - } - - /** - * Get number - * minimum: 32.1 - * maximum: 543.2 - * @return number - */ - @NotNull @Valid @DecimalMin("32.1") @DecimalMax("543.2") - @Schema(name = "number", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumber() { - return number; - } - - public void setNumber(BigDecimal number) { - this.number = number; - } - - public FormatTest _float(Float _float) { - this._float = _float; - return this; - } - - /** - * Get _float - * minimum: 54.3 - * maximum: 987.6 - * @return _float - */ - @DecimalMin("54.3") @DecimalMax("987.6") - @Schema(name = "float", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Float getFloat() { - return _float; - } - - public void setFloat(Float _float) { - this._float = _float; - } - - public FormatTest _double(Double _double) { - this._double = _double; - return this; - } - - /** - * Get _double - * minimum: 67.8 - * maximum: 123.4 - * @return _double - */ - @DecimalMin("67.8") @DecimalMax("123.4") - @Schema(name = "double", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Double getDouble() { - return _double; - } - - public void setDouble(Double _double) { - this._double = _double; - } - - public FormatTest string(String string) { - this.string = string; - return this; - } - - /** - * Get string - * @return string - */ - @Pattern(regexp = "/[a-z]/i") - @Schema(name = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getString() { - return string; - } - - public void setString(String string) { - this.string = string; - } - - public FormatTest _byte(byte[] _byte) { - this._byte = _byte; - return this; - } - - /** - * Get _byte - * @return _byte - */ - @NotNull - @Schema(name = "byte", requiredMode = Schema.RequiredMode.REQUIRED) - public byte[] getByte() { - return _byte; - } - - public void setByte(byte[] _byte) { - this._byte = _byte; - } - - public FormatTest binary(org.springframework.core.io.Resource binary) { - this.binary = binary; - return this; - } - - /** - * Get binary - * @return binary - */ - @Valid - @Schema(name = "binary", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public org.springframework.core.io.Resource getBinary() { - return binary; - } - - public void setBinary(org.springframework.core.io.Resource binary) { - this.binary = binary; - } - - public FormatTest date(LocalDate date) { - this.date = date; - return this; - } - - /** - * Get date - * @return date - */ - @NotNull @Valid - @Schema(name = "date", requiredMode = Schema.RequiredMode.REQUIRED) - public LocalDate getDate() { - return date; - } - - public void setDate(LocalDate date) { - this.date = date; - } - - public FormatTest dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public FormatTest uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", example = "72f98069-206d-4f12-9f12-3d1e525a8e84", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public FormatTest password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - @NotNull @Size(min = 10, max = 64) - @Schema(name = "password", requiredMode = Schema.RequiredMode.REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - return this; - } - - /** - * Get bigDecimal - * @return bigDecimal - */ - @Valid - @Schema(name = "BigDecimal", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getBigDecimal() { - return bigDecimal; - } - - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - FormatTest formatTest = (FormatTest) o; - return Objects.equals(this.integer, formatTest.integer) && - Objects.equals(this.int32, formatTest.int32) && - Objects.equals(this.int64, formatTest.int64) && - Objects.equals(this.number, formatTest.number) && - Objects.equals(this._float, formatTest._float) && - Objects.equals(this._double, formatTest._double) && - Objects.equals(this.string, formatTest.string) && - Arrays.equals(this._byte, formatTest._byte) && - Objects.equals(this.binary, formatTest.binary) && - Objects.equals(this.date, formatTest.date) && - Objects.equals(this.dateTime, formatTest.dateTime) && - Objects.equals(this.uuid, formatTest.uuid) && - Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); - } - - @Override - public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class FormatTest {\n"); - sb.append(" integer: ").append(toIndentedString(integer)).append("\n"); - sb.append(" int32: ").append(toIndentedString(int32)).append("\n"); - sb.append(" int64: ").append(toIndentedString(int64)).append("\n"); - sb.append(" number: ").append(toIndentedString(number)).append("\n"); - sb.append(" _float: ").append(toIndentedString(_float)).append("\n"); - sb.append(" _double: ").append(toIndentedString(_double)).append("\n"); - sb.append(" string: ").append(toIndentedString(string)).append("\n"); - sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n"); - sb.append(" binary: ").append(toIndentedString(binary)).append("\n"); - sb.append(" date: ").append(toIndentedString(date)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java deleted file mode 100644 index c218d0e02b8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/HasOnlyReadOnly.java +++ /dev/null @@ -1,109 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * HasOnlyReadOnly - */ - -@JsonTypeName("hasOnlyReadOnly") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class HasOnlyReadOnly { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("foo") - private String foo; - - public HasOnlyReadOnly bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public HasOnlyReadOnly foo(String foo) { - this.foo = foo; - return this; - } - - /** - * Get foo - * @return foo - */ - - @Schema(name = "foo", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFoo() { - return foo; - } - - public void setFoo(String foo) { - this.foo = foo; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - HasOnlyReadOnly hasOnlyReadOnly = (HasOnlyReadOnly) o; - return Objects.equals(this.bar, hasOnlyReadOnly.bar) && - Objects.equals(this.foo, hasOnlyReadOnly.foo); - } - - @Override - public int hashCode() { - return Objects.hash(bar, foo); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class HasOnlyReadOnly {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" foo: ").append(toIndentedString(foo)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java deleted file mode 100644 index 9811806e0c8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ /dev/null @@ -1,229 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.HashMap; -import java.util.Map; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MapTest - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MapTest { - - @JsonProperty("map_map_of_string") - @Valid - private Map> mapMapOfString = null; - - /** - * Gets or Sets inner - */ - public enum InnerEnum { - UPPER("UPPER"), - - LOWER("lower"); - - private String value; - - InnerEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static InnerEnum fromValue(String value) { - for (InnerEnum b : InnerEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("map_of_enum_string") - @Valid - private Map mapOfEnumString = null; - - @JsonProperty("direct_map") - @Valid - private Map directMap = null; - - @JsonProperty("indirect_map") - @Valid - private Map indirectMap = null; - - public MapTest mapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - return this; - } - - public MapTest putMapMapOfStringItem(String key, Map mapMapOfStringItem) { - if (this.mapMapOfString == null) { - this.mapMapOfString = new HashMap<>(); - } - this.mapMapOfString.put(key, mapMapOfStringItem); - return this; - } - - /** - * Get mapMapOfString - * @return mapMapOfString - */ - @Valid - @Schema(name = "map_map_of_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map> getMapMapOfString() { - return mapMapOfString; - } - - public void setMapMapOfString(Map> mapMapOfString) { - this.mapMapOfString = mapMapOfString; - } - - public MapTest mapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - return this; - } - - public MapTest putMapOfEnumStringItem(String key, InnerEnum mapOfEnumStringItem) { - if (this.mapOfEnumString == null) { - this.mapOfEnumString = new HashMap<>(); - } - this.mapOfEnumString.put(key, mapOfEnumStringItem); - return this; - } - - /** - * Get mapOfEnumString - * @return mapOfEnumString - */ - - @Schema(name = "map_of_enum_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMapOfEnumString() { - return mapOfEnumString; - } - - public void setMapOfEnumString(Map mapOfEnumString) { - this.mapOfEnumString = mapOfEnumString; - } - - public MapTest directMap(Map directMap) { - this.directMap = directMap; - return this; - } - - public MapTest putDirectMapItem(String key, Boolean directMapItem) { - if (this.directMap == null) { - this.directMap = new HashMap<>(); - } - this.directMap.put(key, directMapItem); - return this; - } - - /** - * Get directMap - * @return directMap - */ - - @Schema(name = "direct_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getDirectMap() { - return directMap; - } - - public void setDirectMap(Map directMap) { - this.directMap = directMap; - } - - public MapTest indirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - return this; - } - - public MapTest putIndirectMapItem(String key, Boolean indirectMapItem) { - if (this.indirectMap == null) { - this.indirectMap = new HashMap<>(); - } - this.indirectMap.put(key, indirectMapItem); - return this; - } - - /** - * Get indirectMap - * @return indirectMap - */ - - @Schema(name = "indirect_map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getIndirectMap() { - return indirectMap; - } - - public void setIndirectMap(Map indirectMap) { - this.indirectMap = indirectMap; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MapTest mapTest = (MapTest) o; - return Objects.equals(this.mapMapOfString, mapTest.mapMapOfString) && - Objects.equals(this.mapOfEnumString, mapTest.mapOfEnumString) && - Objects.equals(this.directMap, mapTest.directMap) && - Objects.equals(this.indirectMap, mapTest.indirectMap); - } - - @Override - public int hashCode() { - return Objects.hash(mapMapOfString, mapOfEnumString, directMap, indirectMap); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MapTest {\n"); - sb.append(" mapMapOfString: ").append(toIndentedString(mapMapOfString)).append("\n"); - sb.append(" mapOfEnumString: ").append(toIndentedString(mapOfEnumString)).append("\n"); - sb.append(" directMap: ").append(toIndentedString(directMap)).append("\n"); - sb.append(" indirectMap: ").append(toIndentedString(indirectMap)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java deleted file mode 100644 index bcf0155a1b2..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ /dev/null @@ -1,147 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.time.OffsetDateTime; -import java.util.HashMap; -import java.util.Map; -import java.util.UUID; -import org.openapitools.model.Animal; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * MixedPropertiesAndAdditionalPropertiesClass - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class MixedPropertiesAndAdditionalPropertiesClass { - - @JsonProperty("uuid") - private UUID uuid; - - @JsonProperty("dateTime") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime dateTime; - - @JsonProperty("map") - @Valid - private Map map = null; - - public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { - this.uuid = uuid; - return this; - } - - /** - * Get uuid - * @return uuid - */ - @Valid - @Schema(name = "uuid", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public UUID getUuid() { - return uuid; - } - - public void setUuid(UUID uuid) { - this.uuid = uuid; - } - - public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - return this; - } - - /** - * Get dateTime - * @return dateTime - */ - @Valid - @Schema(name = "dateTime", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getDateTime() { - return dateTime; - } - - public void setDateTime(OffsetDateTime dateTime) { - this.dateTime = dateTime; - } - - public MixedPropertiesAndAdditionalPropertiesClass map(Map map) { - this.map = map; - return this; - } - - public MixedPropertiesAndAdditionalPropertiesClass putMapItem(String key, Animal mapItem) { - if (this.map == null) { - this.map = new HashMap<>(); - } - this.map.put(key, mapItem); - return this; - } - - /** - * Get map - * @return map - */ - @Valid - @Schema(name = "map", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Map getMap() { - return map; - } - - public void setMap(Map map) { - this.map = map; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - MixedPropertiesAndAdditionalPropertiesClass mixedPropertiesAndAdditionalPropertiesClass = (MixedPropertiesAndAdditionalPropertiesClass) o; - return Objects.equals(this.uuid, mixedPropertiesAndAdditionalPropertiesClass.uuid) && - Objects.equals(this.dateTime, mixedPropertiesAndAdditionalPropertiesClass.dateTime) && - Objects.equals(this.map, mixedPropertiesAndAdditionalPropertiesClass.map); - } - - @Override - public int hashCode() { - return Objects.hash(uuid, dateTime, map); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class MixedPropertiesAndAdditionalPropertiesClass {\n"); - sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); - sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); - sb.append(" map: ").append(toIndentedString(map)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java deleted file mode 100644 index 9ca96d114aa..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Model200Response.java +++ /dev/null @@ -1,110 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name starting with number - */ - -@Schema(name = "200_response", description = "Model for testing model name starting with number") -@JsonTypeName("200_response") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Model200Response { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("class") - private String propertyClass; - - public Model200Response name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Model200Response propertyClass(String propertyClass) { - this.propertyClass = propertyClass; - return this; - } - - /** - * Get propertyClass - * @return propertyClass - */ - - @Schema(name = "class", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPropertyClass() { - return propertyClass; - } - - public void setPropertyClass(String propertyClass) { - this.propertyClass = propertyClass; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Model200Response _200response = (Model200Response) o; - return Objects.equals(this.name, _200response.name) && - Objects.equals(this.propertyClass, _200response.propertyClass); - } - - @Override - public int hashCode() { - return Objects.hash(name, propertyClass); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Model200Response {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" propertyClass: ").append(toIndentedString(propertyClass)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java deleted file mode 100644 index 06c806057b5..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelApiResponse.java +++ /dev/null @@ -1,133 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelApiResponse - */ - -@JsonTypeName("ApiResponse") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelApiResponse { - - @JsonProperty("code") - private Integer code; - - @JsonProperty("type") - private String type; - - @JsonProperty("message") - private String message; - - public ModelApiResponse code(Integer code) { - this.code = code; - return this; - } - - /** - * Get code - * @return code - */ - - @Schema(name = "code", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getCode() { - return code; - } - - public void setCode(Integer code) { - this.code = code; - } - - public ModelApiResponse type(String type) { - this.type = type; - return this; - } - - /** - * Get type - * @return type - */ - - @Schema(name = "type", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public ModelApiResponse message(String message) { - this.message = message; - return this; - } - - /** - * Get message - * @return message - */ - - @Schema(name = "message", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMessage() { - return message; - } - - public void setMessage(String message) { - this.message = message; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelApiResponse _apiResponse = (ModelApiResponse) o; - return Objects.equals(this.code, _apiResponse.code) && - Objects.equals(this.type, _apiResponse.type) && - Objects.equals(this.message, _apiResponse.message); - } - - @Override - public int hashCode() { - return Objects.hash(code, type, message); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelApiResponse {\n"); - sb.append(" code: ").append(toIndentedString(code)).append("\n"); - sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" message: ").append(toIndentedString(message)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java deleted file mode 100644 index de11d272cc3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelFile.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; - -/** - * Must be named `File` for test. - */ -@Schema(name = "File",description = "Must be named `File` for test.") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelFile { - @JsonProperty("sourceURI") - private String sourceURI; - - public ModelFile sourceURI(String sourceURI) { - this.sourceURI = sourceURI; - return this; - } - - /** - * Test capitalization - * @return sourceURI - */ - @Schema(name = "sourceURI", defaultValue = "Test capitalization") - - - public String getSourceURI() { - return sourceURI; - } - - public void setSourceURI(String sourceURI) { - this.sourceURI = sourceURI; - } - - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelFile _file = (ModelFile) o; - return Objects.equals(this.sourceURI, _file.sourceURI); - } - - @Override - public int hashCode() { - return Objects.hash(sourceURI); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelFile {\n"); - - sb.append(" sourceURI: ").append(toIndentedString(sourceURI)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java deleted file mode 100644 index f168748f6a2..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelList.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ModelList - */ - -@JsonTypeName("List") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelList { - - @JsonProperty("123-list") - private String _123list; - - public ModelList _123list(String _123list) { - this._123list = _123list; - return this; - } - - /** - * Get _123list - * @return _123list - */ - - @Schema(name = "123-list", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String get123list() { - return _123list; - } - - public void set123list(String _123list) { - this._123list = _123list; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelList _list = (ModelList) o; - return Objects.equals(this._123list, _list._123list); - } - - @Override - public int hashCode() { - return Objects.hash(_123list); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelList {\n"); - sb.append(" _123list: ").append(toIndentedString(_123list)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java deleted file mode 100644 index 641c56cd81c..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ModelReturn.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing reserved words - */ - -@Schema(name = "Return", description = "Model for testing reserved words") -@JsonTypeName("Return") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ModelReturn { - - @JsonProperty("return") - private Integer _return; - - public ModelReturn _return(Integer _return) { - this._return = _return; - return this; - } - - /** - * Get _return - * @return _return - */ - - @Schema(name = "return", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getReturn() { - return _return; - } - - public void setReturn(Integer _return) { - this._return = _return; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ModelReturn _return = (ModelReturn) o; - return Objects.equals(this._return, _return._return); - } - - @Override - public int hashCode() { - return Objects.hash(_return); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ModelReturn {\n"); - sb.append(" _return: ").append(toIndentedString(_return)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java deleted file mode 100644 index d6dcb665651..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Name.java +++ /dev/null @@ -1,172 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Model for testing model name same as property name - */ - -@Schema(name = "Name", description = "Model for testing model name same as property name") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Name { - - @JsonProperty("name") - private Integer name; - - @JsonProperty("snake_case") - private Integer snakeCase; - - @JsonProperty("property") - private String property; - - @JsonProperty("123Number") - private Integer _123number; - - /** - * Default constructor - * @deprecated Use {@link Name#Name(Integer)} - */ - @Deprecated - public Name() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Name(Integer name) { - this.name = name; - } - - public Name name(Integer name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getName() { - return name; - } - - public void setName(Integer name) { - this.name = name; - } - - public Name snakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - return this; - } - - /** - * Get snakeCase - * @return snakeCase - */ - - @Schema(name = "snake_case", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getSnakeCase() { - return snakeCase; - } - - public void setSnakeCase(Integer snakeCase) { - this.snakeCase = snakeCase; - } - - public Name property(String property) { - this.property = property; - return this; - } - - /** - * Get property - * @return property - */ - - @Schema(name = "property", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getProperty() { - return property; - } - - public void setProperty(String property) { - this.property = property; - } - - public Name _123number(Integer _123number) { - this._123number = _123number; - return this; - } - - /** - * Get _123number - * @return _123number - */ - - @Schema(name = "123Number", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer get123number() { - return _123number; - } - - public void set123number(Integer _123number) { - this._123number = _123number; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Name name = (Name) o; - return Objects.equals(this.name, name.name) && - Objects.equals(this.snakeCase, name.snakeCase) && - Objects.equals(this.property, name.property) && - Objects.equals(this._123number, name._123number); - } - - @Override - public int hashCode() { - return Objects.hash(name, snakeCase, property, _123number); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Name {\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" snakeCase: ").append(toIndentedString(snakeCase)).append("\n"); - sb.append(" property: ").append(toIndentedString(property)).append("\n"); - sb.append(" _123number: ").append(toIndentedString(_123number)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java deleted file mode 100644 index 4a3b6beffa2..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/NumberOnly.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * NumberOnly - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class NumberOnly { - - @JsonProperty("JustNumber") - private BigDecimal justNumber; - - public NumberOnly justNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - return this; - } - - /** - * Get justNumber - * @return justNumber - */ - @Valid - @Schema(name = "JustNumber", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getJustNumber() { - return justNumber; - } - - public void setJustNumber(BigDecimal justNumber) { - this.justNumber = justNumber; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - NumberOnly numberOnly = (NumberOnly) o; - return Objects.equals(this.justNumber, numberOnly.justNumber); - } - - @Override - public int hashCode() { - return Objects.hash(justNumber); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class NumberOnly {\n"); - sb.append(" justNumber: ").append(toIndentedString(justNumber)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java deleted file mode 100644 index 9a5b61bad43..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Order.java +++ /dev/null @@ -1,244 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import java.time.OffsetDateTime; -import org.springframework.format.annotation.DateTimeFormat; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Order - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Order { - - @JsonProperty("id") - private Long id; - - @JsonProperty("petId") - private Long petId; - - @JsonProperty("quantity") - private Integer quantity; - - @JsonProperty("shipDate") - @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) - private OffsetDateTime shipDate; - - /** - * Order Status - */ - public enum StatusEnum { - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - @JsonProperty("complete") - private Boolean complete = false; - - public Order id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Order petId(Long petId) { - this.petId = petId; - return this; - } - - /** - * Get petId - * @return petId - */ - - @Schema(name = "petId", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getPetId() { - return petId; - } - - public void setPetId(Long petId) { - this.petId = petId; - } - - public Order quantity(Integer quantity) { - this.quantity = quantity; - return this; - } - - /** - * Get quantity - * @return quantity - */ - - @Schema(name = "quantity", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getQuantity() { - return quantity; - } - - public void setQuantity(Integer quantity) { - this.quantity = quantity; - } - - public Order shipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - return this; - } - - /** - * Get shipDate - * @return shipDate - */ - @Valid - @Schema(name = "shipDate", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public OffsetDateTime getShipDate() { - return shipDate; - } - - public void setShipDate(OffsetDateTime shipDate) { - this.shipDate = shipDate; - } - - public Order status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * Order Status - * @return status - */ - - @Schema(name = "status", description = "Order Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - public Order complete(Boolean complete) { - this.complete = complete; - return this; - } - - /** - * Get complete - * @return complete - */ - - @Schema(name = "complete", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getComplete() { - return complete; - } - - public void setComplete(Boolean complete) { - this.complete = complete; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Order order = (Order) o; - return Objects.equals(this.id, order.id) && - Objects.equals(this.petId, order.petId) && - Objects.equals(this.quantity, order.quantity) && - Objects.equals(this.shipDate, order.shipDate) && - Objects.equals(this.status, order.status) && - Objects.equals(this.complete, order.complete); - } - - @Override - public int hashCode() { - return Objects.hash(id, petId, quantity, shipDate, status, complete); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Order {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" petId: ").append(toIndentedString(petId)).append("\n"); - sb.append(" quantity: ").append(toIndentedString(quantity)).append("\n"); - sb.append(" shipDate: ").append(toIndentedString(shipDate)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append(" complete: ").append(toIndentedString(complete)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java deleted file mode 100644 index b66d6d38afb..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterComposite.java +++ /dev/null @@ -1,132 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * OuterComposite - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class OuterComposite { - - @JsonProperty("my_number") - private BigDecimal myNumber; - - @JsonProperty("my_string") - private String myString; - - @JsonProperty("my_boolean") - private Boolean myBoolean; - - public OuterComposite myNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - return this; - } - - /** - * Get myNumber - * @return myNumber - */ - @Valid - @Schema(name = "my_number", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getMyNumber() { - return myNumber; - } - - public void setMyNumber(BigDecimal myNumber) { - this.myNumber = myNumber; - } - - public OuterComposite myString(String myString) { - this.myString = myString; - return this; - } - - /** - * Get myString - * @return myString - */ - - @Schema(name = "my_string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getMyString() { - return myString; - } - - public void setMyString(String myString) { - this.myString = myString; - } - - public OuterComposite myBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - return this; - } - - /** - * Get myBoolean - * @return myBoolean - */ - - @Schema(name = "my_boolean", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getMyBoolean() { - return myBoolean; - } - - public void setMyBoolean(Boolean myBoolean) { - this.myBoolean = myBoolean; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - OuterComposite outerComposite = (OuterComposite) o; - return Objects.equals(this.myNumber, outerComposite.myNumber) && - Objects.equals(this.myString, outerComposite.myString) && - Objects.equals(this.myBoolean, outerComposite.myBoolean); - } - - @Override - public int hashCode() { - return Objects.hash(myNumber, myString, myBoolean); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OuterComposite {\n"); - sb.append(" myNumber: ").append(toIndentedString(myNumber)).append("\n"); - sb.append(" myString: ").append(toIndentedString(myString)).append("\n"); - sb.append(" myBoolean: ").append(toIndentedString(myBoolean)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java deleted file mode 100644 index 7fdf6f47de3..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/OuterEnum.java +++ /dev/null @@ -1,58 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonValue; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** - * Gets or Sets OuterEnum - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public enum OuterEnum { - - PLACED("placed"), - - APPROVED("approved"), - - DELIVERED("delivered"); - - private String value; - - OuterEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static OuterEnum fromValue(String value) { - for (OuterEnum b : OuterEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java deleted file mode 100644 index 6adaaba97d7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ /dev/null @@ -1,281 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.annotation.JsonDeserialize; -import java.util.ArrayList; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Set; -import org.openapitools.model.Category; -import org.openapitools.model.Tag; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Pet - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Pet { - - @JsonProperty("id") - private Long id; - - @JsonProperty("category") - private Category category; - - @JsonProperty("name") - private String name; - - @JsonProperty("photoUrls") - @Valid - private Set photoUrls = new LinkedHashSet<>(); - - @JsonProperty("tags") - @Valid - private List<@Valid Tag> tags = null; - - /** - * pet status in the store - */ - public enum StatusEnum { - AVAILABLE("available"), - - PENDING("pending"), - - SOLD("sold"); - - private String value; - - StatusEnum(String value) { - this.value = value; - } - - @JsonValue - public String getValue() { - return value; - } - - @Override - public String toString() { - return String.valueOf(value); - } - - @JsonCreator - public static StatusEnum fromValue(String value) { - for (StatusEnum b : StatusEnum.values()) { - if (b.value.equals(value)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); - } - } - - @JsonProperty("status") - private StatusEnum status; - - /** - * Default constructor - * @deprecated Use {@link Pet#Pet(String, Set)} - */ - @Deprecated - public Pet() { - super(); - } - - /** - * Constructor with only required parameters - */ - public Pet(String name, Set photoUrls) { - this.name = name; - this.photoUrls = photoUrls; - } - - public Pet id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Pet category(Category category) { - this.category = category; - return this; - } - - /** - * Get category - * @return category - */ - @Valid - @Schema(name = "category", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Category getCategory() { - return category; - } - - public void setCategory(Category category) { - this.category = category; - } - - public Pet name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - @NotNull - @Schema(name = "name", example = "doggie", requiredMode = Schema.RequiredMode.REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public Pet photoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - return this; - } - - public Pet addPhotoUrlsItem(String photoUrlsItem) { - this.photoUrls.add(photoUrlsItem); - return this; - } - - /** - * Get photoUrls - * @return photoUrls - */ - @NotNull - @Schema(name = "photoUrls", requiredMode = Schema.RequiredMode.REQUIRED) - public Set getPhotoUrls() { - return photoUrls; - } - - @JsonDeserialize(as = LinkedHashSet.class) - public void setPhotoUrls(Set photoUrls) { - this.photoUrls = photoUrls; - } - - public Pet tags(List<@Valid Tag> tags) { - this.tags = tags; - return this; - } - - public Pet addTagsItem(Tag tagsItem) { - if (this.tags == null) { - this.tags = new ArrayList<>(); - } - this.tags.add(tagsItem); - return this; - } - - /** - * Get tags - * @return tags - */ - @Valid - @Schema(name = "tags", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List<@Valid Tag> getTags() { - return tags; - } - - public void setTags(List<@Valid Tag> tags) { - this.tags = tags; - } - - public Pet status(StatusEnum status) { - this.status = status; - return this; - } - - /** - * pet status in the store - * @return status - */ - - @Schema(name = "status", description = "pet status in the store", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public StatusEnum getStatus() { - return status; - } - - public void setStatus(StatusEnum status) { - this.status = status; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Pet pet = (Pet) o; - return Objects.equals(this.id, pet.id) && - Objects.equals(this.category, pet.category) && - Objects.equals(this.name, pet.name) && - Objects.equals(this.photoUrls, pet.photoUrls) && - Objects.equals(this.tags, pet.tags) && - Objects.equals(this.status, pet.status); - } - - @Override - public int hashCode() { - return Objects.hash(id, category, name, photoUrls, tags, status); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Pet {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" category: ").append(toIndentedString(category)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append(" photoUrls: ").append(toIndentedString(photoUrls)).append("\n"); - sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); - sb.append(" status: ").append(toIndentedString(status)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java deleted file mode 100644 index 8c43e7e8c30..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ReadOnlyFirst.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * ReadOnlyFirst - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class ReadOnlyFirst { - - @JsonProperty("bar") - private String bar; - - @JsonProperty("baz") - private String baz; - - public ReadOnlyFirst bar(String bar) { - this.bar = bar; - return this; - } - - /** - * Get bar - * @return bar - */ - - @Schema(name = "bar", accessMode = Schema.AccessMode.READ_ONLY, requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBar() { - return bar; - } - - public void setBar(String bar) { - this.bar = bar; - } - - public ReadOnlyFirst baz(String baz) { - this.baz = baz; - return this; - } - - /** - * Get baz - * @return baz - */ - - @Schema(name = "baz", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getBaz() { - return baz; - } - - public void setBaz(String baz) { - this.baz = baz; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - ReadOnlyFirst readOnlyFirst = (ReadOnlyFirst) o; - return Objects.equals(this.bar, readOnlyFirst.bar) && - Objects.equals(this.baz, readOnlyFirst.baz); - } - - @Override - public int hashCode() { - return Objects.hash(bar, baz); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class ReadOnlyFirst {\n"); - sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); - sb.append(" baz: ").append(toIndentedString(baz)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java deleted file mode 100644 index c3d3aa9182e..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ /dev/null @@ -1,85 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * SpecialModelName - */ - -@JsonTypeName("$special[model.name]") -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class SpecialModelName { - - @JsonProperty("$special[property.name]") - private Long $specialPropertyName; - - public SpecialModelName $specialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - return this; - } - - /** - * Get $specialPropertyName - * @return $specialPropertyName - */ - - @Schema(name = "$special[property.name]", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long get$SpecialPropertyName() { - return $specialPropertyName; - } - - public void set$SpecialPropertyName(Long $specialPropertyName) { - this.$specialPropertyName = $specialPropertyName; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); - } - - @Override - public int hashCode() { - return Objects.hash($specialPropertyName); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class SpecialModelName {\n"); - sb.append(" $specialPropertyName: ").append(toIndentedString($specialPropertyName)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java deleted file mode 100644 index 03d5607e29b..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Tag.java +++ /dev/null @@ -1,107 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * Tag - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class Tag { - - @JsonProperty("id") - private Long id; - - @JsonProperty("name") - private String name; - - public Tag id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public Tag name(String name) { - this.name = name; - return this; - } - - /** - * Get name - * @return name - */ - - @Schema(name = "name", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - Tag tag = (Tag) o; - return Objects.equals(this.id, tag.id) && - Objects.equals(this.name, tag.name); - } - - @Override - public int hashCode() { - return Objects.hash(id, name); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class Tag {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index 67ef036857d..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,208 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderDefault - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderDefault { - - @JsonProperty("string_item") - private String stringItem = "what"; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem = true; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderDefault#TypeHolderDefault(String, BigDecimal, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderDefault() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderDefault(String stringItem, BigDecimal numberItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", requiredMode = Schema.RequiredMode.REQUIRED) - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @Schema(name = "number_item", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @Schema(name = "integer_item", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @Schema(name = "bool_item", requiredMode = Schema.RequiredMode.REQUIRED) - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderDefault typeHolderDefault = (TypeHolderDefault) o; - return Objects.equals(this.stringItem, typeHolderDefault.stringItem) && - Objects.equals(this.numberItem, typeHolderDefault.numberItem) && - Objects.equals(this.integerItem, typeHolderDefault.integerItem) && - Objects.equals(this.boolItem, typeHolderDefault.boolItem) && - Objects.equals(this.arrayItem, typeHolderDefault.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderDefault {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 5b77bee14c1..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,233 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * TypeHolderExample - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class TypeHolderExample { - - @JsonProperty("string_item") - private String stringItem; - - @JsonProperty("number_item") - private BigDecimal numberItem; - - @JsonProperty("float_item") - private Float floatItem; - - @JsonProperty("integer_item") - private Integer integerItem; - - @JsonProperty("bool_item") - private Boolean boolItem; - - @JsonProperty("array_item") - @Valid - private List arrayItem = new ArrayList<>(); - - /** - * Default constructor - * @deprecated Use {@link TypeHolderExample#TypeHolderExample(String, BigDecimal, Float, Integer, Boolean, List)} - */ - @Deprecated - public TypeHolderExample() { - super(); - } - - /** - * Constructor with only required parameters - */ - public TypeHolderExample(String stringItem, BigDecimal numberItem, Float floatItem, Integer integerItem, Boolean boolItem, List arrayItem) { - this.stringItem = stringItem; - this.numberItem = numberItem; - this.floatItem = floatItem; - this.integerItem = integerItem; - this.boolItem = boolItem; - this.arrayItem = arrayItem; - } - - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - /** - * Get stringItem - * @return stringItem - */ - @NotNull - @Schema(name = "string_item", example = "what", requiredMode = Schema.RequiredMode.REQUIRED) - public String getStringItem() { - return stringItem; - } - - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - /** - * Get numberItem - * @return numberItem - */ - @NotNull @Valid - @Schema(name = "number_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - public BigDecimal getNumberItem() { - return numberItem; - } - - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - /** - * Get floatItem - * @return floatItem - */ - @NotNull - @Schema(name = "float_item", example = "1.234", requiredMode = Schema.RequiredMode.REQUIRED) - public Float getFloatItem() { - return floatItem; - } - - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - /** - * Get integerItem - * @return integerItem - */ - @NotNull - @Schema(name = "integer_item", example = "-2", requiredMode = Schema.RequiredMode.REQUIRED) - public Integer getIntegerItem() { - return integerItem; - } - - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - /** - * Get boolItem - * @return boolItem - */ - @NotNull - @Schema(name = "bool_item", example = "true", requiredMode = Schema.RequiredMode.REQUIRED) - public Boolean getBoolItem() { - return boolItem; - } - - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - this.arrayItem.add(arrayItemItem); - return this; - } - - /** - * Get arrayItem - * @return arrayItem - */ - @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) - public List getArrayItem() { - return arrayItem; - } - - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - TypeHolderExample typeHolderExample = (TypeHolderExample) o; - return Objects.equals(this.stringItem, typeHolderExample.stringItem) && - Objects.equals(this.numberItem, typeHolderExample.numberItem) && - Objects.equals(this.floatItem, typeHolderExample.floatItem) && - Objects.equals(this.integerItem, typeHolderExample.integerItem) && - Objects.equals(this.boolItem, typeHolderExample.boolItem) && - Objects.equals(this.arrayItem, typeHolderExample.arrayItem); - } - - @Override - public int hashCode() { - return Objects.hash(stringItem, numberItem, floatItem, integerItem, boolItem, arrayItem); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class TypeHolderExample {\n"); - sb.append(" stringItem: ").append(toIndentedString(stringItem)).append("\n"); - sb.append(" numberItem: ").append(toIndentedString(numberItem)).append("\n"); - sb.append(" floatItem: ").append(toIndentedString(floatItem)).append("\n"); - sb.append(" integerItem: ").append(toIndentedString(integerItem)).append("\n"); - sb.append(" boolItem: ").append(toIndentedString(boolItem)).append("\n"); - sb.append(" arrayItem: ").append(toIndentedString(arrayItem)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java deleted file mode 100644 index e09df9be7b7..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/User.java +++ /dev/null @@ -1,251 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * User - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class User { - - @JsonProperty("id") - private Long id; - - @JsonProperty("username") - private String username; - - @JsonProperty("firstName") - private String firstName; - - @JsonProperty("lastName") - private String lastName; - - @JsonProperty("email") - private String email; - - @JsonProperty("password") - private String password; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("userStatus") - private Integer userStatus; - - public User id(Long id) { - this.id = id; - return this; - } - - /** - * Get id - * @return id - */ - - @Schema(name = "id", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public User username(String username) { - this.username = username; - return this; - } - - /** - * Get username - * @return username - */ - - @Schema(name = "username", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - public User firstName(String firstName) { - this.firstName = firstName; - return this; - } - - /** - * Get firstName - * @return firstName - */ - - @Schema(name = "firstName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getFirstName() { - return firstName; - } - - public void setFirstName(String firstName) { - this.firstName = firstName; - } - - public User lastName(String lastName) { - this.lastName = lastName; - return this; - } - - /** - * Get lastName - * @return lastName - */ - - @Schema(name = "lastName", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getLastName() { - return lastName; - } - - public void setLastName(String lastName) { - this.lastName = lastName; - } - - public User email(String email) { - this.email = email; - return this; - } - - /** - * Get email - * @return email - */ - - @Schema(name = "email", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getEmail() { - return email; - } - - public void setEmail(String email) { - this.email = email; - } - - public User password(String password) { - this.password = password; - return this; - } - - /** - * Get password - * @return password - */ - - @Schema(name = "password", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - public User phone(String phone) { - this.phone = phone; - return this; - } - - /** - * Get phone - * @return phone - */ - - @Schema(name = "phone", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - public User userStatus(Integer userStatus) { - this.userStatus = userStatus; - return this; - } - - /** - * User Status - * @return userStatus - */ - - @Schema(name = "userStatus", description = "User Status", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus = userStatus; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - User user = (User) o; - return Objects.equals(this.id, user.id) && - Objects.equals(this.username, user.username) && - Objects.equals(this.firstName, user.firstName) && - Objects.equals(this.lastName, user.lastName) && - Objects.equals(this.email, user.email) && - Objects.equals(this.password, user.password) && - Objects.equals(this.phone, user.phone) && - Objects.equals(this.userStatus, user.userStatus); - } - - @Override - public int hashCode() { - return Objects.hash(id, username, firstName, lastName, email, password, phone, userStatus); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class User {\n"); - sb.append(" id: ").append(toIndentedString(id)).append("\n"); - sb.append(" username: ").append(toIndentedString(username)).append("\n"); - sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n"); - sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n"); - sb.append(" email: ").append(toIndentedString(email)).append("\n"); - sb.append(" password: ").append(toIndentedString(password)).append("\n"); - sb.append(" phone: ").append(toIndentedString(phone)).append("\n"); - sb.append(" userStatus: ").append(toIndentedString(userStatus)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 1a4455cdaa8..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,839 +0,0 @@ -package org.openapitools.model; - -import java.net.URI; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.List; -import org.openapitools.jackson.nullable.JsonNullable; -import java.time.OffsetDateTime; -import javax.validation.Valid; -import javax.validation.constraints.*; -import io.swagger.v3.oas.annotations.media.Schema; - - -import java.util.*; -import javax.annotation.Generated; - -/** - * XmlItem - */ - -@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") -public class XmlItem { - - @JsonProperty("attribute_string") - private String attributeString; - - @JsonProperty("attribute_number") - private BigDecimal attributeNumber; - - @JsonProperty("attribute_integer") - private Integer attributeInteger; - - @JsonProperty("attribute_boolean") - private Boolean attributeBoolean; - - @JsonProperty("wrapped_array") - @Valid - private List wrappedArray = null; - - @JsonProperty("name_string") - private String nameString; - - @JsonProperty("name_number") - private BigDecimal nameNumber; - - @JsonProperty("name_integer") - private Integer nameInteger; - - @JsonProperty("name_boolean") - private Boolean nameBoolean; - - @JsonProperty("name_array") - @Valid - private List nameArray = null; - - @JsonProperty("name_wrapped_array") - @Valid - private List nameWrappedArray = null; - - @JsonProperty("prefix_string") - private String prefixString; - - @JsonProperty("prefix_number") - private BigDecimal prefixNumber; - - @JsonProperty("prefix_integer") - private Integer prefixInteger; - - @JsonProperty("prefix_boolean") - private Boolean prefixBoolean; - - @JsonProperty("prefix_array") - @Valid - private List prefixArray = null; - - @JsonProperty("prefix_wrapped_array") - @Valid - private List prefixWrappedArray = null; - - @JsonProperty("namespace_string") - private String namespaceString; - - @JsonProperty("namespace_number") - private BigDecimal namespaceNumber; - - @JsonProperty("namespace_integer") - private Integer namespaceInteger; - - @JsonProperty("namespace_boolean") - private Boolean namespaceBoolean; - - @JsonProperty("namespace_array") - @Valid - private List namespaceArray = null; - - @JsonProperty("namespace_wrapped_array") - @Valid - private List namespaceWrappedArray = null; - - @JsonProperty("prefix_ns_string") - private String prefixNsString; - - @JsonProperty("prefix_ns_number") - private BigDecimal prefixNsNumber; - - @JsonProperty("prefix_ns_integer") - private Integer prefixNsInteger; - - @JsonProperty("prefix_ns_boolean") - private Boolean prefixNsBoolean; - - @JsonProperty("prefix_ns_array") - @Valid - private List prefixNsArray = null; - - @JsonProperty("prefix_ns_wrapped_array") - @Valid - private List prefixNsWrappedArray = null; - - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - /** - * Get attributeString - * @return attributeString - */ - - @Schema(name = "attribute_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getAttributeString() { - return attributeString; - } - - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - /** - * Get attributeNumber - * @return attributeNumber - */ - @Valid - @Schema(name = "attribute_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - /** - * Get attributeInteger - * @return attributeInteger - */ - - @Schema(name = "attribute_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getAttributeInteger() { - return attributeInteger; - } - - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - /** - * Get attributeBoolean - * @return attributeBoolean - */ - - @Schema(name = "attribute_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - /** - * Get wrappedArray - * @return wrappedArray - */ - - @Schema(name = "wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getWrappedArray() { - return wrappedArray; - } - - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - /** - * Get nameString - * @return nameString - */ - - @Schema(name = "name_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getNameString() { - return nameString; - } - - public void setNameString(String nameString) { - this.nameString = nameString; - } - - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - /** - * Get nameNumber - * @return nameNumber - */ - @Valid - @Schema(name = "name_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getNameNumber() { - return nameNumber; - } - - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - /** - * Get nameInteger - * @return nameInteger - */ - - @Schema(name = "name_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getNameInteger() { - return nameInteger; - } - - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - /** - * Get nameBoolean - * @return nameBoolean - */ - - @Schema(name = "name_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getNameBoolean() { - return nameBoolean; - } - - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - this.nameArray.add(nameArrayItem); - return this; - } - - /** - * Get nameArray - * @return nameArray - */ - - @Schema(name = "name_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNameArray() { - return nameArray; - } - - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - /** - * Get nameWrappedArray - * @return nameWrappedArray - */ - - @Schema(name = "name_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNameWrappedArray() { - return nameWrappedArray; - } - - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - /** - * Get prefixString - * @return prefixString - */ - - @Schema(name = "prefix_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPrefixString() { - return prefixString; - } - - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - /** - * Get prefixNumber - * @return prefixNumber - */ - @Valid - @Schema(name = "prefix_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - /** - * Get prefixInteger - * @return prefixInteger - */ - - @Schema(name = "prefix_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getPrefixInteger() { - return prefixInteger; - } - - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - /** - * Get prefixBoolean - * @return prefixBoolean - */ - - @Schema(name = "prefix_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - this.prefixArray.add(prefixArrayItem); - return this; - } - - /** - * Get prefixArray - * @return prefixArray - */ - - @Schema(name = "prefix_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixArray() { - return prefixArray; - } - - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - /** - * Get prefixWrappedArray - * @return prefixWrappedArray - */ - - @Schema(name = "prefix_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - /** - * Get namespaceString - * @return namespaceString - */ - - @Schema(name = "namespace_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getNamespaceString() { - return namespaceString; - } - - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - /** - * Get namespaceNumber - * @return namespaceNumber - */ - @Valid - @Schema(name = "namespace_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - /** - * Get namespaceInteger - * @return namespaceInteger - */ - - @Schema(name = "namespace_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - /** - * Get namespaceBoolean - * @return namespaceBoolean - */ - - @Schema(name = "namespace_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - /** - * Get namespaceArray - * @return namespaceArray - */ - - @Schema(name = "namespace_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNamespaceArray() { - return namespaceArray; - } - - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - /** - * Get namespaceWrappedArray - * @return namespaceWrappedArray - */ - - @Schema(name = "namespace_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - /** - * Get prefixNsString - * @return prefixNsString - */ - - @Schema(name = "prefix_ns_string", example = "string", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public String getPrefixNsString() { - return prefixNsString; - } - - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - /** - * Get prefixNsNumber - * @return prefixNsNumber - */ - @Valid - @Schema(name = "prefix_ns_number", example = "1.234", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - /** - * Get prefixNsInteger - * @return prefixNsInteger - */ - - @Schema(name = "prefix_ns_integer", example = "-2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - /** - * Get prefixNsBoolean - * @return prefixNsBoolean - */ - - @Schema(name = "prefix_ns_boolean", example = "true", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - /** - * Get prefixNsArray - * @return prefixNsArray - */ - - @Schema(name = "prefix_ns_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsArray() { - return prefixNsArray; - } - - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - /** - * Get prefixNsWrappedArray - * @return prefixNsWrappedArray - */ - - @Schema(name = "prefix_ns_wrapped_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - XmlItem xmlItem = (XmlItem) o; - return Objects.equals(this.attributeString, xmlItem.attributeString) && - Objects.equals(this.attributeNumber, xmlItem.attributeNumber) && - Objects.equals(this.attributeInteger, xmlItem.attributeInteger) && - Objects.equals(this.attributeBoolean, xmlItem.attributeBoolean) && - Objects.equals(this.wrappedArray, xmlItem.wrappedArray) && - Objects.equals(this.nameString, xmlItem.nameString) && - Objects.equals(this.nameNumber, xmlItem.nameNumber) && - Objects.equals(this.nameInteger, xmlItem.nameInteger) && - Objects.equals(this.nameBoolean, xmlItem.nameBoolean) && - Objects.equals(this.nameArray, xmlItem.nameArray) && - Objects.equals(this.nameWrappedArray, xmlItem.nameWrappedArray) && - Objects.equals(this.prefixString, xmlItem.prefixString) && - Objects.equals(this.prefixNumber, xmlItem.prefixNumber) && - Objects.equals(this.prefixInteger, xmlItem.prefixInteger) && - Objects.equals(this.prefixBoolean, xmlItem.prefixBoolean) && - Objects.equals(this.prefixArray, xmlItem.prefixArray) && - Objects.equals(this.prefixWrappedArray, xmlItem.prefixWrappedArray) && - Objects.equals(this.namespaceString, xmlItem.namespaceString) && - Objects.equals(this.namespaceNumber, xmlItem.namespaceNumber) && - Objects.equals(this.namespaceInteger, xmlItem.namespaceInteger) && - Objects.equals(this.namespaceBoolean, xmlItem.namespaceBoolean) && - Objects.equals(this.namespaceArray, xmlItem.namespaceArray) && - Objects.equals(this.namespaceWrappedArray, xmlItem.namespaceWrappedArray) && - Objects.equals(this.prefixNsString, xmlItem.prefixNsString) && - Objects.equals(this.prefixNsNumber, xmlItem.prefixNsNumber) && - Objects.equals(this.prefixNsInteger, xmlItem.prefixNsInteger) && - Objects.equals(this.prefixNsBoolean, xmlItem.prefixNsBoolean) && - Objects.equals(this.prefixNsArray, xmlItem.prefixNsArray) && - Objects.equals(this.prefixNsWrappedArray, xmlItem.prefixNsWrappedArray); - } - - @Override - public int hashCode() { - return Objects.hash(attributeString, attributeNumber, attributeInteger, attributeBoolean, wrappedArray, nameString, nameNumber, nameInteger, nameBoolean, nameArray, nameWrappedArray, prefixString, prefixNumber, prefixInteger, prefixBoolean, prefixArray, prefixWrappedArray, namespaceString, namespaceNumber, namespaceInteger, namespaceBoolean, namespaceArray, namespaceWrappedArray, prefixNsString, prefixNsNumber, prefixNsInteger, prefixNsBoolean, prefixNsArray, prefixNsWrappedArray); - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class XmlItem {\n"); - sb.append(" attributeString: ").append(toIndentedString(attributeString)).append("\n"); - sb.append(" attributeNumber: ").append(toIndentedString(attributeNumber)).append("\n"); - sb.append(" attributeInteger: ").append(toIndentedString(attributeInteger)).append("\n"); - sb.append(" attributeBoolean: ").append(toIndentedString(attributeBoolean)).append("\n"); - sb.append(" wrappedArray: ").append(toIndentedString(wrappedArray)).append("\n"); - sb.append(" nameString: ").append(toIndentedString(nameString)).append("\n"); - sb.append(" nameNumber: ").append(toIndentedString(nameNumber)).append("\n"); - sb.append(" nameInteger: ").append(toIndentedString(nameInteger)).append("\n"); - sb.append(" nameBoolean: ").append(toIndentedString(nameBoolean)).append("\n"); - sb.append(" nameArray: ").append(toIndentedString(nameArray)).append("\n"); - sb.append(" nameWrappedArray: ").append(toIndentedString(nameWrappedArray)).append("\n"); - sb.append(" prefixString: ").append(toIndentedString(prefixString)).append("\n"); - sb.append(" prefixNumber: ").append(toIndentedString(prefixNumber)).append("\n"); - sb.append(" prefixInteger: ").append(toIndentedString(prefixInteger)).append("\n"); - sb.append(" prefixBoolean: ").append(toIndentedString(prefixBoolean)).append("\n"); - sb.append(" prefixArray: ").append(toIndentedString(prefixArray)).append("\n"); - sb.append(" prefixWrappedArray: ").append(toIndentedString(prefixWrappedArray)).append("\n"); - sb.append(" namespaceString: ").append(toIndentedString(namespaceString)).append("\n"); - sb.append(" namespaceNumber: ").append(toIndentedString(namespaceNumber)).append("\n"); - sb.append(" namespaceInteger: ").append(toIndentedString(namespaceInteger)).append("\n"); - sb.append(" namespaceBoolean: ").append(toIndentedString(namespaceBoolean)).append("\n"); - sb.append(" namespaceArray: ").append(toIndentedString(namespaceArray)).append("\n"); - sb.append(" namespaceWrappedArray: ").append(toIndentedString(namespaceWrappedArray)).append("\n"); - sb.append(" prefixNsString: ").append(toIndentedString(prefixNsString)).append("\n"); - sb.append(" prefixNsNumber: ").append(toIndentedString(prefixNsNumber)).append("\n"); - sb.append(" prefixNsInteger: ").append(toIndentedString(prefixNsInteger)).append("\n"); - sb.append(" prefixNsBoolean: ").append(toIndentedString(prefixNsBoolean)).append("\n"); - sb.append(" prefixNsArray: ").append(toIndentedString(prefixNsArray)).append("\n"); - sb.append(" prefixNsWrappedArray: ").append(toIndentedString(prefixNsWrappedArray)).append("\n"); - sb.append("}"); - return sb.toString(); - } - - /** - * Convert the given object to string with each line indented by 4 spaces - * (except the first line). - */ - private String toIndentedString(Object o) { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } -} - diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/application.properties b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/application.properties deleted file mode 100644 index 9d06609db66..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/application.properties +++ /dev/null @@ -1,3 +0,0 @@ -server.port=80 -spring.jackson.date-format=org.openapitools.RFC3339DateFormat -spring.jackson.serialization.WRITE_DATES_AS_TIMESTAMPS=false diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml deleted file mode 100644 index 658d8a96b30..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ /dev/null @@ -1,2285 +0,0 @@ -openapi: 3.0.1 -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: -- url: http://petstore.swagger.io:80/v2 -tags: -- description: Everything about your Pets - name: pet -- description: Access to Petstore orders - name: store -- description: Operations about user - name: user -paths: - /pet: - 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 - responses: - "200": - content: {} - description: successful operation - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Add a new pet to the store - tags: - - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet - 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 - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Pet not found - "405": - content: {} - description: Validation exception - security: - - petstore_auth: - - write:pets - - read:pets - summary: Update an existing pet - tags: - - pet - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: pet - /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": - content: {} - description: Invalid status value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by status - tags: - - pet - x-accepts: application/json - x-tags: - - tag: 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 - uniqueItems: true - style: form - responses: - "200": - content: - application/xml: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - application/json: - schema: - items: - $ref: '#/components/schemas/Pet' - type: array - uniqueItems: true - description: successful operation - "400": - content: {} - description: Invalid tag value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Finds Pets by tags - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}: - delete: - operationId: deletePet - parameters: - - in: header - name: api_key - schema: - type: string - - description: Pet id to delete - in: path - name: petId - required: true - schema: - format: int64 - type: integer - responses: - "200": - content: {} - description: successful operation - "400": - content: {} - description: Invalid pet value - security: - - petstore_auth: - - write:pets - - read:pets - summary: Deletes a pet - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - get: - description: Returns a single pet - operationId: getPetById - parameters: - - description: ID of pet to return - in: path - name: petId - required: true - schema: - format: int64 - type: integer - 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 - security: - - api_key: [] - summary: Find pet by ID - tags: - - pet - x-accepts: application/json - x-tags: - - tag: pet - post: - operationId: updatePetWithForm - parameters: - - description: ID of pet that needs to be updated - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/updatePetWithForm_request' - responses: - "405": - content: {} - description: Invalid input - security: - - petstore_auth: - - write:pets - - read:pets - summary: Updates a pet in the store with form data - tags: - - pet - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: pet - /pet/{petId}/uploadImage: - post: - operationId: uploadFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/uploadFile_request' - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/ApiResponse' - description: successful operation - security: - - petstore_auth: - - write:pets - - read:pets - summary: uploads an image - tags: - - pet - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: 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 - x-accepts: application/json - x-tags: - - tag: store - /store/order: - post: - operationId: placeOrder - requestBody: - content: - '*/*': - 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": - content: {} - description: Invalid Order - summary: Place an order for a pet - tags: - - store - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: 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 - in: path - name: order_id - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid ID supplied - "404": - content: {} - description: Order not found - summary: Delete purchase order by ID - tags: - - store - x-accepts: application/json - x-tags: - - tag: store - get: - description: For valid response try integer IDs with value <= 5 or > 10. Other - values will generate exceptions - operationId: getOrderById - parameters: - - description: ID of pet that needs to be fetched - in: path - name: order_id - required: true - schema: - format: int64 - maximum: 5 - minimum: 1 - type: integer - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/Order' - application/json: - schema: - $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: - - store - x-accepts: application/json - x-tags: - - tag: store - /user: - post: - description: This can only be done by the logged in user. - operationId: createUser - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Created user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Create user - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithArray: - post: - operationId: createUsersWithArrayInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/createWithList: - post: - operationId: createUsersWithListInput - requestBody: - content: - '*/*': - schema: - items: - $ref: '#/components/schemas/User' - type: array - description: List of user object - required: true - responses: - default: - content: {} - description: successful operation - summary: Creates list of users with given input array - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /user/login: - get: - operationId: loginUser - parameters: - - description: The user name for login - in: query - name: username - required: true - schema: - type: string - - description: The password for login in clear text - in: query - name: password - required: true - schema: - type: string - 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 - schema: - format: int32 - type: integer - X-Expires-After: - description: date in UTC when token expires - schema: - format: date-time - type: string - "400": - content: {} - description: Invalid username/password supplied - summary: Logs user into the system - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - /user/logout: - get: - operationId: logoutUser - responses: - default: - content: {} - description: successful operation - summary: Logs out current logged in user session - tags: - - user - x-accepts: application/json - x-tags: - - tag: 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 - in: path - name: username - required: true - schema: - type: string - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - summary: Delete user - tags: - - user - x-accepts: application/json - x-tags: - - tag: user - get: - operationId: getUserByName - parameters: - - description: The name that needs to be fetched. Use user1 for testing. - in: path - name: username - required: true - schema: - type: string - responses: - "200": - content: - application/xml: - schema: - $ref: '#/components/schemas/User' - application/json: - schema: - $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: - - user - x-accepts: application/json - x-tags: - - tag: user - put: - description: This can only be done by the logged in user. - operationId: updateUser - parameters: - - description: name that need to be deleted - in: path - name: username - required: true - schema: - type: string - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/User' - description: Updated user object - required: true - responses: - "400": - content: {} - description: Invalid user supplied - "404": - content: {} - description: User not found - summary: Updated user - tags: - - user - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: application/json - x-tags: - - tag: user - /fake_classname_test: - patch: - description: To test class name in snake case - operationId: testClassname - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - 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#$%^ - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake_classname_tags 123#$%^ - /fake: - delete: - description: Fake endpoint to test group parameters (optional) - operationId: testGroupParameters - parameters: - - description: Required String in group parameters - in: query - name: required_string_group - required: true - schema: - type: integer - - description: Required Boolean in group parameters - in: header - name: required_boolean_group - required: true - schema: - type: boolean - - description: Required Integer in group parameters - in: query - name: required_int64_group - required: true - schema: - format: int64 - type: integer - - description: String in group parameters - in: query - name: string_group - schema: - type: integer - - description: Boolean in group parameters - in: header - name: boolean_group - schema: - type: boolean - - description: Integer in group parameters - in: query - name: int64_group - schema: - format: int64 - type: integer - responses: - "400": - content: {} - description: Something wrong - summary: Fake endpoint to test group parameters (optional) - tags: - - fake - x-group-parameters: true - x-accepts: application/json - x-tags: - - tag: fake - 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 - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: simple - - description: Header parameter enum test (string) - in: header - name: enum_header_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (string array) - explode: false - in: query - name: enum_query_string_array - schema: - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - style: form - - description: Query parameter enum test (string) - in: query - name: enum_query_string - schema: - default: -efg - enum: - - _abc - - -efg - - (xyz) - type: string - - description: Query parameter enum test (double) - in: query - name: enum_query_integer - schema: - enum: - - 1 - - -2 - format: int32 - type: integer - - description: Query parameter enum test (double) - in: query - name: enum_query_double - schema: - enum: - - 1.1 - - -1.2 - format: double - type: number - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testEnumParameters_request' - responses: - "400": - content: {} - description: Invalid request - "404": - content: {} - description: Not found - summary: To test enum parameters - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - patch: - description: To test "client" model - operationId: testClientModel - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test "client" model - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - post: - description: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - operationId: testEndpointParameters - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testEndpointParameters_request' - required: true - responses: - "400": - content: {} - description: Invalid username supplied - "404": - content: {} - description: User not found - security: - - http_basic_test: [] - summary: |- - Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/outer/number: - post: - description: Test serialization of outer number types - operationId: fakeOuterNumberSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Input number as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterNumber' - description: Output number - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/string: - post: - description: Test serialization of outer string types - operationId: fakeOuterStringSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Input string as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterString' - description: Output string - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/boolean: - post: - description: Test serialization of outer boolean types - operationId: fakeOuterBooleanSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Input boolean as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterBoolean' - description: Output boolean - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/outer/composite: - post: - description: Test serialization of object with outer number type - operationId: fakeOuterCompositeSerialize - requestBody: - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Input composite as post body - required: false - responses: - "200": - content: - '*/*': - schema: - $ref: '#/components/schemas/OuterComposite' - description: Output composite - tags: - - fake - x-codegen-request-body-name: body - x-content-type: '*/*' - x-accepts: '*/*' - x-tags: - - tag: fake - /fake/jsonFormData: - get: - operationId: testJsonFormData - requestBody: - content: - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/testJsonFormData_request' - required: true - responses: - "200": - content: {} - description: successful operation - summary: test json serialization of form data - tags: - - fake - x-content-type: application/x-www-form-urlencoded - x-accepts: application/json - x-tags: - - tag: fake - /fake/inline-additionalProperties: - post: - operationId: testInlineAdditionalProperties - requestBody: - content: - application/json: - schema: - additionalProperties: - type: string - type: object - description: request body - required: true - responses: - "200": - content: {} - description: successful operation - summary: test inline additionalProperties - tags: - - fake - x-codegen-request-body-name: param - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/User' - required: true - responses: - "200": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/create_xml_item: - post: - description: this route creates an XmlItem - operationId: createXmlItem - requestBody: - content: - application/xml: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - application/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-8: - schema: - $ref: '#/components/schemas/XmlItem' - text/xml; charset=utf-16: - schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body - required: true - responses: - "200": - content: {} - description: successful operation - summary: creates an XmlItem - tags: - - fake - x-codegen-request-body-name: XmlItem - x-content-type: application/xml - x-accepts: application/json - x-tags: - - tag: fake - /another-fake/dummy: - patch: - description: To test special tags and operation ID starting with number - operationId: 123_test_@#$%_special_tags - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true - responses: - "200": - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: successful operation - summary: To test special tags - tags: - - $another-fake? - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: $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": - content: {} - description: Success - tags: - - fake - x-codegen-request-body-name: body - x-content-type: application/json - x-accepts: application/json - x-tags: - - tag: fake - /fake/test-query-parameters: - put: - description: To test the collection format in query parameters - operationId: testQueryParameterCollectionFormat - parameters: - - explode: false - in: query - name: pipe - required: true - schema: - items: - type: string - type: array - style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - 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": - content: {} - description: Success - tags: - - fake - x-accepts: application/json - x-tags: - - tag: fake - /fake/{petId}/uploadImageWithRequiredFile: - post: - operationId: uploadFileWithRequiredFile - parameters: - - description: ID of pet to update - in: path - name: petId - required: true - schema: - format: int64 - type: integer - requestBody: - content: - multipart/form-data: - schema: - $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true - 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 - x-content-type: multipart/form-data - x-accepts: application/json - x-tags: - - tag: pet -components: - schemas: - 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 - uniqueItems: true - 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 - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" - Return: - description: Model for testing reserved words - properties: - return: - format: int32 - type: integer - type: object - 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 - type: object - xml: - name: Name - "200_response": - description: Model for testing model name starting with number - properties: - name: - format: int32 - type: integer - class: - type: string - type: object - xml: - name: Name - ClassModel: - description: Model for testing model with "_class" property - properties: - _class: - type: string - type: object - Dog: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Dog_allOf' - Cat: - allOf: - - $ref: '#/components/schemas/Animal' - - $ref: '#/components/schemas/Cat_allOf' - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - $ref: '#/components/schemas/BigCat_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 - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" - 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 - BigDecimal: - format: number - 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' - required: - - enum_string_required - type: object - AdditionalPropertiesClass: - properties: - map_string: - additionalProperties: - type: string - type: object - map_number: - additionalProperties: - type: number - type: object - map_integer: - additionalProperties: - type: integer - type: object - map_boolean: - additionalProperties: - type: boolean - type: object - map_array_integer: - additionalProperties: - items: - type: integer - type: array - type: object - map_array_anytype: - additionalProperties: - items: - properties: {} - type: object - type: array - type: object - map_map_string: - additionalProperties: - additionalProperties: - type: string - type: object - type: object - map_map_anytype: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - type: object - anytype_1: - properties: {} - type: object - anytype_2: - type: object - anytype_3: - properties: {} - type: object - type: object - AdditionalPropertiesString: - additionalProperties: - type: string - properties: - name: - type: string - type: object - AdditionalPropertiesInteger: - additionalProperties: - type: integer - properties: - name: - type: string - type: object - AdditionalPropertiesNumber: - additionalProperties: - type: number - properties: - name: - type: string - type: object - AdditionalPropertiesBoolean: - additionalProperties: - type: boolean - properties: - name: - type: string - type: object - AdditionalPropertiesArray: - additionalProperties: - items: - properties: {} - type: object - type: array - properties: - name: - type: string - type: object - AdditionalPropertiesObject: - additionalProperties: - additionalProperties: - properties: {} - type: object - type: object - properties: - name: - type: string - type: object - AdditionalPropertiesAnyType: - additionalProperties: - properties: {} - type: object - properties: - name: - type: string - 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 - type: string - 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 - TypeHolderDefault: - properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: - type: integer - bool_item: - default: true - type: boolean - array_item: - items: - type: integer - type: array - required: - - array_item - - bool_item - - integer_item - - number_item - - string_item - type: object - TypeHolderExample: - properties: - string_item: - example: what - type: string - number_item: - example: 1.234 - type: number - float_item: - example: 1.234 - format: float - type: number - integer_item: - example: -2 - type: integer - bool_item: - example: true - type: boolean - array_item: - example: - - 0 - - 1 - - 2 - - 3 - items: - type: integer - type: array - required: - - array_item - - bool_item - - float_item - - integer_item - - number_item - - string_item - type: object - XmlItem: - properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 - type: integer - xml: - attribute: true - attribute_boolean: - example: true - type: boolean - xml: - attribute: true - wrapped_array: - items: - type: integer - type: array - xml: - wrapped: true - name_string: - example: string - type: string - xml: - name: xml_name_string - name_number: - example: 1.234 - type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true - type: boolean - xml: - name: xml_name_boolean - name_array: - items: - type: integer - xml: - name: xml_name_array_item - type: array - name_wrapped_array: - items: - type: integer - xml: - name: xml_name_wrapped_array_item - type: array - xml: - name: xml_name_wrapped_array - wrapped: true - prefix_string: - example: string - type: string - xml: - prefix: ab - prefix_number: - example: 1.234 - type: number - xml: - prefix: cd - prefix_integer: - example: -2 - type: integer - xml: - prefix: ef - prefix_boolean: - example: true - type: boolean - xml: - prefix: gh - prefix_array: - items: - type: integer - xml: - prefix: ij - type: array - prefix_wrapped_array: - items: - type: integer - xml: - prefix: mn - type: array - xml: - prefix: kl - wrapped: true - namespace_string: - example: string - type: string - xml: - namespace: http://a.com/schema - namespace_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - namespace_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - namespace_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - namespace_array: - items: - type: integer - xml: - namespace: http://e.com/schema - type: array - namespace_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string - type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 - type: number - xml: - namespace: http://b.com/schema - prefix: b - prefix_ns_integer: - example: -2 - type: integer - xml: - namespace: http://c.com/schema - prefix: c - prefix_ns_boolean: - example: true - type: boolean - xml: - namespace: http://d.com/schema - prefix: d - prefix_ns_array: - items: - type: integer - xml: - namespace: http://e.com/schema - prefix: e - type: array - prefix_ns_wrapped_array: - items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g - type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true - type: object - xml: - namespace: http://a.com/schema - prefix: pre - updatePetWithForm_request: - properties: - name: - description: Updated name of the pet - type: string - status: - description: Updated status of the pet - type: string - type: object - uploadFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - file: - description: file to upload - format: binary - type: string - type: object - testEnumParameters_request: - properties: - enum_form_string_array: - description: Form parameter enum test (string array) - items: - default: $ - enum: - - '>' - - $ - type: string - type: array - enum_form_string: - default: -efg - description: Form parameter enum test (string) - enum: - - _abc - - -efg - - (xyz) - type: string - type: object - testEndpointParameters_request: - properties: - integer: - description: None - format: int32 - 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 - testJsonFormData_request: - properties: - param: - description: field1 - type: string - param2: - description: field2 - type: string - required: - - param - - param2 - type: object - uploadFileWithRequiredFile_request: - properties: - additionalMetadata: - description: Additional data to pass to server - type: string - requiredFile: - description: file to upload - format: binary - type: string - required: - - requiredFile - type: object - Dog_allOf: - properties: - breed: - type: string - type: object - example: null - Cat_allOf: - properties: - declawed: - type: boolean - type: object - example: null - BigCat_allOf: - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object - example: null - 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 -x-original-swagger-version: "2.0" diff --git a/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java b/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java deleted file mode 100644 index 3681f67e770..00000000000 --- a/samples/openapi3/server/petstore/springboot-useoptional/src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java +++ /dev/null @@ -1,13 +0,0 @@ -package org.openapitools; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class OpenApiGeneratorApplicationTests { - - @Test - void contextLoads() { - } - -} \ No newline at end of file diff --git a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java index ad48ebd85eb..ce65ccc5025 100644 --- a/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java +++ b/samples/openapi3/server/petstore/springboot/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java index bcdc28b161b..204aebc64be 100644 --- a/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/java-camel/src/main/java/org/openapitools/model/Pet.java @@ -55,7 +55,7 @@ public class Pet { @JsonProperty("tags") @JacksonXmlProperty(localName = "tag") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -178,6 +178,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES index 8bf287f9b1f..18561f6ffff 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/.openapi-generator/FILES @@ -27,6 +27,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java index dca833f9ac9..0b3158a75f8 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -41,7 +41,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -62,7 +62,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java index 8223c6747c0..66dfa30d774 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeApi.java @@ -93,7 +93,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +105,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @Operation( @@ -120,10 +121,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) throws Exception; @@ -147,7 +149,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -174,7 +177,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -185,7 +189,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @Operation( @@ -202,7 +206,7 @@ public interface FakeApi { consumes = { "application/json" } ) ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) throws Exception; @@ -210,7 +214,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @Operation( @@ -227,7 +231,7 @@ public interface FakeApi { ) ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) throws Exception; @@ -235,7 +239,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -256,7 +260,7 @@ public interface FakeApi { consumes = { "application/json" } ) ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; @@ -396,13 +400,15 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -414,12 +420,13 @@ public interface FakeApi { consumes = { "application/json" } ) ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) throws Exception; /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -428,6 +435,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -449,7 +457,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -469,7 +476,6 @@ public interface FakeApi { ) ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context @@ -478,6 +484,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -487,6 +494,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 6a6991dc4c1..a2fcaf0975c 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -41,7 +41,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @Operation( @@ -65,7 +65,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java index cae54689842..b7eda04884f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/PetApi.java @@ -41,14 +41,16 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -64,12 +66,13 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -79,6 +82,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -206,8 +210,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -216,6 +221,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -233,12 +239,13 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) throws Exception; /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -248,6 +255,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -270,6 +278,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -279,6 +288,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java index d27402541d8..765bb98a312 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/StoreApi.java @@ -130,14 +130,16 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -150,10 +152,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java index 8def3b33924..ba2922d98e2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/api/UserApi.java @@ -43,7 +43,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @Operation( @@ -57,22 +57,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) throws Exception; /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -80,22 +83,25 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -103,10 +109,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) throws Exception; @@ -139,6 +146,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -148,6 +156,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -170,6 +179,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -179,6 +189,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -201,12 +212,14 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -226,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -242,11 +255,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) throws Exception; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 14e13504a8c..66e0aed61c6 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,41 +30,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -302,7 +305,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +315,11 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 42600354f74..ead205932fa 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 2f6c19a8344..7ab62ebdb8f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java index 23ee84ce8b5..4c5a142ddca 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ArrayTest.java @@ -26,15 +26,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..55d20539817 --- /dev/null +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java index 2720e81c227..696d07582b9 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/EnumArrays.java @@ -99,7 +99,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java index 8b196d5d7de..9b9f087aaa7 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,7 +29,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java index 9811806e0c8..74cab2e2f8c 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MapTest.java @@ -26,7 +26,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -65,15 +65,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index bcf0155a1b2..d6b45daabd7 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java index 6adaaba97d7..3f4cf6872f2 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/Pet.java @@ -44,7 +44,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java index c3d3aa9182e..e0a16a7b89a 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,7 +19,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java index 67ef036857d..12b55e21185 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -28,17 +28,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -142,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java index 5b77bee14c1..8b74b97d38f 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -165,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +177,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java index 1a4455cdaa8..03f777866d6 100644 --- a/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/spring-boot-defaultInterface-unhandledException/src/main/java/org/openapitools/model/XmlItem.java @@ -38,7 +38,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -54,11 +54,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -74,11 +74,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -94,11 +94,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -114,11 +114,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java index 06109fa9bea..71992dae886 100644 --- a/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java +++ b/samples/server/petstore/spring-boot-nullable-set/src/main/java/org/openapitools/model/ObjectWithUniqueItems.java @@ -37,7 +37,7 @@ public class ObjectWithUniqueItems { @JsonProperty("notNullSet") @Valid - private Set notNullSet = null; + private Set notNullSet = new LinkedHashSet<>(); @JsonProperty("nullList") @Valid @@ -45,7 +45,7 @@ public class ObjectWithUniqueItems { @JsonProperty("notNullList") @Valid - private List notNullList = null; + private List notNullList = new ArrayList<>(); @JsonProperty("notNullDateField") @DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME) diff --git a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java index 60af3a5b92a..1f114e8f347 100644 --- a/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/spring-stubs/src/main/java/org/openapitools/model/Pet.java @@ -43,7 +43,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -165,6 +165,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES index 3c2e959bec0..32921b847d0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml index 8995d90039c..8c874b16a53 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapitools.openapi3 spring-boot-beanvalidation-no-nullable jar spring-boot-beanvalidation-no-nullable diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java index b7316fe0b69..3fc76144032 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java index 6b7e3be326b..edf5c41ea0f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeApi.java @@ -90,7 +90,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +105,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +121,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +161,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +192,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -203,7 +207,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +225,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +236,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +255,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +266,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +286,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +447,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +467,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +476,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +510,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +530,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context @@ -537,6 +541,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2bb9e2400c..8d0ca9689bb 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java index f81ce10fc92..1d418d2aced 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/PetApi.java @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java index 5e285e97c0d..4268160d16e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/StoreApi.java @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java index fb1f0b0410e..1626c669d49 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index 5f1460876f7..ccad3b7842e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -27,41 +27,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private Object anytype2 = null; @JsonProperty("anytype_3") private Object anytype3; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index 8eb8b8652c9..29f12485a49 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index c5b92b31b9d..62ec18eb583 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java index 0fb0d1f196d..e2d2fd53a51 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ArrayTest.java @@ -26,15 +26,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..193fbbcab33 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,210 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.List; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private List nullableArray; + + @JsonProperty("nullable_required_array") + @Valid + private List nullableRequiredArray; + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private List nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = nullableArray; + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null) { + this.nullableArray = new ArrayList<>(); + } + this.nullableArray.add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public List getNullableArray() { + return nullableArray; + } + + public void setNullableArray(List nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null) { + this.nullableRequiredArray = new ArrayList<>(); + } + this.nullableRequiredArray.add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null) { + this.nullableArrayWithDefault = new ArrayList<>(Arrays.asList("foo", "bar")); + } + this.nullableArrayWithDefault.add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public List getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return Objects.equals(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + Objects.equals(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + @Override + public int hashCode() { + return Objects.hash(nullableArray, nullableRequiredArray, requiredArray, nullableArrayWithDefault); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java index 6ec78baa173..8a9c025c755 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/EnumArrays.java @@ -99,7 +99,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index b233286eebc..9c38fb6815f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -29,7 +29,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java index 7253ca7481e..909f43125d0 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MapTest.java @@ -26,7 +26,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -65,15 +65,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index ba027c67881..ae7d7930f7e 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java index 51bf8f52196..67bb307f244 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/Pet.java @@ -44,7 +44,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java index 06b722ccf5f..5f1ed55d3d4 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/SpecialModelName.java @@ -19,7 +19,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java index 00e1edd884b..ac1c34f7878 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -28,17 +28,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -143,7 +143,7 @@ public class TypeHolderDefault { public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); } this.arrayItem.add(arrayItemItem); return this; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java index ba77803deb7..ee14d628a10 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -177,7 +177,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java index 98a5e28e4dc..560aad3e41f 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model/XmlItem.java @@ -38,7 +38,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -54,11 +54,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -74,11 +74,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -94,11 +94,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -114,11 +114,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation-no-nullable/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES index d61b6cf83bf..9ecdb11614b 100644 --- a/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-beanvalidation/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java index b7316fe0b69..3fc76144032 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java index 6b7e3be326b..edf5c41ea0f 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeApi.java @@ -90,7 +90,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +105,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +121,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +161,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +192,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -203,7 +207,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +225,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +236,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +255,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +266,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +286,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +447,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +467,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +476,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +510,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +530,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context @@ -537,6 +541,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2bb9e2400c..8d0ca9689bb 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java index f81ce10fc92..1d418d2aced 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/PetApi.java @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java index 5e285e97c0d..4268160d16e 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/StoreApi.java @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java index fb1f0b0410e..1626c669d49 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..4d0595e38d0 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,41 +31,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -303,7 +306,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +316,11 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..f513931c718 --- /dev/null +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java index 02620d04526..1beb64aba34 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/Pet.java @@ -45,7 +45,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -167,6 +167,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..1ee2b748142 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,7 +20,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..7654de1cd32 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -29,17 +29,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..da3cb34f1e7 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +178,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-beanvalidation/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-beanvalidation/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES index 07f63a0e8be..05fbaa353e8 100644 --- a/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate-j8/.openapi-generator/FILES @@ -44,6 +44,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java index e287793b31b..edc87a622fb 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,7 +31,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,9 +51,9 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().call123testSpecialTags(body); + return getDelegate().call123testSpecialTags(client); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2d5e24bcd5f..740965f1686 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -27,11 +27,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java index 0f61213f832..ae78c71d530 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApi.java @@ -85,7 +85,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -98,7 +99,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -114,12 +115,13 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { - return getDelegate().fakeOuterCompositeSerialize(body); + return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -143,7 +145,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -172,7 +175,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -185,7 +189,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -203,9 +207,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { - return getDelegate().testBodyWithFileSchema(body); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -213,7 +217,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -232,9 +236,9 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { - return getDelegate().testBodyWithQueryParams(query, body); + return getDelegate().testBodyWithQueryParams(query, user); } @@ -242,7 +246,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -262,9 +266,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClientModel(body); + return getDelegate().testClientModel(client); } @@ -410,8 +414,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -429,14 +434,15 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { - return getDelegate().testInlineAdditionalProperties(param); + return getDelegate().testInlineAdditionalProperties(requestBody); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -469,7 +475,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -490,17 +495,17 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java index 2cd684b90f5..d1a650378e6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -63,11 +63,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -111,11 +111,11 @@ public interface FakeApiDelegate { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -124,12 +124,12 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default ResponseEntity testBodyWithQueryParams(String query, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,11 +138,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -249,18 +249,20 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default ResponseEntity testInlineAdditionalProperties(Map param) { + default ResponseEntity testInlineAdditionalProperties(Map requestBody) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -278,7 +280,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -286,7 +287,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default ResponseEntity testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context) { @@ -296,6 +296,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e37344594de..12d5e65cbe7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,7 +31,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -54,9 +54,9 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClassname(body); + return getDelegate().testClassname(client); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index fb689b13f94..a15fd1b7728 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -27,11 +27,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java index a4a97a06cbb..9b93a0fc3be 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApi.java @@ -31,8 +31,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -58,14 +59,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().addPet(body); + return getDelegate().addPet(pet); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -216,8 +218,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -247,14 +250,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().updatePet(body); + return getDelegate().updatePet(pet); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -292,6 +296,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java index 1e9ad7f94f4..aded0c3fefc 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -27,19 +27,21 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet body) { + default ResponseEntity addPet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -142,21 +144,23 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet body) { + default ResponseEntity updatePet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -173,6 +177,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java index d80873ebcc9..4fcc6fb311c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApi.java @@ -124,8 +124,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -143,12 +144,13 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { - return getDelegate().placeOrder(body); + return getDelegate().placeOrder(order); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java index c4c812a9bb2..84623f79f76 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -81,13 +81,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java index 315ff7928d1..033fdc52474 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApi.java @@ -33,7 +33,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -47,19 +47,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().createUser(body); + return getDelegate().createUser(user); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -73,19 +75,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithArrayInput(body); + return getDelegate().createUsersWithArrayInput(user); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -99,12 +103,13 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithListInput(body); + return getDelegate().createUsersWithListInput(user); } @@ -139,6 +144,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -171,6 +177,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -203,6 +210,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -231,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -247,13 +255,14 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().updateUser(username, body); + return getDelegate().updateUser(username, user); } } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java index c39231c6b29..f0630c08541 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -29,35 +29,37 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default ResponseEntity createUser(User body) { + default ResponseEntity createUser(User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default ResponseEntity createUsersWithArrayInput(List body) { + default ResponseEntity createUsersWithArrayInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default ResponseEntity createUsersWithListInput(List body) { + default ResponseEntity createUsersWithListInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,6 +80,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -106,6 +109,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -121,6 +125,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -135,13 +140,13 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default ResponseEntity updateUser(String username, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..4d0595e38d0 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,41 +31,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -303,7 +306,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +316,11 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..f513931c718 --- /dev/null +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java index 02620d04526..1beb64aba34 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/Pet.java @@ -45,7 +45,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -167,6 +167,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..1ee2b748142 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,7 +20,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..7654de1cd32 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -29,17 +29,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..da3cb34f1e7 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +178,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate-j8/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES index 07f63a0e8be..05fbaa353e8 100644 --- a/samples/server/petstore/springboot-delegate/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-delegate/.openapi-generator/FILES @@ -44,6 +44,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java index e287793b31b..edc87a622fb 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -31,7 +31,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,9 +51,9 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().call123testSpecialTags(body); + return getDelegate().call123testSpecialTags(client); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 2d5e24bcd5f..740965f1686 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -27,11 +27,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default ResponseEntity call123testSpecialTags(Client body) { + default ResponseEntity call123testSpecialTags(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java index 0f61213f832..ae78c71d530 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApi.java @@ -85,7 +85,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -98,7 +99,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -114,12 +115,13 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { - return getDelegate().fakeOuterCompositeSerialize(body); + return getDelegate().fakeOuterCompositeSerialize(outerComposite); } @@ -143,7 +145,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -172,7 +175,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -185,7 +189,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -203,9 +207,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { - return getDelegate().testBodyWithFileSchema(body); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass); } @@ -213,7 +217,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -232,9 +236,9 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { - return getDelegate().testBodyWithQueryParams(query, body); + return getDelegate().testBodyWithQueryParams(query, user); } @@ -242,7 +246,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -262,9 +266,9 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClientModel(body); + return getDelegate().testClientModel(client); } @@ -410,8 +414,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -429,14 +434,15 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { - return getDelegate().testInlineAdditionalProperties(param); + return getDelegate().testInlineAdditionalProperties(requestBody); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -469,7 +475,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -490,17 +495,17 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java index 2cd684b90f5..d1a650378e6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -63,11 +63,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default ResponseEntity fakeOuterCompositeSerialize(OuterComposite body) { + default ResponseEntity fakeOuterCompositeSerialize(OuterComposite outerComposite) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("*/*"))) { @@ -111,11 +111,11 @@ public interface FakeApiDelegate { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass body) { + default ResponseEntity testBodyWithFileSchema(FileSchemaTestClass fileSchemaTestClass) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -124,12 +124,12 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default ResponseEntity testBodyWithQueryParams(String query, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -138,11 +138,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default ResponseEntity testClientModel(Client body) { + default ResponseEntity testClientModel(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { @@ -249,18 +249,20 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default ResponseEntity testInlineAdditionalProperties(Map param) { + default ResponseEntity testInlineAdditionalProperties(Map requestBody) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -278,7 +280,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -286,7 +287,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default ResponseEntity testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context) { @@ -296,6 +296,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e37344594de..12d5e65cbe7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,7 +31,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -54,9 +54,9 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { - return getDelegate().testClassname(body); + return getDelegate().testClassname(client); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index fb689b13f94..a15fd1b7728 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -27,11 +27,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default ResponseEntity testClassname(Client body) { + default ResponseEntity testClassname(Client client) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java index a4a97a06cbb..9b93a0fc3be 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApi.java @@ -31,8 +31,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -58,14 +59,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().addPet(body); + return getDelegate().addPet(pet); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -216,8 +218,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -247,14 +250,15 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { - return getDelegate().updatePet(body); + return getDelegate().updatePet(pet); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -292,6 +296,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java index 1e9ad7f94f4..aded0c3fefc 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -27,19 +27,21 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default ResponseEntity addPet(Pet body) { + default ResponseEntity addPet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -142,21 +144,23 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default ResponseEntity updatePet(Pet body) { + default ResponseEntity updatePet(Pet pet) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -173,6 +177,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java index d80873ebcc9..4fcc6fb311c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApi.java @@ -124,8 +124,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -143,12 +144,13 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { - return getDelegate().placeOrder(body); + return getDelegate().placeOrder(order); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java index c4c812a9bb2..84623f79f76 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -81,13 +81,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default ResponseEntity placeOrder(Order body) { + default ResponseEntity placeOrder(Order order) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { if (mediaType.isCompatibleWith(MediaType.valueOf("application/json"))) { diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java index 315ff7928d1..033fdc52474 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApi.java @@ -33,7 +33,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -47,19 +47,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().createUser(body); + return getDelegate().createUser(user); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -73,19 +75,21 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithArrayInput(body); + return getDelegate().createUsersWithArrayInput(user); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -99,12 +103,13 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { - return getDelegate().createUsersWithListInput(body); + return getDelegate().createUsersWithListInput(user); } @@ -139,6 +144,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -171,6 +177,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -203,6 +210,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -231,7 +239,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -247,13 +255,14 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { - return getDelegate().updateUser(username, body); + return getDelegate().updateUser(username, user); } } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java index c39231c6b29..f0630c08541 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -29,35 +29,37 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default ResponseEntity createUser(User body) { + default ResponseEntity createUser(User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default ResponseEntity createUsersWithArrayInput(List body) { + default ResponseEntity createUsersWithArrayInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default ResponseEntity createUsersWithListInput(List body) { + default ResponseEntity createUsersWithListInput(List user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } @@ -78,6 +80,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -106,6 +109,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -121,6 +125,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -135,13 +140,13 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default ResponseEntity updateUser(String username, - User body) { + User user) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..4d0595e38d0 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,41 +31,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -303,7 +306,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +316,11 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..f513931c718 --- /dev/null +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java index 02620d04526..1beb64aba34 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/Pet.java @@ -45,7 +45,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -167,6 +167,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..1ee2b748142 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,7 +20,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..7654de1cd32 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -29,17 +29,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..da3cb34f1e7 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +178,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-delegate/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-delegate/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java index 4f55bcef672..081e4813a03 100644 --- a/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders-annotationLibrary/src/main/java/org/openapitools/model/Pet.java @@ -40,7 +40,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -159,6 +159,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES index 3c2e959bec0..32921b847d0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-implicitHeaders/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java index b7316fe0b69..3fc76144032 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java index 741ec10f07a..46f0bab3f01 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeApi.java @@ -90,7 +90,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +105,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +121,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +161,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +192,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -203,7 +207,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +225,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +236,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +255,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +266,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +286,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +447,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +467,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +476,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +510,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +530,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context @@ -537,6 +541,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2bb9e2400c..8d0ca9689bb 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java index 6b895ef76e9..226781e819f 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/PetApi.java @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @return successful operation (status code 200) @@ -268,8 +270,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -299,7 +302,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -308,6 +311,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -346,6 +350,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java index 5e285e97c0d..4268160d16e 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/StoreApi.java @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java index fb1f0b0410e..1626c669d49 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..4d0595e38d0 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,41 +31,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -303,7 +306,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +316,11 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..f513931c718 --- /dev/null +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java index 02620d04526..1beb64aba34 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/Pet.java @@ -45,7 +45,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -167,6 +167,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..1ee2b748142 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,7 +20,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..7654de1cd32 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -29,17 +29,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..da3cb34f1e7 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +178,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-implicitHeaders/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES index bf09bb15ac7..a38d317b824 100644 --- a/samples/server/petstore/springboot-reactive/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-reactive/.openapi-generator/FILES @@ -43,6 +43,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-reactive/pom.xml b/samples/server/petstore/springboot-reactive/pom.xml index 86990714a3b..19d7799e733 100644 --- a/samples/server/petstore/springboot-reactive/pom.xml +++ b/samples/server/petstore/springboot-reactive/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapitools.openapi3 springboot-reactive jar springboot-reactive diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java index 7da21d14c00..ec172a80737 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -36,7 +36,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -56,10 +56,10 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default Mono> call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().call123testSpecialTags(body, exchange); + return getDelegate().call123testSpecialTags(client, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java index 5e5979845e8..7737b06203e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/AnotherFakeApiDelegate.java @@ -32,11 +32,11 @@ public interface AnotherFakeApiDelegate { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see AnotherFakeApi#call123testSpecialTags */ - default Mono> call123testSpecialTags(Mono body, + default Mono> call123testSpecialTags(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -47,7 +47,7 @@ public interface AnotherFakeApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(client).then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java index 47c0ecbfa68..8e2522bda4e 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApi.java @@ -91,7 +91,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Mono body, @@ -105,7 +106,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -121,13 +122,14 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono body, + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) Mono outerComposite, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().fakeOuterCompositeSerialize(body, exchange); + return getDelegate().fakeOuterCompositeSerialize(outerComposite, exchange); } @@ -151,7 +153,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) Mono body, @@ -181,7 +184,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default Mono> fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) Mono body, @@ -195,7 +199,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -213,10 +217,10 @@ public interface FakeApi { consumes = { "application/json" } ) default Mono> testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "", required = true) @Valid @RequestBody Mono fileSchemaTestClass, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testBodyWithFileSchema(body, exchange); + return getDelegate().testBodyWithFileSchema(fileSchemaTestClass, exchange); } @@ -224,7 +228,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -243,10 +247,10 @@ public interface FakeApi { ) default Mono> testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testBodyWithQueryParams(query, body, exchange); + return getDelegate().testBodyWithQueryParams(query, user, exchange); } @@ -254,7 +258,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -274,10 +278,10 @@ public interface FakeApi { consumes = { "application/json" } ) default Mono> testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testClientModel(body, exchange); + return getDelegate().testClientModel(client, exchange); } @@ -426,8 +430,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -445,15 +450,16 @@ public interface FakeApi { consumes = { "application/json" } ) default Mono> testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> param, + @ApiParam(value = "request body", required = true) @Valid @RequestBody Mono> requestBody, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testInlineAdditionalProperties(param, exchange); + return getDelegate().testInlineAdditionalProperties(requestBody, exchange); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -487,7 +493,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -508,18 +513,18 @@ public interface FakeApi { ) default Mono> testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testQueryParameterCollectionFormat(pipe, ioutil, http, url, context, exchange); + return getDelegate().testQueryParameterCollectionFormat(pipe, http, url, context, exchange); } /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java index af978b31c2f..db5642bdaa1 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeApiDelegate.java @@ -74,11 +74,11 @@ public interface FakeApiDelegate { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) * @see FakeApi#fakeOuterCompositeSerialize */ - default Mono> fakeOuterCompositeSerialize(Mono body, + default Mono> fakeOuterCompositeSerialize(Mono outerComposite, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -89,7 +89,7 @@ public interface FakeApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(outerComposite).then(Mono.empty()); } @@ -129,15 +129,15 @@ public interface FakeApiDelegate { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) * @see FakeApi#testBodyWithFileSchema */ - default Mono> testBodyWithFileSchema(Mono body, + default Mono> testBodyWithFileSchema(Mono fileSchemaTestClass, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(fileSchemaTestClass).then(Mono.empty()); } @@ -145,16 +145,16 @@ public interface FakeApiDelegate { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) * @see FakeApi#testBodyWithQueryParams */ default Mono> testBodyWithQueryParams(String query, - Mono body, + Mono user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(user).then(Mono.empty()); } @@ -162,11 +162,11 @@ public interface FakeApiDelegate { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeApi#testClientModel */ - default Mono> testClientModel(Mono body, + default Mono> testClientModel(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -177,7 +177,7 @@ public interface FakeApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(client).then(Mono.empty()); } @@ -283,21 +283,23 @@ public interface FakeApiDelegate { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) * @see FakeApi#testInlineAdditionalProperties */ - default Mono> testInlineAdditionalProperties(Mono> param, + default Mono> testInlineAdditionalProperties(Mono> requestBody, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(param).then(Mono.empty()); + return result.then(requestBody).then(Mono.empty()); } /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -318,7 +320,6 @@ public interface FakeApiDelegate { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -326,7 +327,6 @@ public interface FakeApiDelegate { * @see FakeApi#testQueryParameterCollectionFormat */ default Mono> testQueryParameterCollectionFormat(List pipe, - List ioutil, List http, List url, List context, @@ -339,6 +339,7 @@ public interface FakeApiDelegate { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 5c5725f6ddd..2df97014b93 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -36,7 +36,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -59,10 +59,10 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default Mono> testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "client model", required = true) @Valid @RequestBody Mono client, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().testClassname(body, exchange); + return getDelegate().testClassname(client, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java index 6c9ea314d72..d6cb82cb24d 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/FakeClassnameTestApiDelegate.java @@ -32,11 +32,11 @@ public interface FakeClassnameTestApiDelegate { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) * @see FakeClassnameTestApi#testClassname */ - default Mono> testClassname(Mono body, + default Mono> testClassname(Mono client, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -47,7 +47,7 @@ public interface FakeClassnameTestApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(client).then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java index 5427566daf1..1107e62491b 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApi.java @@ -36,8 +36,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -63,15 +64,16 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default Mono> addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().addPet(body, exchange); + return getDelegate().addPet(pet, exchange); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -226,8 +228,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -257,15 +260,16 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default Mono> updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Mono pet, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().updatePet(body, exchange); + return getDelegate().updatePet(pet, exchange); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -304,6 +308,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java index 0c9899164ae..ad07e346415 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/PetApiDelegate.java @@ -32,22 +32,24 @@ public interface PetApiDelegate { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) * @see PetApi#addPet */ - default Mono> addPet(Mono body, + default Mono> addPet(Mono pet, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(pet).then(Mono.empty()); } /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -156,24 +158,26 @@ public interface PetApiDelegate { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) * or Validation exception (status code 405) * @see PetApi#updatePet */ - default Mono> updatePet(Mono body, + default Mono> updatePet(Mono pet, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(pet).then(Mono.empty()); } /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -193,6 +197,7 @@ public interface PetApiDelegate { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java index ab235f201eb..a4feea3e7e5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApi.java @@ -131,8 +131,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -150,13 +151,14 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default Mono> placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Mono order, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().placeOrder(body, exchange); + return getDelegate().placeOrder(order, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java index 48ed7540684..81f26555788 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/StoreApiDelegate.java @@ -92,13 +92,14 @@ public interface StoreApiDelegate { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) * @see StoreApi#placeOrder */ - default Mono> placeOrder(Mono body, + default Mono> placeOrder(Mono order, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); @@ -114,7 +115,7 @@ public interface StoreApiDelegate { break; } } - return result.then(body).then(Mono.empty()); + return result.then(order).then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java index 88448ffc54d..47ef0c6c6d5 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApi.java @@ -38,7 +38,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -52,20 +52,22 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default Mono> createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().createUser(body, exchange); + return getDelegate().createUser(user, exchange); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -79,20 +81,22 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default Mono> createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().createUsersWithArrayInput(body, exchange); + return getDelegate().createUsersWithArrayInput(user, exchange); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -106,13 +110,14 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default Mono> createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux body, + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody Flux user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().createUsersWithListInput(body, exchange); + return getDelegate().createUsersWithListInput(user, exchange); } @@ -148,6 +153,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -181,6 +187,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -214,6 +221,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -242,7 +250,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -258,14 +266,15 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default Mono> updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono body, + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody Mono user, @ApiIgnore final ServerWebExchange exchange ) { - return getDelegate().updateUser(username, body, exchange); + return getDelegate().updateUser(username, user, exchange); } } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java index bb61d43b378..eecd786ba93 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/api/UserApiDelegate.java @@ -34,45 +34,47 @@ public interface UserApiDelegate { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) * @see UserApi#createUser */ - default Mono> createUser(Mono body, + default Mono> createUser(Mono user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(user).then(Mono.empty()); } /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithArrayInput */ - default Mono> createUsersWithArrayInput(Flux body, + default Mono> createUsersWithArrayInput(Flux user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); + return result.thenMany(user).then(Mono.empty()); } /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) * @see UserApi#createUsersWithListInput */ - default Mono> createUsersWithListInput(Flux body, + default Mono> createUsersWithListInput(Flux user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.thenMany(body).then(Mono.empty()); + return result.thenMany(user).then(Mono.empty()); } @@ -95,6 +97,7 @@ public interface UserApiDelegate { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -124,6 +127,7 @@ public interface UserApiDelegate { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -142,6 +146,7 @@ public interface UserApiDelegate { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) * @see UserApi#logoutUser @@ -158,17 +163,17 @@ public interface UserApiDelegate { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) * @see UserApi#updateUser */ default Mono> updateUser(String username, - Mono body, + Mono user, ServerWebExchange exchange) { Mono result = Mono.empty(); exchange.getResponse().setStatusCode(HttpStatus.NOT_IMPLEMENTED); - return result.then(body).then(Mono.empty()); + return result.then(user).then(Mono.empty()); } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..4d0595e38d0 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,41 +31,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -303,7 +306,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +316,11 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..f513931c718 --- /dev/null +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java index 02620d04526..1beb64aba34 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/Pet.java @@ -45,7 +45,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -167,6 +167,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..1ee2b748142 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,7 +20,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..7654de1cd32 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -29,17 +29,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..da3cb34f1e7 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +178,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-reactive/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-reactive/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8bbdc0a2482 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -28,35 +28,35 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5830ee0680d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..54679942725 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..7f2cc3784a1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8bbdc0a2482 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -28,35 +28,35 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5830ee0680d 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..54679942725 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..7f2cc3784a1 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-delegatePattern/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8bbdc0a2482 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -28,35 +28,35 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5830ee0680d 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..54679942725 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..7f2cc3784a1 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable-without-j8/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..8bbdc0a2482 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -28,35 +28,35 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java index 9e739aefac2..5830ee0680d 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/Pet.java @@ -42,7 +42,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -164,6 +164,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new ArrayList<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..54679942725 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..7f2cc3784a1 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-spring-pageable/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES index 3c2e959bec0..32921b847d0 100644 --- a/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-useoptional/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/model/CatAllOf.java src/main/java/org/openapitools/model/Category.java src/main/java/org/openapitools/model/ClassModel.java src/main/java/org/openapitools/model/Client.java +src/main/java/org/openapitools/model/ContainerDefaultValue.java src/main/java/org/openapitools/model/Dog.java src/main/java/org/openapitools/model/DogAllOf.java src/main/java/org/openapitools/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-useoptional/pom.xml b/samples/server/petstore/springboot-useoptional/pom.xml index 90594c755f2..7c76b4dc531 100644 --- a/samples/server/petstore/springboot-useoptional/pom.xml +++ b/samples/server/petstore/springboot-useoptional/pom.xml @@ -1,6 +1,6 @@ 4.0.0 - org.openapitools + org.openapitools.openapi3 spring-boot-useoptional jar spring-boot-useoptional diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java index b7316fe0b69..3fc76144032 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java index 36cd1b32c71..adbc6c1f1e8 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeApi.java @@ -90,7 +90,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +105,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +121,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +161,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +192,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -203,7 +207,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +225,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +236,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +255,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody User body + @ApiParam(value = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +266,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +286,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +447,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +467,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +476,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +510,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +530,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context @@ -537,6 +541,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index e2bb9e2400c..8d0ca9689bb 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody Client body + @ApiParam(value = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java index b95c83994f3..36427dddb99 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/PetApi.java @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java index 5e285e97c0d..4268160d16e 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/StoreApi.java @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java index fb1f0b0410e..1626c669d49 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java index b5e88d5d7cc..4d0595e38d0 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -7,10 +7,13 @@ import com.fasterxml.jackson.annotation.JsonCreator; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -28,41 +31,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -303,7 +306,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -313,11 +316,11 @@ public class AdditionalPropertiesClass { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -358,13 +361,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java index df67eda87fd..e9a28b539c6 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java index 05f1ca376a6..06758b17e90 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayOfNumberOnly.java @@ -27,7 +27,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java index 3e7a107f659..5da3fd898c3 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ArrayTest.java @@ -27,15 +27,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..f513931c718 --- /dev/null +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/ContainerDefaultValue.java @@ -0,0 +1,225 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java index dba32cf2b71..9708f0507b4 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/EnumArrays.java @@ -100,7 +100,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java index d97a088a267..0798c027c7c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/FileSchemaTestClass.java @@ -30,7 +30,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java index f2867ac5040..d024c5cc5db 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MapTest.java @@ -27,7 +27,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -66,15 +66,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java index 901c65b2924..6ecb96d5e49 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -37,7 +37,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java index 02620d04526..1beb64aba34 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/Pet.java @@ -45,7 +45,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -167,6 +167,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java index f321ab78cd5..1ee2b748142 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/SpecialModelName.java @@ -20,7 +20,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -54,8 +54,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java index fae0d6dac4a..7654de1cd32 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderDefault.java @@ -29,17 +29,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -143,6 +143,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java index 068f9dc83fd..da3cb34f1e7 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/TypeHolderExample.java @@ -166,6 +166,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -175,7 +178,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java index 27d5f828281..05a4379fd6c 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java +++ b/samples/server/petstore/springboot-useoptional/src/main/java/org/openapitools/model/XmlItem.java @@ -39,7 +39,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -55,11 +55,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -75,11 +75,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -95,11 +95,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -115,11 +115,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-useoptional/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES index 408f3973f3e..2f1080a4150 100644 --- a/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES +++ b/samples/server/petstore/springboot-virtualan/.openapi-generator/FILES @@ -38,6 +38,7 @@ src/main/java/org/openapitools/virtualan/model/CatAllOf.java src/main/java/org/openapitools/virtualan/model/Category.java src/main/java/org/openapitools/virtualan/model/ClassModel.java src/main/java/org/openapitools/virtualan/model/Client.java +src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java src/main/java/org/openapitools/virtualan/model/Dog.java src/main/java/org/openapitools/virtualan/model/DogAllOf.java src/main/java/org/openapitools/virtualan/model/EnumArrays.java diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java index 2ea7a548535..e274fef5fa8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/AnotherFakeApi.java @@ -48,7 +48,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -70,7 +70,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java index e2d740c5e86..a902146a5f8 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeApi.java @@ -105,7 +105,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -119,7 +120,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerComposite Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiVirtual @@ -136,10 +137,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body + @Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -176,7 +178,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -207,7 +210,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -221,7 +225,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClass (required) * @return Success (status code 200) */ @ApiVirtual @@ -239,7 +243,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body + @Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -250,7 +254,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param user (required) * @return Success (status code 200) */ @ApiVirtual @@ -268,7 +272,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query, - @Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -279,7 +283,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -301,7 +305,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -465,14 +469,16 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiVirtual @Operation( operationId = "testInlineAdditionalProperties", summary = "test inline additionalProperties", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -484,7 +490,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map param + @Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -493,6 +499,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -502,6 +509,7 @@ public interface FakeApi { @Operation( operationId = "testJsonFormData", summary = "test json serialization of form data", + description = "", tags = { "fake" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation") @@ -526,7 +534,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -547,7 +554,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List context @@ -559,6 +565,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) @@ -569,6 +576,7 @@ public interface FakeApi { @Operation( operationId = "uploadFileWithRequiredFile", summary = "uploads an image (required)", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java index a38d1b3ad43..45606efb970 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/FakeClassnameTestApi.java @@ -48,7 +48,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param client client model (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -73,7 +73,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body + @Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java index 9726fc8992f..fc43b7f986f 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/PetApi.java @@ -48,8 +48,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -57,6 +58,7 @@ public interface PetApi { @Operation( operationId = "addPet", summary = "Add a new pet to the store", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -72,7 +74,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -81,6 +83,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -91,6 +94,7 @@ public interface PetApi { @Operation( operationId = "deletePet", summary = "Deletes a pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -275,8 +279,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param pet Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -286,6 +291,7 @@ public interface PetApi { @Operation( operationId = "updatePet", summary = "Update an existing pet", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation"), @@ -303,7 +309,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body + @Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -312,6 +318,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -322,6 +329,7 @@ public interface PetApi { @Operation( operationId = "updatePetWithForm", summary = "Updates a pet in the store with form data", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "405", description = "Invalid input") @@ -347,6 +355,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) @@ -357,6 +366,7 @@ public interface PetApi { @Operation( operationId = "uploadFile", summary = "uploads an image", + description = "", tags = { "pet" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java index 3da0ad05a65..fd6f373cde0 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/StoreApi.java @@ -163,8 +163,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param order order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -172,6 +173,7 @@ public interface StoreApi { @Operation( operationId = "placeOrder", summary = "Place an order for a pet", + description = "", tags = { "store" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -184,10 +186,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body + @Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java index 449ad8541f0..eecd4ff12a3 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/api/UserApi.java @@ -50,7 +50,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param user Created user object (required) * @return successful operation (status code 200) */ @ApiVirtual @@ -65,10 +65,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -77,14 +78,16 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiVirtual @Operation( operationId = "createUsersWithArrayInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -92,10 +95,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -104,14 +108,16 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param user List of user object (required) * @return successful operation (status code 200) */ @ApiVirtual @Operation( operationId = "createUsersWithListInput", summary = "Creates list of users with given input array", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -119,10 +125,11 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List body + @Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -162,6 +169,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -172,6 +180,7 @@ public interface UserApi { @Operation( operationId = "getUserByName", summary = "Get user by user name", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -211,6 +220,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -221,6 +231,7 @@ public interface UserApi { @Operation( operationId = "loginUser", summary = "Logs user into the system", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "200", description = "successful operation", content = { @@ -246,6 +257,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -253,6 +265,7 @@ public interface UserApi { @Operation( operationId = "logoutUser", summary = "Logs out current logged in user session", + description = "", tags = { "user" }, responses = { @ApiResponse(responseCode = "default", description = "successful operation") @@ -275,7 +288,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param user Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -292,11 +305,12 @@ public interface UserApi { ) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username, - @Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body + @Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java index e85950e89e5..170518a544d 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/AdditionalPropertiesClass.java @@ -5,10 +5,13 @@ import java.util.Objects; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonCreator; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -27,41 +30,41 @@ public class AdditionalPropertiesClass { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -302,7 +305,7 @@ public class AdditionalPropertiesClass { } public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -312,11 +315,11 @@ public class AdditionalPropertiesClass { */ @Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED) - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -357,13 +360,24 @@ public class AdditionalPropertiesClass { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java index 9e659a77e5f..89ff34c4339 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnly arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java index 57218ff5084..56d3db08b40 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayOfNumberOnly.java @@ -26,7 +26,7 @@ public class ArrayOfNumberOnly { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnly arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java index bd5ffb05a08..43632d35716 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ArrayTest.java @@ -26,15 +26,15 @@ public class ArrayTest { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTest arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java new file mode 100644 index 00000000000..ed71e7bf9a4 --- /dev/null +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/ContainerDefaultValue.java @@ -0,0 +1,224 @@ +package org.openapitools.virtualan.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; +import io.swagger.v3.oas.annotations.media.Schema; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValue + */ + +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValue { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List, List)} + */ + @Deprecated + public ContainerDefaultValue() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValue(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValue nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValue requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED) + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValue nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED) + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValue {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java index bf35bb62dfb..ae1f9f62fe5 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/EnumArrays.java @@ -99,7 +99,7 @@ public class EnumArrays { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArrays justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java index 0fe10da645d..88200ea9640 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/FileSchemaTestClass.java @@ -29,7 +29,7 @@ public class FileSchemaTestClass { @JsonProperty("files") @Valid - private List<@Valid File> files = null; + private List<@Valid File> files = new ArrayList<>(); public FileSchemaTestClass file(File file) { this.file = file; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java index d10f2317c38..9f6f0f6c589 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MapTest.java @@ -26,7 +26,7 @@ public class MapTest { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -65,15 +65,15 @@ public class MapTest { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTest mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java index 9a92421585e..247cf3cae21 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/MixedPropertiesAndAdditionalPropertiesClass.java @@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java index acb4d1464ef..d185ee9bf9b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/Pet.java @@ -44,7 +44,7 @@ public class Pet { @JsonProperty("tags") @Valid - private List<@Valid Tag> tags = null; + private List<@Valid Tag> tags = new ArrayList<>(); /** * pet status in the store @@ -166,6 +166,9 @@ public class Pet { } public Pet addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java index c63be2646fe..02f421df163 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/SpecialModelName.java @@ -19,7 +19,7 @@ import javax.annotation.Generated; * SpecialModelName */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelName { @@ -53,8 +53,8 @@ public class SpecialModelName { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelName $specialModelName = (SpecialModelName) o; - return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName); + SpecialModelName specialModelName = (SpecialModelName) o; + return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName); } @Override diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java index 4b652fe3170..0fd5ba6fa7b 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderDefault.java @@ -28,17 +28,17 @@ public class TypeHolderDefault { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -142,6 +142,9 @@ public class TypeHolderDefault { } public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java index 3bcd0c5f389..21d9337da76 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/TypeHolderExample.java @@ -165,6 +165,9 @@ public class TypeHolderExample { } public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -174,7 +177,7 @@ public class TypeHolderExample { * @return arrayItem */ @NotNull - @Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED) + @Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED) public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java index b13481f3fcd..a28e7c54671 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java +++ b/samples/server/petstore/springboot-virtualan/src/main/java/org/openapitools/virtualan/model/XmlItem.java @@ -38,7 +38,7 @@ public class XmlItem { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -54,11 +54,11 @@ public class XmlItem { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -74,11 +74,11 @@ public class XmlItem { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -94,11 +94,11 @@ public class XmlItem { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -114,11 +114,11 @@ public class XmlItem { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItem attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml index 658d8a96b30..1fa32524cf2 100644 --- a/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot-virtualan/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1872,13 +1840,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2103,6 +2078,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2146,7 +2157,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2282,4 +2292,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" diff --git a/samples/server/petstore/springboot/.openapi-generator/FILES b/samples/server/petstore/springboot/.openapi-generator/FILES index c8573ea8e66..ed149e7e75b 100644 --- a/samples/server/petstore/springboot/.openapi-generator/FILES +++ b/samples/server/petstore/springboot/.openapi-generator/FILES @@ -39,6 +39,7 @@ src/main/java/org/openapitools/model/CatDto.java src/main/java/org/openapitools/model/CategoryDto.java src/main/java/org/openapitools/model/ClassModelDto.java src/main/java/org/openapitools/model/ClientDto.java +src/main/java/org/openapitools/model/ContainerDefaultValueDto.java src/main/java/org/openapitools/model/DogAllOfDto.java src/main/java/org/openapitools/model/DogDto.java src/main/java/org/openapitools/model/EnumArraysDto.java diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java index 821148b4a6c..6fc3202d404 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/AnotherFakeApi.java @@ -35,7 +35,7 @@ public interface AnotherFakeApi { * PATCH /another-fake/dummy : To test special tags * To test special tags and operation ID starting with number * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -55,7 +55,7 @@ public interface AnotherFakeApi { consumes = { "application/json" } ) default ResponseEntity call123testSpecialTags( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java index 15b781d8629..d169863b104 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeApi.java @@ -45,7 +45,7 @@ public interface FakeApi { * POST /fake/create_xml_item : creates an XmlItem * this route creates an XmlItem * - * @param xmlItem XmlItem Body (required) + * @param xmlItemDto XmlItem Body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -63,7 +63,7 @@ public interface FakeApi { consumes = { "application/xml", "application/xml; charset=utf-8", "application/xml; charset=utf-16", "text/xml", "text/xml; charset=utf-8", "text/xml; charset=utf-16" } ) default ResponseEntity createXmlItem( - @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItem + @ApiParam(value = "XmlItem Body", required = true) @Valid @RequestBody XmlItemDto xmlItemDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,7 +90,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/boolean", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterBooleanSerialize( @ApiParam(value = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body @@ -104,7 +105,7 @@ public interface FakeApi { * POST /fake/outer/composite * Test serialization of object with outer number type * - * @param body Input composite as post body (optional) + * @param outerCompositeDto Input composite as post body (optional) * @return Output composite (status code 200) */ @ApiOperation( @@ -120,10 +121,11 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/composite", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterCompositeSerialize( - @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterCompositeDto body + @ApiParam(value = "Input composite as post body") @Valid @RequestBody(required = false) OuterCompositeDto outerCompositeDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -159,7 +161,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/number", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterNumberSerialize( @ApiParam(value = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body @@ -189,7 +192,8 @@ public interface FakeApi { @RequestMapping( method = RequestMethod.POST, value = "/fake/outer/string", - produces = { "*/*" } + produces = { "*/*" }, + consumes = { "application/json" } ) default ResponseEntity fakeOuterStringSerialize( @ApiParam(value = "Input string as post body") @Valid @RequestBody(required = false) String body @@ -203,7 +207,7 @@ public interface FakeApi { * PUT /fake/body-with-file-schema * For this test, the body for this request much reference a schema named `File`. * - * @param body (required) + * @param fileSchemaTestClassDto (required) * @return Success (status code 200) */ @ApiOperation( @@ -221,7 +225,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testBodyWithFileSchema( - @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto body + @ApiParam(value = "", required = true) @Valid @RequestBody FileSchemaTestClassDto fileSchemaTestClassDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -232,7 +236,7 @@ public interface FakeApi { * PUT /fake/body-with-query-params * * @param query (required) - * @param body (required) + * @param userDto (required) * @return Success (status code 200) */ @ApiOperation( @@ -251,7 +255,7 @@ public interface FakeApi { ) default ResponseEntity testBodyWithQueryParams( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "query", required = true) String query, - @ApiParam(value = "", required = true) @Valid @RequestBody UserDto body + @ApiParam(value = "", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -262,7 +266,7 @@ public interface FakeApi { * PATCH /fake : To test \"client\" model * To test \"client\" model * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -282,7 +286,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testClientModel( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { @@ -443,8 +447,9 @@ public interface FakeApi { /** * POST /fake/inline-additionalProperties : test inline additionalProperties + * * - * @param param request body (required) + * @param requestBody request body (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -462,7 +467,7 @@ public interface FakeApi { consumes = { "application/json" } ) default ResponseEntity testInlineAdditionalProperties( - @ApiParam(value = "request body", required = true) @Valid @RequestBody Map param + @ApiParam(value = "request body", required = true) @Valid @RequestBody Map requestBody ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -471,6 +476,7 @@ public interface FakeApi { /** * GET /fake/jsonFormData : test json serialization of form data + * * * @param param field1 (required) * @param param2 field2 (required) @@ -504,7 +510,6 @@ public interface FakeApi { * To test the collection format in query parameters * * @param pipe (required) - * @param ioutil (required) * @param http (required) * @param url (required) * @param context (required) @@ -525,7 +530,6 @@ public interface FakeApi { ) default ResponseEntity testQueryParameterCollectionFormat( @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "pipe", required = true) List pipe, - @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "ioutil", required = true) List ioutil, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "http", required = true) List http, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "url", required = true) List url, @NotNull @ApiParam(value = "", required = true) @Valid @RequestParam(value = "context", required = true) List context @@ -537,6 +541,7 @@ public interface FakeApi { /** * POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required) + * * * @param petId ID of pet to update (required) * @param requiredFile file to upload (required) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java index 7787e2f3557..35ca94fe7d8 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/FakeClassnameTestApi.java @@ -35,7 +35,7 @@ public interface FakeClassnameTestApi { * PATCH /fake_classname_test : To test class name in snake case * To test class name in snake case * - * @param body client model (required) + * @param clientDto client model (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -58,7 +58,7 @@ public interface FakeClassnameTestApi { consumes = { "application/json" } ) default ResponseEntity testClassname( - @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto body + @ApiParam(value = "client model", required = true) @Valid @RequestBody ClientDto clientDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java index afbe5c099a4..d45f1f96dba 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/PetApi.java @@ -35,8 +35,9 @@ public interface PetApi { /** * POST /pet : Add a new pet to the store + * * - * @param body Pet object that needs to be added to the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid input (status code 405) */ @@ -62,7 +63,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity addPet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -71,6 +72,7 @@ public interface PetApi { /** * DELETE /pet/{petId} : Deletes a pet + * * * @param petId Pet id to delete (required) * @param apiKey (optional) @@ -267,8 +269,9 @@ public interface PetApi { /** * PUT /pet : Update an existing pet + * * - * @param body Pet object that needs to be added to the store (required) + * @param petDto Pet object that needs to be added to the store (required) * @return successful operation (status code 200) * or Invalid ID supplied (status code 400) * or Pet not found (status code 404) @@ -298,7 +301,7 @@ public interface PetApi { consumes = { "application/json", "application/xml" } ) default ResponseEntity updatePet( - @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto body + @ApiParam(value = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody PetDto petDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -307,6 +310,7 @@ public interface PetApi { /** * POST /pet/{petId} : Updates a pet in the store with form data + * * * @param petId ID of pet that needs to be updated (required) * @param name Updated name of the pet (optional) @@ -345,6 +349,7 @@ public interface PetApi { /** * POST /pet/{petId}/uploadImage : uploads an image + * * * @param petId ID of pet to update (required) * @param additionalMetadata Additional data to pass to server (optional) diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java index c1a5207a307..d1e8cad1c07 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/StoreApi.java @@ -145,8 +145,9 @@ public interface StoreApi { /** * POST /store/order : Place an order for a pet + * * - * @param body order placed for purchasing the pet (required) + * @param orderDto order placed for purchasing the pet (required) * @return successful operation (status code 200) * or Invalid Order (status code 400) */ @@ -164,10 +165,11 @@ public interface StoreApi { @RequestMapping( method = RequestMethod.POST, value = "/store/order", - produces = { "application/xml", "application/json" } + produces = { "application/xml", "application/json" }, + consumes = { "application/json" } ) default ResponseEntity placeOrder( - @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto body + @ApiParam(value = "order placed for purchasing the pet", required = true) @Valid @RequestBody OrderDto orderDto ) { getRequest().ifPresent(request -> { for (MediaType mediaType: MediaType.parseMediaTypes(request.getHeader("Accept"))) { diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java index 13e1a4674fa..85dfc6505aa 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/api/UserApi.java @@ -37,7 +37,7 @@ public interface UserApi { * POST /user : Create user * This can only be done by the logged in user. * - * @param body Created user object (required) + * @param userDto Created user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -51,10 +51,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user" + value = "/user", + consumes = { "application/json" } ) default ResponseEntity createUser( - @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto body + @ApiParam(value = "Created user object", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -63,8 +64,9 @@ public interface UserApi { /** * POST /user/createWithArray : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -78,10 +80,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithArray" + value = "/user/createWithArray", + consumes = { "application/json" } ) default ResponseEntity createUsersWithArrayInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -90,8 +93,9 @@ public interface UserApi { /** * POST /user/createWithList : Creates list of users with given input array + * * - * @param body List of user object (required) + * @param userDto List of user object (required) * @return successful operation (status code 200) */ @ApiOperation( @@ -105,10 +109,11 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.POST, - value = "/user/createWithList" + value = "/user/createWithList", + consumes = { "application/json" } ) default ResponseEntity createUsersWithListInput( - @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List body + @ApiParam(value = "List of user object", required = true) @Valid @RequestBody List userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); @@ -147,6 +152,7 @@ public interface UserApi { /** * GET /user/{username} : Get user by user name + * * * @param username The name that needs to be fetched. Use user1 for testing. (required) * @return successful operation (status code 200) @@ -194,6 +200,7 @@ public interface UserApi { /** * GET /user/login : Logs user into the system + * * * @param username The user name for login (required) * @param password The password for login in clear text (required) @@ -227,6 +234,7 @@ public interface UserApi { /** * GET /user/logout : Logs out current logged in user session + * * * @return successful operation (status code 200) */ @@ -256,7 +264,7 @@ public interface UserApi { * This can only be done by the logged in user. * * @param username name that need to be deleted (required) - * @param body Updated user object (required) + * @param userDto Updated user object (required) * @return Invalid user supplied (status code 400) * or User not found (status code 404) */ @@ -272,11 +280,12 @@ public interface UserApi { }) @RequestMapping( method = RequestMethod.PUT, - value = "/user/{username}" + value = "/user/{username}", + consumes = { "application/json" } ) default ResponseEntity updateUser( @ApiParam(value = "name that need to be deleted", required = true) @PathVariable("username") String username, - @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto body + @ApiParam(value = "Updated user object", required = true) @Valid @RequestBody UserDto userDto ) { return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED); diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java index 54cc686549a..fda780a36c3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/AdditionalPropertiesClassDto.java @@ -8,10 +8,13 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; import java.time.OffsetDateTime; import javax.validation.Valid; import javax.validation.constraints.*; @@ -30,41 +33,41 @@ public class AdditionalPropertiesClassDto { @JsonProperty("map_string") @Valid - private Map mapString = null; + private Map mapString = new HashMap<>(); @JsonProperty("map_number") @Valid - private Map mapNumber = null; + private Map mapNumber = new HashMap<>(); @JsonProperty("map_integer") @Valid - private Map mapInteger = null; + private Map mapInteger = new HashMap<>(); @JsonProperty("map_boolean") @Valid - private Map mapBoolean = null; + private Map mapBoolean = new HashMap<>(); @JsonProperty("map_array_integer") @Valid - private Map> mapArrayInteger = null; + private Map> mapArrayInteger = new HashMap<>(); @JsonProperty("map_array_anytype") @Valid - private Map> mapArrayAnytype = null; + private Map> mapArrayAnytype = new HashMap<>(); @JsonProperty("map_map_string") @Valid - private Map> mapMapString = null; + private Map> mapMapString = new HashMap<>(); @JsonProperty("map_map_anytype") @Valid - private Map> mapMapAnytype = null; + private Map> mapMapAnytype = new HashMap<>(); @JsonProperty("anytype_1") private Object anytype1; @JsonProperty("anytype_2") - private Object anytype2; + private JsonNullable anytype2 = JsonNullable.undefined(); @JsonProperty("anytype_3") private Object anytype3; @@ -305,7 +308,7 @@ public class AdditionalPropertiesClassDto { } public AdditionalPropertiesClassDto anytype2(Object anytype2) { - this.anytype2 = anytype2; + this.anytype2 = JsonNullable.of(anytype2); return this; } @@ -315,11 +318,11 @@ public class AdditionalPropertiesClassDto { */ @ApiModelProperty(value = "") - public Object getAnytype2() { + public JsonNullable getAnytype2() { return anytype2; } - public void setAnytype2(Object anytype2) { + public void setAnytype2(JsonNullable anytype2) { this.anytype2 = anytype2; } @@ -360,13 +363,24 @@ public class AdditionalPropertiesClassDto { Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) && Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) && Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) && - Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) && + equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) && Objects.equals(this.anytype3, additionalPropertiesClass.anytype3); } + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; } @Override diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java index 2424bb2cf10..7a49dba2337 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnlyDto.java @@ -29,7 +29,7 @@ public class ArrayOfArrayOfNumberOnlyDto { @JsonProperty("ArrayArrayNumber") @Valid - private List> arrayArrayNumber = null; + private List> arrayArrayNumber = new ArrayList<>(); public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List> arrayArrayNumber) { this.arrayArrayNumber = arrayArrayNumber; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java index 558810f5c49..e40c3d19ce3 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayOfNumberOnlyDto.java @@ -29,7 +29,7 @@ public class ArrayOfNumberOnlyDto { @JsonProperty("ArrayNumber") @Valid - private List arrayNumber = null; + private List arrayNumber = new ArrayList<>(); public ArrayOfNumberOnlyDto arrayNumber(List arrayNumber) { this.arrayNumber = arrayNumber; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java index 179d5c1979e..f57a7567219 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ArrayTestDto.java @@ -29,15 +29,15 @@ public class ArrayTestDto { @JsonProperty("array_of_string") @Valid - private List arrayOfString = null; + private List arrayOfString = new ArrayList<>(); @JsonProperty("array_array_of_integer") @Valid - private List> arrayArrayOfInteger = null; + private List> arrayArrayOfInteger = new ArrayList<>(); @JsonProperty("array_array_of_model") @Valid - private List> arrayArrayOfModel = null; + private List> arrayArrayOfModel = new ArrayList<>(); public ArrayTestDto arrayOfString(List arrayOfString) { this.arrayOfString = arrayOfString; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java new file mode 100644 index 00000000000..cea6d655ab4 --- /dev/null +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/ContainerDefaultValueDto.java @@ -0,0 +1,227 @@ +package org.openapitools.model; + +import java.net.URI; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.jackson.nullable.JsonNullable; +import java.util.NoSuchElementException; +import org.openapitools.jackson.nullable.JsonNullable; +import java.time.OffsetDateTime; +import javax.validation.Valid; +import javax.validation.constraints.*; + + +import java.util.*; +import javax.annotation.Generated; + +/** + * ContainerDefaultValueDto + */ + +@JsonTypeName("ContainerDefaultValue") +@Generated(value = "org.openapitools.codegen.languages.SpringCodegen") +public class ContainerDefaultValueDto { + + @JsonProperty("nullable_array") + @Valid + private JsonNullable> nullableArray = JsonNullable.undefined(); + + @JsonProperty("nullable_required_array") + @Valid + private JsonNullable> nullableRequiredArray = JsonNullable.undefined(); + + @JsonProperty("required_array") + @Valid + private List requiredArray = new ArrayList<>(); + + @JsonProperty("nullable_array_with_default") + @Valid + private JsonNullable> nullableArrayWithDefault = JsonNullable.undefined(); + + /** + * Default constructor + * @deprecated Use {@link ContainerDefaultValueDto#ContainerDefaultValueDto(List, List)} + */ + @Deprecated + public ContainerDefaultValueDto() { + super(); + } + + /** + * Constructor with only required parameters + */ + public ContainerDefaultValueDto(List nullableRequiredArray, List requiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + this.requiredArray = requiredArray; + } + + public ContainerDefaultValueDto nullableArray(List nullableArray) { + this.nullableArray = JsonNullable.of(nullableArray); + return this; + } + + public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) { + if (this.nullableArray == null || !this.nullableArray.isPresent()) { + this.nullableArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableArray.get().add(nullableArrayItem); + return this; + } + + /** + * Get nullableArray + * @return nullableArray + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArray() { + return nullableArray; + } + + public void setNullableArray(JsonNullable> nullableArray) { + this.nullableArray = nullableArray; + } + + public ContainerDefaultValueDto nullableRequiredArray(List nullableRequiredArray) { + this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray); + return this; + } + + public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequiredArrayItem) { + if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) { + this.nullableRequiredArray = JsonNullable.of(new ArrayList<>()); + } + this.nullableRequiredArray.get().add(nullableRequiredArrayItem); + return this; + } + + /** + * Get nullableRequiredArray + * @return nullableRequiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public JsonNullable> getNullableRequiredArray() { + return nullableRequiredArray; + } + + public void setNullableRequiredArray(JsonNullable> nullableRequiredArray) { + this.nullableRequiredArray = nullableRequiredArray; + } + + public ContainerDefaultValueDto requiredArray(List requiredArray) { + this.requiredArray = requiredArray; + return this; + } + + public ContainerDefaultValueDto addRequiredArrayItem(String requiredArrayItem) { + if (this.requiredArray == null) { + this.requiredArray = new ArrayList<>(); + } + this.requiredArray.add(requiredArrayItem); + return this; + } + + /** + * Get requiredArray + * @return requiredArray + */ + @NotNull + @ApiModelProperty(required = true, value = "") + public List getRequiredArray() { + return requiredArray; + } + + public void setRequiredArray(List requiredArray) { + this.requiredArray = requiredArray; + } + + public ContainerDefaultValueDto nullableArrayWithDefault(List nullableArrayWithDefault) { + this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault); + return this; + } + + public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) { + if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) { + this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar"))); + } + this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem); + return this; + } + + /** + * Get nullableArrayWithDefault + * @return nullableArrayWithDefault + */ + + @ApiModelProperty(value = "") + public JsonNullable> getNullableArrayWithDefault() { + return nullableArrayWithDefault; + } + + public void setNullableArrayWithDefault(JsonNullable> nullableArrayWithDefault) { + this.nullableArrayWithDefault = nullableArrayWithDefault; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) o; + return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) && + Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) && + Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) && + equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault); + } + + private static boolean equalsNullable(JsonNullable a, JsonNullable b) { + return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get())); + } + + @Override + public int hashCode() { + return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault)); + } + + private static int hashCodeNullable(JsonNullable a) { + if (a == null) { + return 1; + } + return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ContainerDefaultValueDto {\n"); + sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n"); + sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n"); + sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n"); + sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} + diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java index ef02dec9464..9d6f6c243cb 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/EnumArraysDto.java @@ -102,7 +102,7 @@ public class EnumArraysDto { @JsonProperty("array_enum") @Valid - private List arrayEnum = null; + private List arrayEnum = new ArrayList<>(); public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) { this.justSymbol = justSymbol; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java index 3df831dd0d1..9da0395f194 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/FileSchemaTestClassDto.java @@ -32,7 +32,7 @@ public class FileSchemaTestClassDto { @JsonProperty("files") @Valid - private List<@Valid FileDto> files = null; + private List<@Valid FileDto> files = new ArrayList<>(); public FileSchemaTestClassDto file(FileDto file) { this.file = file; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java index 2d47fa769e0..7edf8258281 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MapTestDto.java @@ -29,7 +29,7 @@ public class MapTestDto { @JsonProperty("map_map_of_string") @Valid - private Map> mapMapOfString = null; + private Map> mapMapOfString = new HashMap<>(); /** * Gets or Sets inner @@ -68,15 +68,15 @@ public class MapTestDto { @JsonProperty("map_of_enum_string") @Valid - private Map mapOfEnumString = null; + private Map mapOfEnumString = new HashMap<>(); @JsonProperty("direct_map") @Valid - private Map directMap = null; + private Map directMap = new HashMap<>(); @JsonProperty("indirect_map") @Valid - private Map indirectMap = null; + private Map indirectMap = new HashMap<>(); public MapTestDto mapMapOfString(Map> mapMapOfString) { this.mapMapOfString = mapMapOfString; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java index d105480477d..c602c9a77e0 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClassDto.java @@ -39,7 +39,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto { @JsonProperty("map") @Valid - private Map map = null; + private Map map = new HashMap<>(); public MixedPropertiesAndAdditionalPropertiesClassDto uuid(UUID uuid) { this.uuid = uuid; diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java index 2a8f59a30af..ea524893059 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/PetDto.java @@ -47,7 +47,7 @@ public class PetDto { @JsonProperty("tags") @Valid - private List<@Valid TagDto> tags = null; + private List<@Valid TagDto> tags = new ArrayList<>(); /** * pet status in the store @@ -169,6 +169,9 @@ public class PetDto { } public PetDto addPhotoUrlsItem(String photoUrlsItem) { + if (this.photoUrls == null) { + this.photoUrls = new LinkedHashSet<>(); + } this.photoUrls.add(photoUrlsItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java index 0214f949034..f5ea44d681a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/SpecialModelNameDto.java @@ -20,7 +20,7 @@ import javax.annotation.Generated; * SpecialModelNameDto */ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @Generated(value = "org.openapitools.codegen.languages.SpringCodegen") public class SpecialModelNameDto { @@ -54,8 +54,8 @@ public class SpecialModelNameDto { if (o == null || getClass() != o.getClass()) { return false; } - SpecialModelNameDto $SpecialModelName = (SpecialModelNameDto) o; - return Objects.equals(this.$SpecialPropertyName, $SpecialModelName.$SpecialPropertyName); + SpecialModelNameDto specialModelName = (SpecialModelNameDto) o; + return Objects.equals(this.$SpecialPropertyName, specialModelName.$SpecialPropertyName); } @Override diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java index 33a4f10606c..465fb77c08c 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderDefaultDto.java @@ -31,17 +31,17 @@ public class TypeHolderDefaultDto { private String stringItem = "what"; @JsonProperty("number_item") - private BigDecimal numberItem; + private BigDecimal numberItem = new BigDecimal("1.234"); @JsonProperty("integer_item") - private Integer integerItem; + private Integer integerItem = -2; @JsonProperty("bool_item") private Boolean boolItem = true; @JsonProperty("array_item") @Valid - private List arrayItem = new ArrayList<>(); + private List arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); /** * Default constructor @@ -145,6 +145,9 @@ public class TypeHolderDefaultDto { } public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3)); + } this.arrayItem.add(arrayItemItem); return this; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java index 396dab179f4..15dc401681a 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/TypeHolderExampleDto.java @@ -168,6 +168,9 @@ public class TypeHolderExampleDto { } public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) { + if (this.arrayItem == null) { + this.arrayItem = new ArrayList<>(); + } this.arrayItem.add(arrayItemItem); return this; } @@ -177,7 +180,7 @@ public class TypeHolderExampleDto { * @return arrayItem */ @NotNull - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") + @ApiModelProperty(example = "[0,1,2,3]", required = true, value = "") public List getArrayItem() { return arrayItem; } diff --git a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java index cbc3d3a1aea..f93e04f2759 100644 --- a/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java +++ b/samples/server/petstore/springboot/src/main/java/org/openapitools/model/XmlItemDto.java @@ -41,7 +41,7 @@ public class XmlItemDto { @JsonProperty("wrapped_array") @Valid - private List wrappedArray = null; + private List wrappedArray = new ArrayList<>(); @JsonProperty("name_string") private String nameString; @@ -57,11 +57,11 @@ public class XmlItemDto { @JsonProperty("name_array") @Valid - private List nameArray = null; + private List nameArray = new ArrayList<>(); @JsonProperty("name_wrapped_array") @Valid - private List nameWrappedArray = null; + private List nameWrappedArray = new ArrayList<>(); @JsonProperty("prefix_string") private String prefixString; @@ -77,11 +77,11 @@ public class XmlItemDto { @JsonProperty("prefix_array") @Valid - private List prefixArray = null; + private List prefixArray = new ArrayList<>(); @JsonProperty("prefix_wrapped_array") @Valid - private List prefixWrappedArray = null; + private List prefixWrappedArray = new ArrayList<>(); @JsonProperty("namespace_string") private String namespaceString; @@ -97,11 +97,11 @@ public class XmlItemDto { @JsonProperty("namespace_array") @Valid - private List namespaceArray = null; + private List namespaceArray = new ArrayList<>(); @JsonProperty("namespace_wrapped_array") @Valid - private List namespaceWrappedArray = null; + private List namespaceWrappedArray = new ArrayList<>(); @JsonProperty("prefix_ns_string") private String prefixNsString; @@ -117,11 +117,11 @@ public class XmlItemDto { @JsonProperty("prefix_ns_array") @Valid - private List prefixNsArray = null; + private List prefixNsArray = new ArrayList<>(); @JsonProperty("prefix_ns_wrapped_array") @Valid - private List prefixNsWrappedArray = null; + private List prefixNsWrappedArray = new ArrayList<>(); public XmlItemDto attributeString(String attributeString) { this.attributeString = attributeString; diff --git a/samples/server/petstore/springboot/src/main/resources/openapi.yaml b/samples/server/petstore/springboot/src/main/resources/openapi.yaml index dd15cd15820..c2cce49a800 100644 --- a/samples/server/petstore/springboot/src/main/resources/openapi.yaml +++ b/samples/server/petstore/springboot/src/main/resources/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.1 +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:\ @@ -20,23 +20,14 @@ tags: paths: /pet: post: + description: "" 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: {} description: successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,35 +36,23 @@ paths: summary: Add a new pet to the store tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: - tag: pet put: + description: "" 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: {} description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -82,7 +61,6 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -122,7 +100,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -169,7 +146,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -183,25 +159,29 @@ paths: - tag: pet /pet/{petId}: delete: + description: "" 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: "200": - content: {} description: successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -218,12 +198,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: @@ -235,10 +217,8 @@ paths: $ref: '#/components/schemas/Pet' description: successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found security: - api_key: [] @@ -249,15 +229,18 @@ paths: x-tags: - tag: pet post: + description: "" operationId: updatePetWithForm parameters: - description: ID of pet that needs to be updated + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: application/x-www-form-urlencoded: @@ -265,7 +248,6 @@ paths: $ref: '#/components/schemas/updatePetWithForm_request' responses: "405": - content: {} description: Invalid input security: - petstore_auth: @@ -280,15 +262,18 @@ paths: - tag: pet /pet/{petId}/uploadImage: post: + description: "" operationId: uploadFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: @@ -336,10 +321,11 @@ paths: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -355,13 +341,11 @@ paths: $ref: '#/components/schemas/Order' description: successful operation "400": - content: {} description: Invalid Order summary: Place an order for a pet tags: - store - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: store @@ -372,17 +356,17 @@ paths: 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": - content: {} description: Invalid ID supplied "404": - content: {} description: Order not found summary: Delete purchase order by ID tags: @@ -396,6 +380,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -404,6 +389,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -415,10 +401,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: @@ -432,87 +416,74 @@ paths: operationId: createUser requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/User' description: Created user object required: true responses: default: - content: {} description: successful operation summary: Create user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithArray: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/createWithList: post: + description: "" 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 summary: Creates list of users with given input array tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user /user/login: get: + description: "" operationId: loginUser parameters: - description: The user name for login + explode: true in: query name: username required: true schema: type: string + style: form - description: The password for login in clear text + explode: true in: query name: password required: true schema: type: string + style: form responses: "200": content: @@ -526,16 +497,19 @@ paths: 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": - content: {} description: Invalid username/password supplied summary: Logs user into the system tags: @@ -545,10 +519,10 @@ paths: - tag: user /user/logout: get: + description: "" operationId: logoutUser responses: default: - content: {} description: successful operation summary: Logs out current logged in user session tags: @@ -562,17 +536,17 @@ 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 summary: Delete user tags: @@ -581,14 +555,17 @@ paths: x-tags: - tag: user get: + description: "" operationId: getUserByName parameters: - description: The name that needs to be fetched. Use user1 for testing. + explode: false in: path name: username required: true schema: type: string + style: simple responses: "200": content: @@ -600,10 +577,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: @@ -616,30 +591,29 @@ 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 summary: Updated user tags: - user - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: application/json x-tags: - tag: user @@ -648,12 +622,7 @@ paths: description: To test class name in snake case operationId: testClassname requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -666,7 +635,6 @@ paths: summary: To test class name in snake case tags: - fake_classname_tags 123#$%^ - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -677,43 +645,57 @@ paths: 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": - content: {} description: Something wrong summary: Fake endpoint to test group parameters (optional) tags: @@ -730,6 +712,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -740,8 +723,10 @@ paths: type: array style: simple - description: Header parameter enum test (string) + explode: false in: header name: enum_header_string + required: false schema: default: -efg enum: @@ -749,10 +734,12 @@ paths: - -efg - (xyz) type: string + style: simple - description: Query parameter enum test (string array) - explode: false + explode: true in: query name: enum_query_string_array + required: false schema: items: default: $ @@ -763,8 +750,10 @@ paths: type: array style: form - description: Query parameter enum test (string) + explode: true in: query name: enum_query_string + required: false schema: default: -efg enum: @@ -772,24 +761,31 @@ paths: - -efg - (xyz) type: string + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_integer + required: false schema: enum: - 1 - -2 format: int32 type: integer + style: form - description: Query parameter enum test (double) + explode: true in: query name: enum_query_double + required: false schema: enum: - 1.1 - -1.2 format: double type: number + style: form requestBody: content: application/x-www-form-urlencoded: @@ -797,10 +793,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -813,12 +807,7 @@ paths: description: To test "client" model operationId: testClientModel requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -829,7 +818,6 @@ paths: summary: To test "client" model tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -846,13 +834,10 @@ paths: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testEndpointParameters_request' - required: true responses: "400": - content: {} description: Invalid username supplied "404": - content: {} description: User not found security: - http_basic_test: [] @@ -873,11 +858,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -887,8 +871,7 @@ paths: description: Output number tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -898,11 +881,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -912,8 +894,7 @@ paths: description: Output string tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -923,11 +904,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -937,8 +917,7 @@ paths: description: Output boolean tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake @@ -948,11 +927,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -962,23 +940,21 @@ paths: description: Output composite tags: - fake - x-codegen-request-body-name: body - x-content-type: '*/*' + x-content-type: application/json x-accepts: '*/*' x-tags: - tag: fake /fake/jsonFormData: get: + description: "" operationId: testJsonFormData requestBody: content: application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/testJsonFormData_request' - required: true responses: "200": - content: {} description: successful operation summary: test json serialization of form data tags: @@ -989,6 +965,7 @@ paths: - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1001,12 +978,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: test inline additionalProperties tags: - fake - x-codegen-request-body-name: param x-content-type: application/json x-accepts: application/json x-tags: @@ -1015,11 +990,13 @@ paths: put: operationId: testBodyWithQueryParams parameters: - - in: query + - explode: true + in: query name: query required: true schema: type: string + style: form requestBody: content: application/json: @@ -1028,11 +1005,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1065,12 +1040,10 @@ paths: required: true responses: "200": - content: {} description: successful operation summary: creates an XmlItem tags: - fake - x-codegen-request-body-name: XmlItem x-content-type: application/xml x-accepts: application/json x-tags: @@ -1080,12 +1053,7 @@ paths: description: To test special tags and operation ID starting with number operationId: 123_test_@#$%_special_tags requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Client' - description: client model - required: true + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1096,7 +1064,6 @@ paths: summary: To test special tags tags: - $another-fake? - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1114,11 +1081,9 @@ paths: required: true responses: "200": - content: {} description: Success tags: - fake - x-codegen-request-body-name: body x-content-type: application/json x-accepts: application/json x-tags: @@ -1128,7 +1093,7 @@ paths: description: To test the collection format in query parameters operationId: testQueryParameterCollectionFormat parameters: - - explode: false + - explode: true in: query name: pipe required: true @@ -1137,14 +1102,8 @@ paths: type: string type: array style: form - - in: query - name: ioutil - required: true - schema: - items: - type: string - type: array - - in: query + - explode: false + in: query name: http required: true schema: @@ -1172,7 +1131,6 @@ paths: style: form responses: "200": - content: {} description: Success tags: - fake @@ -1181,21 +1139,23 @@ paths: - tag: fake /fake/{petId}/uploadImageWithRequiredFile: post: + description: "" operationId: uploadFileWithRequiredFile parameters: - description: ID of pet to update + explode: false in: path name: petId required: true schema: format: int64 type: integer + style: simple requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/uploadFileWithRequiredFile_request' - required: true responses: "200": content: @@ -1215,6 +1175,33 @@ paths: x-tags: - tag: pet 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 schemas: Order: example: @@ -1355,6 +1342,7 @@ components: name: tag wrapped: true status: + deprecated: true description: pet status in the store enum: - available @@ -1381,21 +1369,12 @@ components: message: type: string type: object - $special[model.name]: - properties: - $special[property.name]: - format: int64 - type: integer - type: object - xml: - name: "$special[model.name]" Return: description: Model for testing reserved words properties: return: format: int32 type: integer - type: object xml: name: Return Name: @@ -1415,7 +1394,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1426,7 +1404,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1434,7 +1411,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1496,7 +1472,6 @@ components: type: string byte: format: byte - pattern: "^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$" type: string binary: format: binary @@ -1590,7 +1565,6 @@ components: map_array_anytype: additionalProperties: items: - properties: {} type: object type: array type: object @@ -1603,15 +1577,12 @@ components: map_map_anytype: additionalProperties: additionalProperties: - properties: {} type: object type: object type: object anytype_1: - properties: {} - type: object - anytype_2: type: object + anytype_2: {} anytype_3: properties: {} type: object @@ -1647,7 +1618,6 @@ components: AdditionalPropertiesArray: additionalProperties: items: - properties: {} type: object type: array properties: @@ -1657,7 +1627,6 @@ components: AdditionalPropertiesObject: additionalProperties: additionalProperties: - properties: {} type: object type: object properties: @@ -1666,7 +1635,6 @@ components: type: object AdditionalPropertiesAnyType: additionalProperties: - properties: {} type: object properties: name: @@ -1864,13 +1832,20 @@ components: default: what type: string number_item: + default: 1.234 type: number integer_item: + default: -2 type: integer bool_item: default: true type: boolean array_item: + default: + - 0 + - 1 + - 2 + - 3 items: type: integer type: array @@ -2095,6 +2070,42 @@ components: xml: namespace: http://a.com/schema prefix: pre + _special_model.name_: + properties: + $special[property.name]: + format: int64 + type: integer + xml: + name: "$special[model.name]" + ContainerDefaultValue: + properties: + nullable_array: + items: + type: string + nullable: true + type: array + nullable_required_array: + items: + type: string + nullable: true + type: array + required_array: + items: + type: string + nullable: false + type: array + nullable_array_with_default: + default: + - foo + - bar + items: + type: string + nullable: true + type: array + required: + - nullable_required_array + - required_array + type: object updatePetWithForm_request: properties: name: @@ -2138,7 +2149,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2274,4 +2284,3 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0"