From 2377d98de3b38a105fc970e8a97282fafb8a48ad Mon Sep 17 00:00:00 2001 From: William Cheng Date: Tue, 7 May 2024 16:42:27 +0800 Subject: [PATCH 1/4] update samples --- samples/documentation/html2/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index 192377211d37..4a8a3c3e0ff7 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -9524,19 +9524,19 @@

Description - SetDashCookie + SetMinusCookie String Cookie authentication key for use with the `api_key` apiKey authentication. - XDashRateDashLimit + XMinusRateMinusLimit Integer int32 calls per hour allowed by the user - XDashExpiresDashAfter + XMinusExpiresMinusAfter Date date-time date in UTC when token expires From f89bf91e7edbb923326afa29089016e6ae9262b0 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 May 2024 16:51:52 +0800 Subject: [PATCH 2/4] fix nullable, better test (jaxrs-spec) --- bin/configs/jaxrs-spec.yaml | 2 +- .../languages/AbstractJavaCodegen.java | 4 +- .../resources/JavaJaxRS/spec/pom.mustache | 12 +- ...ith-fake-endpoints-models-for-testing.yaml | 2063 +++++++++++++++++ .../jaxrs-spec/.openapi-generator/FILES | 28 +- samples/server/petstore/jaxrs-spec/pom.xml | 6 + .../org/openapitools/api/AnotherFakeApi.java | 3 +- .../java/org/openapitools/api/FakeApi.java | 139 +- .../api/FakeClassnameTestApi.java | 2 +- .../gen/java/org/openapitools/api/FooApi.java | 33 + .../gen/java/org/openapitools/api/PetApi.java | 11 +- .../java/org/openapitools/api/StoreApi.java | 3 +- .../java/org/openapitools/api/UserApi.java | 12 +- .../model/AdditionalPropertiesClass.java | 440 +--- .../model/AdditionalPropertiesInteger.java | 86 - .../model/AdditionalPropertiesNumber.java | 87 - .../model/AdditionalPropertiesObject.java | 86 - .../model/AdditionalPropertiesString.java | 86 - .../model/AllOfWithSingleRef.java | 147 ++ .../java/org/openapitools/model/Animal.java | 5 +- .../org/openapitools/model/ArrayTest.java | 2 +- .../java/org/openapitools/model/BigCat.java | 165 -- .../openapitools/model/ChildWithNullable.java | 119 + ...ertiesArray.java => DeprecatedObject.java} | 55 +- .../java/org/openapitools/model/EnumTest.java | 92 +- .../model/FakeBigDecimalMap200Response.java | 166 ++ ...itionalPropertiesBoolean.java => Foo.java} | 72 +- .../model/FooGetDefaultResponse.java | 120 + .../org/openapitools/model/FormatTest.java | 94 +- .../openapitools/model/HealthCheckResult.java | 121 + .../org/openapitools/model/NullableClass.java | 431 ++++ .../model/ObjectWithDeprecatedFields.java | 223 ++ .../org/openapitools/model/OuterEnum.java | 4 +- .../model/OuterEnumDefaultValue.java | 59 + .../openapitools/model/OuterEnumInteger.java | 59 + .../model/OuterEnumIntegerDefaultValue.java | 59 + .../model/OuterObjectWithEnumProperty.java | 119 + .../model/ParentWithNullable.java | 201 ++ .../org/openapitools/model/SingleRefType.java | 57 + .../openapitools/model/SpecialModelName.java | 6 +- ...eFreeformAdditionalPropertiesRequest.java} | 33 +- .../openapitools/model/TypeHolderDefault.java | 250 -- .../openapitools/model/TypeHolderExample.java | 278 --- .../java/org/openapitools/model/XmlItem.java | 1050 --------- .../jaxrs-spec/src/main/openapi/openapi.yaml | 1191 +++++----- 45 files changed, 5143 insertions(+), 3138 deletions(-) create mode 100644 modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FooApi.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ChildWithNullable.java rename samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/{AdditionalPropertiesArray.java => DeprecatedObject.java} (57%) create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java rename samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/{AdditionalPropertiesBoolean.java => Foo.java} (53%) create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/HealthCheckResult.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NullableClass.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumInteger.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ParentWithNullable.java create mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SingleRefType.java rename samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/{AdditionalPropertiesAnyType.java => TestInlineFreeformAdditionalPropertiesRequest.java} (58%) delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java delete mode 100644 samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java diff --git a/bin/configs/jaxrs-spec.yaml b/bin/configs/jaxrs-spec.yaml index dbbb86bb4208..0eca24e42590 100644 --- a/bin/configs/jaxrs-spec.yaml +++ b/bin/configs/jaxrs-spec.yaml @@ -1,6 +1,6 @@ generatorName: jaxrs-spec outputDir: samples/server/petstore/jaxrs-spec -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/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml templateDir: modules/openapi-generator/src/main/resources/JavaJaxRS/spec additionalProperties: artifactId: jaxrs-spec-petstore-server diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java index 7e8a93d919f0..d860a344b2a1 100644 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/AbstractJavaCodegen.java @@ -607,7 +607,9 @@ public void processOpts() { importMapping.put("JsonIgnore", "com.fasterxml.jackson.annotation.JsonIgnore"); importMapping.put("JsonIgnoreProperties", "com.fasterxml.jackson.annotation.JsonIgnoreProperties"); importMapping.put("JsonInclude", "com.fasterxml.jackson.annotation.JsonInclude"); - importMapping.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable"); + if (openApiNullable) { + importMapping.put("JsonNullable", "org.openapitools.jackson.nullable.JsonNullable"); + } importMapping.put("SerializedName", "com.google.gson.annotations.SerializedName"); importMapping.put("TypeAdapter", "com.google.gson.TypeAdapter"); importMapping.put("JsonAdapter", "com.google.gson.annotations.JsonAdapter"); diff --git a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache index 65a46053d534..f44c6083fdd3 100644 --- a/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache +++ b/modules/openapi-generator/src/main/resources/JavaJaxRS/spec/pom.mustache @@ -162,7 +162,14 @@ ${beanvalidation-version} provided -{{/useBeanValidation}} + {{/useBeanValidation}} + {{#openApiNullable}} + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + + {{/openApiNullable}} 1.8 @@ -192,5 +199,8 @@ {{^useJakartaEe}} 2.1.6 {{/useJakartaEe}} +{{#openApiNullable}} + 0.2.6 +{{/openApiNullable}} diff --git a/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml new file mode 100644 index 000000000000..28b35f470715 --- /dev/null +++ b/modules/openapi-generator/src/test/resources/3_0/jaxrs-spec/petstore-with-fake-endpoints-models-for-testing.yaml @@ -0,0 +1,2063 @@ +openapi: 3.0.0 +info: + description: >- + This spec is mainly for testing Petstore server and contains fake endpoints, + models. Please do not use this for any other purpose. Special characters: " + \ + version: 1.0.0 + title: OpenAPI Petstore + license: + name: Apache-2.0 + url: 'https://www.apache.org/licenses/LICENSE-2.0.html' +tags: + - name: pet + description: Everything about your Pets + - name: store + description: Access to Petstore orders + - name: user + description: Operations about user +paths: + /foo: + get: + responses: + default: + description: response + content: + application/json: + schema: + type: object + properties: + string: + $ref: '#/components/schemas/Foo' + /pet: + servers: + - url: 'http://petstore.swagger.io/v2' + - url: 'http://path-server-test.petstore.local/v2' + - url: 'http://{server}.swagger.io:{port}/v2' + description: test server with variables + variables: + server: + description: target server + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + post: + tags: + - pet + summary: Add a new pet to the store + description: '' + operationId: addPet + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + put: + tags: + - pet + summary: Update an existing pet + description: '' + operationId: updatePet + x-webclient-blocking: true + responses: + '200': + description: Successful operation + '400': + description: Invalid ID supplied + '404': + description: Pet not found + '405': + description: Validation exception + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + $ref: '#/components/requestBodies/Pet' + /pet/findByStatus: + get: + tags: + - pet + summary: Finds Pets by status + description: Multiple status values can be provided with comma separated strings + operationId: findPetsByStatus + x-webclient-blocking: true + parameters: + - name: status + in: query + description: Status values that need to be considered for filter + required: true + style: form + explode: false + deprecated: true + schema: + type: array + items: + type: string + enum: + - available + - pending + - sold + default: available + responses: + '200': + description: successful operation + content: + application/xml: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid status value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + /pet/findByTags: + get: + tags: + - pet + summary: Finds Pets by tags + description: >- + Multiple tags can be provided with comma separated strings. Use tag1, + tag2, tag3 for testing. + operationId: findPetsByTags + x-webclient-blocking: true + parameters: + - 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: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/Pet' + uniqueItems: true + '400': + description: Invalid tag value + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + deprecated: true + '/pet/{petId}': + get: + tags: + - pet + summary: Find pet by ID + description: Returns a single pet + operationId: getPetById + x-webclient-blocking: true + parameters: + - name: petId + in: path + description: ID of pet to return + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Pet' + application/json: + schema: + $ref: '#/components/schemas/Pet' + '400': + description: Invalid ID supplied + '404': + description: Pet not found + security: + - api_key: [] + post: + tags: + - pet + summary: Updates a pet in the store with form data + description: '' + operationId: updatePetWithForm + parameters: + - name: petId + in: path + description: ID of pet that needs to be updated + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: Successful operation + '405': + description: Invalid input + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + name: + description: Updated name of the pet + type: string + status: + description: Updated status of the pet + type: string + delete: + tags: + - pet + summary: Deletes a pet + description: '' + operationId: deletePet + parameters: + - name: api_key + in: header + required: false + schema: + type: string + - name: petId + in: path + description: Pet id to delete + required: true + schema: + type: integer + format: int64 + responses: + '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: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + file: + description: file to upload + type: string + format: binary + /store/inventory: + get: + tags: + - store + summary: Returns pet inventories by status + description: Returns a map of status codes to quantities + operationId: getInventory + x-webclient-blocking: false + responses: + '200': + description: successful operation + content: + application/json: + schema: + type: object + additionalProperties: + type: integer + format: int32 + security: + - api_key: [] + /store/order: + post: + tags: + - store + summary: Place an order for a pet + description: '' + operationId: placeOrder + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid Order + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/Order' + description: order placed for purchasing the pet + required: true + '/store/order/{order_id}': + get: + tags: + - store + summary: Find purchase order by ID + description: >- + For valid response try integer IDs with value <= 5 or > 10. Other values + will generate exceptions + operationId: getOrderById + parameters: + - name: order_id + in: path + description: ID of pet that needs to be fetched + required: true + schema: + type: integer + format: int64 + minimum: 1 + maximum: 5 + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/Order' + application/json: + schema: + $ref: '#/components/schemas/Order' + '400': + description: Invalid ID supplied + '404': + description: Order not found + delete: + tags: + - store + summary: Delete purchase order by ID + description: >- + For valid response try integer IDs with value < 1000. Anything above + 1000 or nonintegers will generate API errors + operationId: deleteOrder + parameters: + - name: order_id + in: path + description: ID of the order that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid ID supplied + '404': + description: Order not found + /user: + post: + tags: + - user + summary: Create user + description: This can only be done by the logged in user. + operationId: createUser + responses: + default: + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Created user object + required: true + /user/createWithArray: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithArrayInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/createWithList: + post: + tags: + - user + summary: Creates list of users with given input array + description: '' + operationId: createUsersWithListInput + responses: + default: + description: successful operation + requestBody: + $ref: '#/components/requestBodies/UserArray' + /user/login: + get: + tags: + - user + summary: Logs user into the system + description: '' + operationId: loginUser + parameters: + - name: username + in: query + description: The user name for login + required: true + schema: + type: string + - name: password + in: query + description: The password for login in clear text + required: true + schema: + type: string + responses: + '200': + description: successful operation + headers: + X-Rate-Limit: + description: calls per hour allowed by the user + schema: + type: integer + format: int32 + X-Expires-After: + description: date in UTC when token expires + schema: + type: string + format: date-time + content: + application/xml: + schema: + type: string + application/json: + schema: + type: string + '400': + description: Invalid username/password supplied + /user/logout: + get: + tags: + - user + summary: Logs out current logged in user session + description: '' + operationId: logoutUser + responses: + default: + description: successful operation + '/user/{username}': + get: + tags: + - user + summary: Get user by user name + description: '' + operationId: getUserByName + parameters: + - name: username + in: path + description: The name that needs to be fetched. Use user1 for testing. + required: true + schema: + type: string + responses: + '200': + description: successful operation + content: + application/xml: + schema: + $ref: '#/components/schemas/User' + application/json: + schema: + $ref: '#/components/schemas/User' + '400': + description: Invalid username supplied + '404': + description: User not found + put: + tags: + - user + summary: Updated user + description: This can only be done by the logged in user. + operationId: updateUser + parameters: + - name: username + in: path + description: name that need to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid user supplied + '404': + description: User not found + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + description: Updated user object + required: true + delete: + tags: + - user + summary: Delete user + description: This can only be done by the logged in user. + operationId: deleteUser + parameters: + - name: username + in: path + description: The name that needs to be deleted + required: true + schema: + type: string + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + /fake_classname_test: + patch: + tags: + - 'fake_classname_tags 123#$%^' + summary: To test class name in snake case + description: To test class name in snake case + operationId: testClassname + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + security: + - api_key_query: [] + requestBody: + $ref: '#/components/requestBodies/Client' + /fake: + patch: + tags: + - fake + summary: To test "client" model + description: To test "client" model + operationId: testClientModel + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + get: + tags: + - fake + summary: To test enum parameters + description: To test enum parameters + operationId: testEnumParameters + parameters: + - name: enum_header_string_array + in: header + description: Header parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_header_string + in: header + description: Header parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_string_array + in: query + description: Query parameter enum test (string array) + schema: + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + - name: enum_query_string + in: query + description: Query parameter enum test (string) + schema: + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + - name: enum_query_integer + in: query + description: Query parameter enum test (double) + schema: + type: integer + format: int32 + enum: + - 1 + - -2 + - name: enum_query_double + in: query + description: Query parameter enum test (double) + schema: + type: number + format: double + enum: + - 1.1 + - -1.2 + - name: enum_query_model_array + in: query + schema: + type: array + items: + $ref: '#/components/schemas/EnumClass' + responses: + '400': + description: Invalid request + '404': + description: Not found + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + enum_form_string_array: + description: Form parameter enum test (string array) + type: array + items: + type: string + default: $ + enum: + - '>' + - $ + enum_form_string: + description: Form parameter enum test (string) + type: string + enum: + - _abc + - '-efg' + - (xyz) + default: '-efg' + post: + tags: + - fake + summary: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + description: | + Fake endpoint for testing various parameters + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 + operationId: testEndpointParameters + responses: + '400': + description: Invalid username supplied + '404': + description: User not found + security: + - http_basic_test: [] + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + integer: + description: None + type: integer + minimum: 10 + maximum: 100 + int32: + description: None + type: integer + format: int32 + minimum: 20 + maximum: 200 + int64: + description: None + type: integer + format: int64 + number: + description: None + type: number + minimum: 32.1 + maximum: 543.2 + float: + description: None + type: number + format: float + maximum: 987.6 + double: + description: None + type: number + format: double + minimum: 67.8 + maximum: 123.4 + string: + description: None + type: string + pattern: '/[a-z]/i' + pattern_without_delimiter: + description: None + type: string + pattern: '^[A-Z].*' + byte: + description: None + type: string + format: byte + binary: + description: None + type: string + format: binary + date: + description: None + type: string + format: date + dateTime: + description: None + type: string + format: date-time + password: + description: None + type: string + format: password + minLength: 10 + maxLength: 64 + callback: + description: None + type: string + required: + - number + - double + - pattern_without_delimiter + - byte + delete: + tags: + - fake + security: + - bearer_test: [] + summary: Fake endpoint to test group parameters (optional) + description: Fake endpoint to test group parameters (optional) + operationId: testGroupParameters + x-group-parameters: true + parameters: + - name: required_string_group + in: query + description: Required String in group parameters + required: true + schema: + type: integer + - name: required_boolean_group + in: header + description: Required Boolean in group parameters + required: true + schema: + type: boolean + - name: required_int64_group + in: query + description: Required Integer in group parameters + required: true + schema: + type: integer + format: int64 + - name: string_group + in: query + description: String in group parameters + schema: + type: integer + - name: boolean_group + in: header + description: Boolean in group parameters + schema: + type: boolean + - name: int64_group + in: query + description: Integer in group parameters + schema: + type: integer + format: int64 + responses: + '400': + description: Something wrong + /fake/outer/number: + post: + tags: + - fake + description: Test serialization of outer number types + operationId: fakeOuterNumberSerialize + responses: + '200': + description: Output number + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterNumber' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterNumber' + description: Input number as post body + /fake/property/enum-int: + post: + tags: + - fake + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + responses: + '200': + description: Output enum (int) + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + /fake/outer/string: + post: + tags: + - fake + description: Test serialization of outer string types + operationId: fakeOuterStringSerialize + responses: + '200': + description: Output string + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterString' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterString' + description: Input string as post body + /fake/outer/boolean: + post: + tags: + - fake + description: Test serialization of outer boolean types + operationId: fakeOuterBooleanSerialize + responses: + '200': + description: Output boolean + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterBoolean' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterBoolean' + description: Input boolean as post body + /fake/outer/composite: + post: + tags: + - fake + description: Test serialization of object with outer number type + operationId: fakeOuterCompositeSerialize + responses: + '200': + description: Output composite + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterComposite' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterComposite' + description: Input composite as post body + /fake/BigDecimalMap: + get: + tags: + - fake + description: for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys + operationId: fakeBigDecimalMap + responses: + '200': + description: successful operation + content: + '*/*': + schema: + type: object + properties: + someId: + type: number + someMap: + type: object + additionalProperties: + type: number + /fake/jsonFormData: + get: + tags: + - fake + summary: test json serialization of form data + description: '' + operationId: testJsonFormData + responses: + '200': + description: successful operation + requestBody: + content: + application/x-www-form-urlencoded: + schema: + type: object + properties: + param: + description: field1 + type: string + param2: + description: field2 + type: string + required: + - param + - param2 + /fake/additionalProperties-reference: + post: + tags: + - fake + summary: test referenced additionalProperties + description: '' + operationId: testAdditionalPropertiesReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + /fake/stringMap-reference: + post: + tags: + - fake + summary: test referenced string map + description: '' + operationId: testStringMapReference + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + /fake/inline-additionalProperties: + post: + tags: + - fake + summary: test inline additionalProperties + description: '' + operationId: testInlineAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + additionalProperties: + type: string + description: request body + required: true + /fake/inline-freeform-additionalProperties: + post: + tags: + - fake + summary: test inline free-form additionalProperties + description: '' + operationId: testInlineFreeformAdditionalProperties + responses: + '200': + description: successful operation + requestBody: + content: + application/json: + schema: + type: object + properties: + someProperty: + type: string + additionalProperties: true + description: request body + required: true + /fake/nullable: + post: + tags: + - fake + summary: test nullable parent property + description: "" + operationId: testNullable + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ChildWithNullable' + description: request body + required: true + responses: + "200": + description: successful operation + /fake/body-with-query-params: + put: + tags: + - fake + operationId: testBodyWithQueryParams + parameters: + - name: query + in: query + required: true + schema: + type: string + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/User' + required: true + /another-fake/dummy: + patch: + tags: + - $another-fake? + summary: To test special tags + description: To test special tags and operation ID starting with number + operationId: '123_test_@#$%_special_tags' + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + requestBody: + $ref: '#/components/requestBodies/Client' + /fake/body-with-file-schema: + put: + tags: + - fake + description: >- + For this test, the body for this request must reference a schema named + `File`. + operationId: testBodyWithFileSchema + responses: + '200': + description: Success + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FileSchemaTestClass' + required: true + /fake/body-with-binary: + put: + tags: + - fake + description: >- + For this test, the body has to be a binary file. + operationId: testBodyWithBinary + responses: + '200': + description: Success + requestBody: + content: + image/png: + schema: + type: string + nullable: true + format: binary + description: image to upload + required: true + /fake/test-query-parameters: + put: + tags: + - fake + description: To test the collection format in query parameters + operationId: testQueryParameterCollectionFormat + parameters: + - name: pipe + in: query + required: true + style: pipeDelimited + schema: + type: array + items: + type: string + - name: ioutil + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: http + in: query + required: true + style: spaceDelimited + schema: + type: array + items: + type: string + - name: url + in: query + required: true + style: form + explode: false + schema: + type: array + items: + type: string + - name: context + in: query + required: true + explode: true + schema: + type: array + items: + type: string + - name: language + in: query + required: false + schema: + type: object + additionalProperties: + type: string + format: string + - name: allowEmpty + in: query + required: true + allowEmptyValue: true + schema: + type: string + responses: + "200": + description: Success + '/fake/{petId}/uploadImageWithRequiredFile': + post: + tags: + - pet + summary: uploads an image (required) + description: '' + operationId: uploadFileWithRequiredFile + parameters: + - name: petId + in: path + description: ID of pet to update + required: true + schema: + type: integer + format: int64 + responses: + '200': + description: successful operation + content: + application/json: + schema: + $ref: '#/components/schemas/ApiResponse' + security: + - petstore_auth: + - 'write:pets' + - 'read:pets' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + additionalMetadata: + description: Additional data to pass to server + type: string + requiredFile: + description: file to upload + type: string + format: binary + required: + - requiredFile + /fake/health: + get: + tags: + - fake + summary: Health check endpoint + responses: + 200: + description: The instance started successfully + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + /fake/http-signature-test: + get: + tags: + - fake + summary: test http signature authentication + operationId: fake-http-signature-test + parameters: + - name: query_1 + in: query + description: query parameter + required: optional + schema: + type: string + - name: header_1 + in: header + description: header parameter + required: optional + schema: + type: string + security: + - http_signature_test: [] + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + 200: + description: The instance started successfully +servers: + - url: 'http://{server}.swagger.io:{port}/v2' + description: petstore server + variables: + server: + enum: + - 'petstore' + - 'qa-petstore' + - 'dev-petstore' + default: 'petstore' + port: + enum: + - 80 + - 8080 + default: 80 + - url: https://localhost:8080/{version} + description: The local server + variables: + version: + enum: + - 'v1' + - 'v2' + default: 'v2' + - url: https://127.0.0.1/no_varaible + description: The local server without variables +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 + bearer_test: + type: http + scheme: bearer + bearerFormat: JWT + http_signature_test: + type: http + scheme: signature + schemas: + Foo: + type: object + properties: + bar: + $ref: '#/components/schemas/Bar' + Bar: + type: string + default: bar + Order: + type: object + properties: + id: + type: integer + format: int64 + petId: + type: integer + format: int64 + quantity: + type: integer + format: int32 + shipDate: + type: string + format: date-time + status: + type: string + description: Order Status + enum: + - placed + - approved + - delivered + complete: + type: boolean + default: false + xml: + name: Order + Category: + type: object + required: + - name + properties: + id: + type: integer + format: int64 + name: + type: string + default: default-name + xml: + name: Category + User: + type: object + properties: + id: + type: integer + format: int64 + x-is-unique: true + username: + type: string + firstName: + type: string + lastName: + type: string + email: + type: string + password: + type: string + phone: + type: string + userStatus: + type: integer + format: int32 + description: User Status + xml: + name: User + Tag: + type: object + properties: + id: + type: integer + format: int64 + name: + type: string + xml: + name: Tag + Pet: + type: object + required: + - name + - photoUrls + properties: + id: + type: integer + format: int64 + x-is-unique: true + category: + $ref: '#/components/schemas/Category' + name: + type: string + example: doggie + photoUrls: + type: array + xml: + name: photoUrl + wrapped: true + items: + type: string + uniqueItems: true + tags: + type: array + xml: + name: tag + wrapped: true + items: + $ref: '#/components/schemas/Tag' + status: + type: string + description: pet status in the store + enum: + - available + - pending + - sold + xml: + name: Pet + ApiResponse: + type: object + properties: + code: + type: integer + format: int32 + type: + type: string + message: + type: string + Return: + description: Model for testing reserved words + properties: + return: + type: integer + format: int32 + xml: + name: Return + Name: + description: Model for testing model name same as property name + required: + - name + properties: + name: + type: integer + format: int32 + snake_case: + readOnly: true + type: integer + format: int32 + property: + type: string + 123Number: + type: integer + readOnly: true + xml: + name: Name + 200_response: + description: Model for testing model name starting with number + properties: + name: + type: integer + format: int32 + class: + type: string + xml: + name: Name + ClassModel: + description: Model for testing model with "_class" property + properties: + _class: + type: string + Dog: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + breed: + type: string + Cat: + allOf: + - $ref: '#/components/schemas/Animal' + - type: object + properties: + declawed: + type: boolean + Animal: + type: object + discriminator: + propertyName: className + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' + required: + - className + properties: + className: + type: string + color: + type: string + default: red + AnimalFarm: + type: array + items: + $ref: '#/components/schemas/Animal' + format_test: + type: object + required: + - number + - byte + - date + - password + properties: + integer: + type: integer + maximum: 100 + minimum: 10 + int32: + type: integer + format: int32 + maximum: 200 + minimum: 20 + 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 + double: + type: number + format: double + maximum: 123.4 + minimum: 67.8 + decimal: + type: string + format: number + string: + type: string + pattern: '/[a-z]/i' + byte: + type: string + format: byte + binary: + type: string + format: binary + date: + type: string + format: date + dateTime: + type: string + format: date-time + uuid: + type: string + format: uuid + example: 72f98069-206d-4f12-9f12-3d1e525a8e84 + password: + type: string + format: password + maxLength: 64 + minLength: 10 + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + type: string + pattern: '^\d{10}$' + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + type: string + pattern: '/^image_\d{1,3}$/i' + EnumClass: + type: string + default: '-efg' + enum: + - _abc + - '-efg' + - (xyz) + Enum_Test: + type: object + required: + - enum_string_required + properties: + enum_string: + type: string + enum: + - UPPER + - lower + - '' + enum_string_required: + type: string + enum: + - UPPER + - lower + - '' + enum_integer: + type: integer + format: int32 + enum: + - 1 + - -1 + enum_number: + type: number + format: double + enum: + - 1.1 + - -1.2 + outerEnum: + $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' + AdditionalPropertiesClass: + type: object + properties: + map_property: + type: object + additionalProperties: + type: string + map_of_map_property: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + MixedPropertiesAndAdditionalPropertiesClass: + type: object + properties: + uuid: + type: string + format: uuid + dateTime: + type: string + format: date-time + map: + type: object + additionalProperties: + $ref: '#/components/schemas/Animal' + List: + type: object + properties: + 123-list: + type: string + Client: + type: object + properties: + client: + type: string + ReadOnlyFirst: + type: object + properties: + bar: + type: string + readOnly: true + baz: + type: string + hasOnlyReadOnly: + type: object + properties: + bar: + type: string + readOnly: true + foo: + type: string + readOnly: true + Capitalization: + type: object + properties: + smallCamel: + type: string + CapitalCamel: + type: string + small_Snake: + type: string + Capital_Snake: + type: string + SCA_ETH_Flow_Points: + type: string + ATT_NAME: + description: | + Name of the pet + type: string + MapTest: + type: object + properties: + map_map_of_string: + type: object + additionalProperties: + type: object + additionalProperties: + type: string + map_of_enum_string: + type: object + additionalProperties: + type: string + enum: + - UPPER + - lower + direct_map: + type: object + additionalProperties: + type: boolean + indirect_map: + $ref: '#/components/schemas/StringBooleanMap' + ArrayTest: + type: object + properties: + array_of_string: + type: array + items: + type: string + minItems: 0 + maxItems: 3 + array_array_of_integer: + type: array + items: + type: array + items: + type: integer + format: int64 + array_array_of_model: + type: array + items: + type: array + items: + $ref: '#/components/schemas/ReadOnlyFirst' + NumberOnly: + type: object + properties: + JustNumber: + type: number + ArrayOfNumberOnly: + type: object + properties: + ArrayNumber: + type: array + items: + type: number + ArrayOfArrayOfNumberOnly: + type: object + properties: + ArrayArrayNumber: + type: array + items: + type: array + items: + type: number + EnumArrays: + type: object + properties: + just_symbol: + type: string + enum: + - '>=' + - $ + array_enum: + type: array + items: + type: string + enum: + - fish + - crab + FreeFormObject: + type: object + description: A schema consisting only of additional properties + additionalProperties: true + MapOfString: + type: object + description: A schema consisting only of additional properties of type string + additionalProperties: + type: string + OuterEnum: + nullable: true + type: string + enum: + - placed + - approved + - delivered + OuterEnumInteger: + type: integer + enum: + - 0 + - 1 + - 2 + example: 2 + OuterEnumDefaultValue: + type: string + enum: + - placed + - approved + - delivered + default: placed + OuterEnumIntegerDefaultValue: + type: integer + enum: + - 0 + - 1 + - 2 + default: 0 + OuterComposite: + type: object + properties: + my_number: + $ref: '#/components/schemas/OuterNumber' + my_string: + $ref: '#/components/schemas/OuterString' + my_boolean: + $ref: '#/components/schemas/OuterBoolean' + OuterNumber: + type: number + OuterString: + type: string + OuterBoolean: + type: boolean + x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + type: object + discriminator: + propertyName: type + properties: + type: + type: string + enum: + - ChildWithNullable + nullableProperty: + type: string + nullable: true + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - type: object + properties: + otherProperty: + type: string + StringBooleanMap: + additionalProperties: + type: boolean + FileSchemaTestClass: + type: object + properties: + file: + $ref: '#/components/schemas/File' + files: + type: array + items: + $ref: '#/components/schemas/File' + File: + type: object + description: Must be named `File` for test. + properties: + sourceURI: + description: Test capitalization + type: string + _special_model.name_: + properties: + '$special[property.name]': + type: integer + format: int64 + xml: + name: '$special[model.name]' + HealthCheckResult: + type: object + properties: + NullableMessage: + nullable: true + type: string + description: Just a string to inform instance is up and running. Make it nullable in hope to get it as pointer in generated model. + NullableClass: + type: object + properties: + integer_prop: + type: integer + nullable: true + number_prop: + type: number + nullable: true + boolean_prop: + type: boolean + nullable: true + string_prop: + type: string + nullable: true + date_prop: + type: string + format: date + nullable: true + datetime_prop: + type: string + format: date-time + nullable: true + array_nullable_prop: + type: array + nullable: true + items: + type: object + array_and_items_nullable_prop: + type: array + nullable: true + items: + type: object + nullable: true + array_items_nullable: + type: array + items: + type: object + nullable: true + object_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + object_and_items_nullable_prop: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + object_items_nullable: + type: object + additionalProperties: + type: object + nullable: true + additionalProperties: + type: object + nullable: true + OuterObjectWithEnumProperty: + type: object + example: + value: 2 + required: + - value + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + DeprecatedObject: + type: object + deprecated: true + properties: + name: + type: string + ObjectWithDeprecatedFields: + type: object + properties: + uuid: + type: string + id: + type: number + deprecated: true + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + type: array + deprecated: true + items: + $ref: '#/components/schemas/Bar' + AllOfWithSingleRef: + type: object + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + SingleRefType: + type: string + title: SingleRefType + enum: + - admin + - user diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES index 3ed6ff4d23c0..6576c008a879 100644 --- a/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES +++ b/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES @@ -3,36 +3,36 @@ pom.xml src/gen/java/org/openapitools/api/AnotherFakeApi.java src/gen/java/org/openapitools/api/FakeApi.java src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +src/gen/java/org/openapitools/api/FooApi.java src/gen/java/org/openapitools/api/PetApi.java src/gen/java/org/openapitools/api/RestApplication.java src/gen/java/org/openapitools/api/RestResourceRoot.java src/gen/java/org/openapitools/api/StoreApi.java src/gen/java/org/openapitools/api/UserApi.java -src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java -src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java -src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java -src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java -src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java -src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java -src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +src/gen/java/org/openapitools/model/AllOfWithSingleRef.java src/gen/java/org/openapitools/model/Animal.java src/gen/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java src/gen/java/org/openapitools/model/ArrayOfNumberOnly.java src/gen/java/org/openapitools/model/ArrayTest.java -src/gen/java/org/openapitools/model/BigCat.java src/gen/java/org/openapitools/model/Capitalization.java src/gen/java/org/openapitools/model/Cat.java src/gen/java/org/openapitools/model/Category.java +src/gen/java/org/openapitools/model/ChildWithNullable.java src/gen/java/org/openapitools/model/ClassModel.java src/gen/java/org/openapitools/model/Client.java +src/gen/java/org/openapitools/model/DeprecatedObject.java src/gen/java/org/openapitools/model/Dog.java src/gen/java/org/openapitools/model/EnumArrays.java src/gen/java/org/openapitools/model/EnumClass.java src/gen/java/org/openapitools/model/EnumTest.java +src/gen/java/org/openapitools/model/FakeBigDecimalMap200Response.java src/gen/java/org/openapitools/model/FileSchemaTestClass.java +src/gen/java/org/openapitools/model/Foo.java +src/gen/java/org/openapitools/model/FooGetDefaultResponse.java src/gen/java/org/openapitools/model/FormatTest.java src/gen/java/org/openapitools/model/HasOnlyReadOnly.java +src/gen/java/org/openapitools/model/HealthCheckResult.java src/gen/java/org/openapitools/model/MapTest.java src/gen/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java src/gen/java/org/openapitools/model/Model200Response.java @@ -41,16 +41,22 @@ src/gen/java/org/openapitools/model/ModelFile.java src/gen/java/org/openapitools/model/ModelList.java src/gen/java/org/openapitools/model/ModelReturn.java src/gen/java/org/openapitools/model/Name.java +src/gen/java/org/openapitools/model/NullableClass.java src/gen/java/org/openapitools/model/NumberOnly.java +src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java src/gen/java/org/openapitools/model/Order.java src/gen/java/org/openapitools/model/OuterComposite.java src/gen/java/org/openapitools/model/OuterEnum.java +src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java +src/gen/java/org/openapitools/model/OuterEnumInteger.java +src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java +src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java +src/gen/java/org/openapitools/model/ParentWithNullable.java src/gen/java/org/openapitools/model/Pet.java src/gen/java/org/openapitools/model/ReadOnlyFirst.java +src/gen/java/org/openapitools/model/SingleRefType.java src/gen/java/org/openapitools/model/SpecialModelName.java src/gen/java/org/openapitools/model/Tag.java -src/gen/java/org/openapitools/model/TypeHolderDefault.java -src/gen/java/org/openapitools/model/TypeHolderExample.java +src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java src/gen/java/org/openapitools/model/User.java -src/gen/java/org/openapitools/model/XmlItem.java src/main/openapi/openapi.yaml diff --git a/samples/server/petstore/jaxrs-spec/pom.xml b/samples/server/petstore/jaxrs-spec/pom.xml index 031d2beeafb0..0cd16dc39fd8 100644 --- a/samples/server/petstore/jaxrs-spec/pom.xml +++ b/samples/server/petstore/jaxrs-spec/pom.xml @@ -123,6 +123,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -135,5 +140,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java index 5a40b56eef48..403d1a84a917 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/AnotherFakeApi.java @@ -1,7 +1,6 @@ package org.openapitools.api; import org.openapitools.model.Client; -import java.util.UUID; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -29,7 +28,7 @@ public class AnotherFakeApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response call123testSpecialTags(@HeaderParam("uuid_test") @NotNull @ApiParam("to test uuid example value") UUID uuidTest,@Valid @NotNull Client body) { + public Response call123testSpecialTags(@Valid @NotNull Client client) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java index c4bac86519ba..1bc3632286b0 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeApi.java @@ -1,16 +1,22 @@ package org.openapitools.api; import java.math.BigDecimal; +import org.openapitools.model.ChildWithNullable; import org.openapitools.model.Client; import java.util.Date; +import org.openapitools.model.EnumClass; +import org.openapitools.model.FakeBigDecimalMap200Response; import java.io.File; import org.openapitools.model.FileSchemaTestClass; +import org.openapitools.model.HealthCheckResult; import org.joda.time.LocalDate; import java.util.Map; import org.openapitools.model.ModelApiResponse; import org.openapitools.model.OuterComposite; +import org.openapitools.model.OuterObjectWithEnumProperty; +import org.openapitools.model.Pet; +import org.openapitools.model.TestInlineFreeformAdditionalPropertiesRequest; import org.openapitools.model.User; -import org.openapitools.model.XmlItem; import javax.ws.rs.*; import javax.ws.rs.core.Response; @@ -31,19 +37,45 @@ @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") public class FakeApi { - @POST - @Path("/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" }) - @ApiOperation(value = "creates an XmlItem", notes = "this route creates an XmlItem", response = Void.class, tags={ "fake" }) + @GET + @Path("/BigDecimalMap") + @Produces({ "*/*" }) + @ApiOperation(value = "", notes = "for Java apache and Java native, test toUrlQueryString for maps with BegDecimal keys", response = FakeBigDecimalMap200Response.class, tags={ "fake" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class) + @ApiResponse(code = 200, message = "successful operation", response = FakeBigDecimalMap200Response.class) + }) + public Response fakeBigDecimalMap() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/health") + @Produces({ "application/json" }) + @ApiOperation(value = "Health check endpoint", notes = "", response = HealthCheckResult.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "The instance started successfully", response = HealthCheckResult.class) + }) + public Response fakeHealthGet() { + return Response.ok().entity("magic!").build(); + } + + @GET + @Path("/http-signature-test") + @Consumes({ "application/json", "application/xml" }) + @ApiOperation(value = "test http signature authentication", notes = "", response = Void.class, authorizations = { + + @Authorization(value = "http_signature_test") + }, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "The instance started successfully", response = Void.class) }) - public Response createXmlItem(@Valid @NotNull XmlItem xmlItem) { + public Response fakeHttpSignatureTest(@Valid @NotNull Pet pet,@QueryParam("query_1") @ApiParam("query parameter") String query1,@HeaderParam("header_1") @ApiParam("header parameter") String header1) { return Response.ok().entity("magic!").build(); } @POST @Path("/outer/boolean") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of outer boolean types", response = Boolean.class, tags={ "fake" }) @ApiResponses(value = { @@ -55,17 +87,19 @@ public Response fakeOuterBooleanSerialize(@Valid Boolean body) { @POST @Path("/outer/composite") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of object with outer number type", response = OuterComposite.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Output composite", response = OuterComposite.class) }) - public Response fakeOuterCompositeSerialize(@Valid OuterComposite body) { + public Response fakeOuterCompositeSerialize(@Valid OuterComposite outerComposite) { return Response.ok().entity("magic!").build(); } @POST @Path("/outer/number") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of outer number types", response = BigDecimal.class, tags={ "fake" }) @ApiResponses(value = { @@ -77,6 +111,7 @@ public Response fakeOuterNumberSerialize(@Valid BigDecimal body) { @POST @Path("/outer/string") + @Consumes({ "application/json" }) @Produces({ "*/*" }) @ApiOperation(value = "", notes = "Test serialization of outer string types", response = String.class, tags={ "fake" }) @ApiResponses(value = { @@ -86,14 +121,48 @@ public Response fakeOuterStringSerialize(@Valid String body) { return Response.ok().entity("magic!").build(); } + @POST + @Path("/property/enum-int") + @Consumes({ "application/json" }) + @Produces({ "*/*" }) + @ApiOperation(value = "", notes = "Test serialization of enum (int) properties with examples", response = OuterObjectWithEnumProperty.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Output enum (int)", response = OuterObjectWithEnumProperty.class) + }) + public Response fakePropertyEnumIntegerSerialize(@Valid @NotNull OuterObjectWithEnumProperty outerObjectWithEnumProperty) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/additionalProperties-reference") + @Consumes({ "application/json" }) + @ApiOperation(value = "test referenced additionalProperties", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testAdditionalPropertiesReference(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @PUT + @Path("/body-with-binary") + @Consumes({ "image/png" }) + @ApiOperation(value = "", notes = "For this test, the body has to be a binary file.", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "Success", response = Void.class) + }) + public Response testBodyWithBinary(@Valid File body) { + return Response.ok().entity("magic!").build(); + } + @PUT @Path("/body-with-file-schema") @Consumes({ "application/json" }) - @ApiOperation(value = "", notes = "For this test, the body for this request much reference a schema named `File`.", response = Void.class, tags={ "fake" }) + @ApiOperation(value = "", notes = "For this test, the body for this request must reference a schema named `File`.", response = Void.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass body) { + public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass fileSchemaTestClass) { return Response.ok().entity("magic!").build(); } @@ -104,7 +173,7 @@ public Response testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass body) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User body) { + public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String query,@Valid @NotNull User user) { return Response.ok().entity("magic!").build(); } @@ -115,13 +184,13 @@ public Response testBodyWithQueryParams(@QueryParam("query") @NotNull String q @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClientModel(@Valid @NotNull Client body) { + public Response testClientModel(@Valid @NotNull Client client) { return Response.ok().entity("magic!").build(); } @POST @Consumes({ "application/x-www-form-urlencoded" }) - @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트", response = Void.class, authorizations = { + @ApiOperation(value = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", notes = "Fake endpoint for testing various parameters 假端點 偽のエンドポイント 가짜 엔드 포인트 ", response = Void.class, authorizations = { @Authorization(value = "http_basic_test") }, tags={ "fake" }) @@ -143,12 +212,15 @@ public Response testEndpointParameters(@FormParam(value = "number") BigDecimal @ApiResponse(code = 400, message = "Invalid request", response = Void.class), @ApiResponse(code = 404, message = "Not found", response = Void.class) }) - public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { + public Response testEnumParameters(@HeaderParam("enum_header_string_array") @ApiParam("Header parameter enum test (string array)") List enumHeaderStringArray,@QueryParam("enum_query_string_array") @ApiParam("Query parameter enum test (string array)") List enumQueryStringArray,@QueryParam("enum_query_string") @DefaultValue("-efg") @ApiParam("Query parameter enum test (string)") String enumQueryString,@QueryParam("enum_query_integer") @ApiParam("Query parameter enum test (double)") Integer enumQueryInteger,@QueryParam("enum_query_double") @ApiParam("Query parameter enum test (double)") Double enumQueryDouble,@QueryParam("enum_query_model_array") List enumQueryModelArray,@FormParam(value = "enum_form_string_array") List enumFormStringArray,@FormParam(value = "enum_form_string") String enumFormString) { return Response.ok().entity("magic!").build(); } @DELETE - @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, tags={ "fake" }) + @ApiOperation(value = "Fake endpoint to test group parameters (optional)", notes = "Fake endpoint to test group parameters (optional)", response = Void.class, authorizations = { + + @Authorization(value = "bearer_test") + }, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Something wrong", response = Void.class) }) @@ -163,7 +235,18 @@ public Response testGroupParameters(@QueryParam("required_string_group") @NotNul @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response testInlineAdditionalProperties(@Valid @NotNull Map param) { + public Response testInlineAdditionalProperties(@Valid @NotNull Map requestBody) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/inline-freeform-additionalProperties") + @Consumes({ "application/json" }) + @ApiOperation(value = "test inline free-form additionalProperties", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testInlineFreeformAdditionalProperties(@Valid @NotNull TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest) { return Response.ok().entity("magic!").build(); } @@ -178,13 +261,35 @@ public Response testJsonFormData(@FormParam(value = "param") String param,@Form return Response.ok().entity("magic!").build(); } + @POST + @Path("/nullable") + @Consumes({ "application/json" }) + @ApiOperation(value = "test nullable parent property", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testNullable(@Valid @NotNull ChildWithNullable childWithNullable) { + return Response.ok().entity("magic!").build(); + } + @PUT @Path("/test-query-parameters") @ApiOperation(value = "", notes = "To test the collection format in query parameters", response = Void.class, tags={ "fake" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "Success", response = Void.class) }) - public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context) { + public Response testQueryParameterCollectionFormat(@QueryParam("pipe") @NotNull List pipe,@QueryParam("ioutil") @NotNull List ioutil,@QueryParam("http") @NotNull List http,@QueryParam("url") @NotNull List url,@QueryParam("context") @NotNull List context,@QueryParam("allowEmpty") @NotNull String allowEmpty,@QueryParam("language") Map language) { + return Response.ok().entity("magic!").build(); + } + + @POST + @Path("/stringMap-reference") + @Consumes({ "application/json" }) + @ApiOperation(value = "test referenced string map", notes = "", response = Void.class, tags={ "fake" }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "successful operation", response = Void.class) + }) + public Response testStringMapReference(@Valid @NotNull Map requestBody) { return Response.ok().entity("magic!").build(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java index aa82ecdfecbc..df957b59d08b 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FakeClassnameTestApi.java @@ -31,7 +31,7 @@ public class FakeClassnameTestApi { @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Client.class) }) - public Response testClassname(@Valid @NotNull Client body) { + public Response testClassname(@Valid @NotNull Client client) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FooApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FooApi.java new file mode 100644 index 000000000000..e40e0d569c56 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/FooApi.java @@ -0,0 +1,33 @@ +package org.openapitools.api; + +import org.openapitools.model.FooGetDefaultResponse; + +import javax.ws.rs.*; +import javax.ws.rs.core.Response; + +import io.swagger.annotations.*; + +import java.io.InputStream; +import java.util.Map; +import java.util.List; +import javax.validation.constraints.*; +import javax.validation.Valid; + +/** +* Represents a collection of functions to interact with the API endpoints. +*/ +@Path("/foo") +@Api(description = "the foo API") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class FooApi { + + @GET + @Produces({ "application/json" }) + @ApiOperation(value = "", notes = "", response = FooGetDefaultResponse.class, tags={ }) + @ApiResponses(value = { + @ApiResponse(code = 200, message = "response", response = FooGetDefaultResponse.class) + }) + public Response fooGet() { + return Response.ok().entity("magic!").build(); + } +} diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java index ad23a1b01138..8132bac1b846 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/PetApi.java @@ -32,10 +32,10 @@ public class PetApi { @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) - public Response addPet(@Valid @NotNull Pet body) { + public Response addPet(@Valid @NotNull Pet pet) { return Response.ok().entity("magic!").build(); } @@ -50,7 +50,7 @@ public Response addPet(@Valid @NotNull Pet body) { @io.swagger.annotations.ApiImplicitParam(name = "api_key", value = "", dataType = "String", paramType = "header") }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid pet value", response = Void.class) }) public Response deletePet(@PathParam("petId") @ApiParam("Pet id to delete") Long petId) { @@ -113,12 +113,12 @@ public Response getPetById(@PathParam("petId") @ApiParam("ID of pet to return") @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { - @ApiResponse(code = 200, message = "successful operation", response = Void.class), + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 400, message = "Invalid ID supplied", response = Void.class), @ApiResponse(code = 404, message = "Pet not found", response = Void.class), @ApiResponse(code = 405, message = "Validation exception", response = Void.class) }) - public Response updatePet(@Valid @NotNull Pet body) { + public Response updatePet(@Valid @NotNull Pet pet) { return Response.ok().entity("magic!").build(); } @@ -131,6 +131,7 @@ public Response updatePet(@Valid @NotNull Pet body) { @AuthorizationScope(scope = "read:pets", description = "read your pets") }) }, tags={ "pet" }) @ApiResponses(value = { + @ApiResponse(code = 200, message = "Successful operation", response = Void.class), @ApiResponse(code = 405, message = "Invalid input", response = Void.class) }) public Response updatePetWithForm(@PathParam("petId") @ApiParam("ID of pet that needs to be updated") Long petId,@FormParam(value = "name") String name,@FormParam(value = "status") String status) { diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java index 7ced493a15d8..820f4f223848 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/StoreApi.java @@ -62,13 +62,14 @@ public Response getOrderById(@PathParam("order_id") @Min(1L) @Max(5L) @ApiParam( @POST @Path("/order") + @Consumes({ "application/json" }) @Produces({ "application/xml", "application/json" }) @ApiOperation(value = "Place an order for a pet", notes = "", response = Order.class, tags={ "store" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Order.class), @ApiResponse(code = 400, message = "Invalid Order", response = Void.class) }) - public Response placeOrder(@Valid @NotNull Order body) { + public Response placeOrder(@Valid @NotNull Order order) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java index af9989fdd516..292d2e1f84e5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/api/UserApi.java @@ -23,31 +23,34 @@ public class UserApi { @POST + @Consumes({ "application/json" }) @ApiOperation(value = "Create user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUser(@Valid @NotNull User body) { + public Response createUser(@Valid @NotNull User user) { return Response.ok().entity("magic!").build(); } @POST @Path("/createWithArray") + @Consumes({ "application/json" }) @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> body) { + public Response createUsersWithArrayInput(@Valid @NotNull List<@Valid User> user) { return Response.ok().entity("magic!").build(); } @POST @Path("/createWithList") + @Consumes({ "application/json" }) @ApiOperation(value = "Creates list of users with given input array", notes = "", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 200, message = "successful operation", response = Void.class) }) - public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> body) { + public Response createUsersWithListInput(@Valid @NotNull List<@Valid User> user) { return Response.ok().entity("magic!").build(); } @@ -99,12 +102,13 @@ public Response logoutUser() { @PUT @Path("/{username}") + @Consumes({ "application/json" }) @ApiOperation(value = "Updated user", notes = "This can only be done by the logged in user.", response = Void.class, tags={ "user" }) @ApiResponses(value = { @ApiResponse(code = 400, message = "Invalid user supplied", response = Void.class), @ApiResponse(code = 404, message = "User not found", response = Void.class) }) - public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid @NotNull User body) { + public Response updateUser(@PathParam("username") @ApiParam("name that need to be deleted") String username,@Valid @NotNull User user) { return Response.ok().entity("magic!").build(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java index 8529b0c6023f..2d6e2c04b1c7 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesClass.java @@ -2,9 +2,7 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; import java.util.HashMap; -import java.util.List; import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; @@ -22,30 +20,12 @@ @JsonTypeName("AdditionalPropertiesClass") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") public class AdditionalPropertiesClass implements Serializable { - private @Valid Map mapString = new HashMap<>(); - private @Valid Map mapNumber = new HashMap<>(); - private @Valid Map mapInteger = new HashMap<>(); - private @Valid Map mapBoolean = new HashMap<>(); - private @Valid Map> mapArrayInteger = new HashMap<>(); - private @Valid Map> mapArrayAnytype = new HashMap<>(); - private @Valid Map> mapMapString = new HashMap<>(); - private @Valid Map> mapMapAnytype = new HashMap<>(); - private Object anytype1; - private Object anytype2; - private Object anytype3; + private @Valid Map mapProperty = new HashMap<>(); + private @Valid Map> mapOfMapProperty = new HashMap<>(); protected AdditionalPropertiesClass(AdditionalPropertiesClassBuilder b) { - this.mapString = b.mapString; - this.mapNumber = b.mapNumber; - this.mapInteger = b.mapInteger; - this.mapBoolean = b.mapBoolean; - this.mapArrayInteger = b.mapArrayInteger; - this.mapArrayAnytype = b.mapArrayAnytype; - this.mapMapString = b.mapMapString; - this.mapMapAnytype = b.mapMapAnytype; - this.anytype1 = b.anytype1; - this.anytype2 = b.anytype2; - this.anytype3 = b.anytype3; + this.mapProperty = b.mapProperty; + this.mapOfMapProperty = b.mapOfMapProperty; } public AdditionalPropertiesClass() { @@ -53,341 +33,74 @@ public AdditionalPropertiesClass() { /** **/ - public AdditionalPropertiesClass mapString(Map mapString) { - this.mapString = mapString; + public AdditionalPropertiesClass mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_string") - public Map getMapString() { - return mapString; + @JsonProperty("map_property") + public Map getMapProperty() { + return mapProperty; } - @JsonProperty("map_string") - public void setMapString(Map mapString) { - this.mapString = mapString; + @JsonProperty("map_property") + public void setMapProperty(Map mapProperty) { + this.mapProperty = mapProperty; } - public AdditionalPropertiesClass putMapStringItem(String key, String mapStringItem) { - if (this.mapString == null) { - this.mapString = new HashMap<>(); + public AdditionalPropertiesClass putMapPropertyItem(String key, String mapPropertyItem) { + if (this.mapProperty == null) { + this.mapProperty = new HashMap<>(); } - this.mapString.put(key, mapStringItem); + this.mapProperty.put(key, mapPropertyItem); return this; } - public AdditionalPropertiesClass removeMapStringItem(String key) { - if (this.mapString != null) { - this.mapString.remove(key); + public AdditionalPropertiesClass removeMapPropertyItem(String key) { + if (this.mapProperty != null) { + this.mapProperty.remove(key); } return this; } /** **/ - public AdditionalPropertiesClass mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; + public AdditionalPropertiesClass mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("map_number") - @Valid public Map getMapNumber() { - return mapNumber; + @JsonProperty("map_of_map_property") + @Valid public Map> getMapOfMapProperty() { + return mapOfMapProperty; } - @JsonProperty("map_number") - public void setMapNumber(Map mapNumber) { - this.mapNumber = mapNumber; + @JsonProperty("map_of_map_property") + public void setMapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; } - public AdditionalPropertiesClass putMapNumberItem(String key, BigDecimal mapNumberItem) { - if (this.mapNumber == null) { - this.mapNumber = new HashMap<>(); + public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map mapOfMapPropertyItem) { + if (this.mapOfMapProperty == null) { + this.mapOfMapProperty = new HashMap<>(); } - this.mapNumber.put(key, mapNumberItem); + this.mapOfMapProperty.put(key, mapOfMapPropertyItem); return this; } - public AdditionalPropertiesClass removeMapNumberItem(String key) { - if (this.mapNumber != null) { - this.mapNumber.remove(key); + public AdditionalPropertiesClass removeMapOfMapPropertyItem(String key) { + if (this.mapOfMapProperty != null) { + this.mapOfMapProperty.remove(key); } return this; } - /** - **/ - public AdditionalPropertiesClass mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_integer") - public Map getMapInteger() { - return mapInteger; - } - - @JsonProperty("map_integer") - public void setMapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - } - - public AdditionalPropertiesClass putMapIntegerItem(String key, Integer mapIntegerItem) { - if (this.mapInteger == null) { - this.mapInteger = new HashMap<>(); - } - - this.mapInteger.put(key, mapIntegerItem); - return this; - } - - public AdditionalPropertiesClass removeMapIntegerItem(String key) { - if (this.mapInteger != null) { - this.mapInteger.remove(key); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_boolean") - public Map getMapBoolean() { - return mapBoolean; - } - - @JsonProperty("map_boolean") - public void setMapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - } - - public AdditionalPropertiesClass putMapBooleanItem(String key, Boolean mapBooleanItem) { - if (this.mapBoolean == null) { - this.mapBoolean = new HashMap<>(); - } - - this.mapBoolean.put(key, mapBooleanItem); - return this; - } - - public AdditionalPropertiesClass removeMapBooleanItem(String key) { - if (this.mapBoolean != null) { - this.mapBoolean.remove(key); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_integer") - @Valid public Map> getMapArrayInteger() { - return mapArrayInteger; - } - - @JsonProperty("map_array_integer") - public void setMapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - } - - public AdditionalPropertiesClass putMapArrayIntegerItem(String key, List mapArrayIntegerItem) { - if (this.mapArrayInteger == null) { - this.mapArrayInteger = new HashMap<>(); - } - - this.mapArrayInteger.put(key, mapArrayIntegerItem); - return this; - } - - public AdditionalPropertiesClass removeMapArrayIntegerItem(String key) { - if (this.mapArrayInteger != null) { - this.mapArrayInteger.remove(key); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_array_anytype") - @Valid public Map> getMapArrayAnytype() { - return mapArrayAnytype; - } - - @JsonProperty("map_array_anytype") - public void setMapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - } - - public AdditionalPropertiesClass putMapArrayAnytypeItem(String key, List mapArrayAnytypeItem) { - if (this.mapArrayAnytype == null) { - this.mapArrayAnytype = new HashMap<>(); - } - - this.mapArrayAnytype.put(key, mapArrayAnytypeItem); - return this; - } - - public AdditionalPropertiesClass removeMapArrayAnytypeItem(String key) { - if (this.mapArrayAnytype != null) { - this.mapArrayAnytype.remove(key); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_string") - @Valid public Map> getMapMapString() { - return mapMapString; - } - - @JsonProperty("map_map_string") - public void setMapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - } - - public AdditionalPropertiesClass putMapMapStringItem(String key, Map mapMapStringItem) { - if (this.mapMapString == null) { - this.mapMapString = new HashMap<>(); - } - - this.mapMapString.put(key, mapMapStringItem); - return this; - } - - public AdditionalPropertiesClass removeMapMapStringItem(String key) { - if (this.mapMapString != null) { - this.mapMapString.remove(key); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("map_map_anytype") - @Valid public Map> getMapMapAnytype() { - return mapMapAnytype; - } - - @JsonProperty("map_map_anytype") - public void setMapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - } - - public AdditionalPropertiesClass putMapMapAnytypeItem(String key, Map mapMapAnytypeItem) { - if (this.mapMapAnytype == null) { - this.mapMapAnytype = new HashMap<>(); - } - - this.mapMapAnytype.put(key, mapMapAnytypeItem); - return this; - } - - public AdditionalPropertiesClass removeMapMapAnytypeItem(String key) { - if (this.mapMapAnytype != null) { - this.mapMapAnytype.remove(key); - } - - return this; - } - /** - **/ - public AdditionalPropertiesClass anytype1(Object anytype1) { - this.anytype1 = anytype1; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_1") - public Object getAnytype1() { - return anytype1; - } - - @JsonProperty("anytype_1") - public void setAnytype1(Object anytype1) { - this.anytype1 = anytype1; - } - - /** - **/ - public AdditionalPropertiesClass anytype2(Object anytype2) { - this.anytype2 = anytype2; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_2") - public Object getAnytype2() { - return anytype2; - } - - @JsonProperty("anytype_2") - public void setAnytype2(Object anytype2) { - this.anytype2 = anytype2; - } - - /** - **/ - public AdditionalPropertiesClass anytype3(Object anytype3) { - this.anytype3 = anytype3; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("anytype_3") - public Object getAnytype3() { - return anytype3; - } - - @JsonProperty("anytype_3") - public void setAnytype3(Object anytype3) { - this.anytype3 = anytype3; - } - @Override public boolean equals(Object o) { @@ -398,22 +111,13 @@ public boolean equals(Object o) { 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); + return Objects.equals(this.mapProperty, additionalPropertiesClass.mapProperty) && + Objects.equals(this.mapOfMapProperty, additionalPropertiesClass.mapOfMapProperty); } @Override public int hashCode() { - return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3); + return Objects.hash(mapProperty, mapOfMapProperty); } @Override @@ -421,17 +125,8 @@ 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(" mapProperty: ").append(toIndentedString(mapProperty)).append("\n"); + sb.append(" mapOfMapProperty: ").append(toIndentedString(mapOfMapProperty)).append("\n"); sb.append("}"); return sb.toString(); } @@ -466,63 +161,18 @@ public AdditionalPropertiesClass build() { } public static abstract class AdditionalPropertiesClassBuilder> { - private Map mapString = new HashMap<>(); - private Map mapNumber = new HashMap<>(); - private Map mapInteger = new HashMap<>(); - private Map mapBoolean = new HashMap<>(); - private Map> mapArrayInteger = new HashMap<>(); - private Map> mapArrayAnytype = new HashMap<>(); - private Map> mapMapString = new HashMap<>(); - private Map> mapMapAnytype = new HashMap<>(); - private Object anytype1; - private Object anytype2; - private Object anytype3; + private Map mapProperty = new HashMap<>(); + private Map> mapOfMapProperty = new HashMap<>(); protected abstract B self(); public abstract C build(); - public B mapString(Map mapString) { - this.mapString = mapString; - return self(); - } - public B mapNumber(Map mapNumber) { - this.mapNumber = mapNumber; - return self(); - } - public B mapInteger(Map mapInteger) { - this.mapInteger = mapInteger; - return self(); - } - public B mapBoolean(Map mapBoolean) { - this.mapBoolean = mapBoolean; - return self(); - } - public B mapArrayInteger(Map> mapArrayInteger) { - this.mapArrayInteger = mapArrayInteger; - return self(); - } - public B mapArrayAnytype(Map> mapArrayAnytype) { - this.mapArrayAnytype = mapArrayAnytype; - return self(); - } - public B mapMapString(Map> mapMapString) { - this.mapMapString = mapMapString; - return self(); - } - public B mapMapAnytype(Map> mapMapAnytype) { - this.mapMapAnytype = mapMapAnytype; - return self(); - } - public B anytype1(Object anytype1) { - this.anytype1 = anytype1; - return self(); - } - public B anytype2(Object anytype2) { - this.anytype2 = anytype2; + public B mapProperty(Map mapProperty) { + this.mapProperty = mapProperty; return self(); } - public B anytype3(Object anytype3) { - this.anytype3 = anytype3; + public B mapOfMapProperty(Map> mapOfMapProperty) { + this.mapOfMapProperty = mapOfMapProperty; return self(); } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java deleted file mode 100644 index 3d2042de6967..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesInteger.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("AdditionalPropertiesInteger") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class AdditionalPropertiesInteger extends HashMap implements Serializable { - private String name; - - /** - **/ - public AdditionalPropertiesInteger name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("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/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java deleted file mode 100644 index a55d30c10fe0..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesNumber.java +++ /dev/null @@ -1,87 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.HashMap; -import java.util.Map; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("AdditionalPropertiesNumber") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class AdditionalPropertiesNumber extends HashMap implements Serializable { - private String name; - - /** - **/ - public AdditionalPropertiesNumber name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("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/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java deleted file mode 100644 index f6547078d15e..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesObject.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("AdditionalPropertiesObject") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class AdditionalPropertiesObject extends HashMap implements Serializable { - private String name; - - /** - **/ - public AdditionalPropertiesObject name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("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/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java deleted file mode 100644 index 7136774e681b..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesString.java +++ /dev/null @@ -1,86 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("AdditionalPropertiesString") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class AdditionalPropertiesString extends HashMap implements Serializable { - private String name; - - /** - **/ - public AdditionalPropertiesString name(String name) { - this.name = name; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; - } - - @JsonProperty("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/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java new file mode 100644 index 000000000000..0e658569ec06 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AllOfWithSingleRef.java @@ -0,0 +1,147 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.SingleRefType; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("AllOfWithSingleRef") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class AllOfWithSingleRef implements Serializable { + private String username; + private SingleRefType singleRefType; + + protected AllOfWithSingleRef(AllOfWithSingleRefBuilder b) { + this.username = b.username; + this.singleRefType = b.singleRefType; + } + + public AllOfWithSingleRef() { + } + + /** + **/ + public AllOfWithSingleRef username(String username) { + this.username = username; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("username") + public String getUsername() { + return username; + } + + @JsonProperty("username") + public void setUsername(String username) { + this.username = username; + } + + /** + **/ + public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("SingleRefType") + @Valid public SingleRefType getSingleRefType() { + return singleRefType; + } + + @JsonProperty("SingleRefType") + public void setSingleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + AllOfWithSingleRef allOfWithSingleRef = (AllOfWithSingleRef) o; + return Objects.equals(this.username, allOfWithSingleRef.username) && + Objects.equals(this.singleRefType, allOfWithSingleRef.singleRefType); + } + + @Override + public int hashCode() { + return Objects.hash(username, singleRefType); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class AllOfWithSingleRef {\n"); + + sb.append(" username: ").append(toIndentedString(username)).append("\n"); + sb.append(" singleRefType: ").append(toIndentedString(singleRefType)).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 "); + } + + + public static AllOfWithSingleRefBuilder builder() { + return new AllOfWithSingleRefBuilderImpl(); + } + + private static final class AllOfWithSingleRefBuilderImpl extends AllOfWithSingleRefBuilder { + + @Override + protected AllOfWithSingleRefBuilderImpl self() { + return this; + } + + @Override + public AllOfWithSingleRef build() { + return new AllOfWithSingleRef(this); + } + } + + public static abstract class AllOfWithSingleRefBuilder> { + private String username; + private SingleRefType singleRefType; + protected abstract B self(); + + public abstract C build(); + + public B username(String username) { + this.username = username; + return self(); + } + public B singleRefType(SingleRefType singleRefType) { + this.singleRefType = singleRefType; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java index 222f6afcdbac..323c1f7accf5 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Animal.java @@ -18,9 +18,8 @@ @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"), + @JsonSubTypes.Type(value = Cat.class, name = "CAT"), + @JsonSubTypes.Type(value = Dog.class, name = "DOG"), }) diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java index ed002e0545f7..92d5bce485e8 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ArrayTest.java @@ -45,7 +45,7 @@ public ArrayTest arrayOfString(List arrayOfString) { @ApiModelProperty(value = "") @JsonProperty("array_of_string") - public List getArrayOfString() { + @Size(min=0,max=3)public List getArrayOfString() { return arrayOfString; } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java deleted file mode 100644 index 86bd389b6932..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/BigCat.java +++ /dev/null @@ -1,165 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import org.openapitools.model.Cat; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("BigCat") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class BigCat extends Cat implements Serializable { - public enum KindEnum { - - LIONS(String.valueOf("lions")), TIGERS(String.valueOf("tigers")), LEOPARDS(String.valueOf("leopards")), JAGUARS(String.valueOf("jaguars")); - - - private String value; - - KindEnum (String v) { - value = v; - } - - public String value() { - return value; - } - - @Override - @JsonValue - public String toString() { - return String.valueOf(value); - } - - /** - * Convert a String into String, as specified in the - * See JAX RS 2.0 Specification, section 3.2, p. 12 - */ - public static KindEnum fromString(String s) { - for (KindEnum b : KindEnum.values()) { - // using Objects.toString() to be safe if value type non-object type - // because types like 'int' etc. will be auto-boxed - if (java.util.Objects.toString(b.value).equals(s)) { - return b; - } - } - throw new IllegalArgumentException("Unexpected string value '" + s + "'"); - } - - @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 + "'"); - } -} - - private KindEnum kind; - - protected BigCat(BigCatBuilder b) { - super(b); - this.kind = b.kind; - } - - public BigCat() { - } - - /** - **/ - public BigCat kind(KindEnum kind) { - this.kind = kind; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("kind") - public KindEnum getKind() { - return kind; - } - - @JsonProperty("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; - } - 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 "); - } - - - public static BigCatBuilder builder() { - return new BigCatBuilderImpl(); - } - - private static final class BigCatBuilderImpl extends BigCatBuilder { - - @Override - protected BigCatBuilderImpl self() { - return this; - } - - @Override - public BigCat build() { - return new BigCat(this); - } - } - - public static abstract class BigCatBuilder> extends CatBuilder { - private KindEnum kind; - - public B kind(KindEnum kind) { - this.kind = kind; - return self(); - } - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ChildWithNullable.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ChildWithNullable.java new file mode 100644 index 000000000000..47f8f883fb28 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ChildWithNullable.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import org.openapitools.model.ParentWithNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("ChildWithNullable") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class ChildWithNullable extends ParentWithNullable implements Serializable { + private String otherProperty; + + protected ChildWithNullable(ChildWithNullableBuilder b) { + super(b); + this.otherProperty = b.otherProperty; + } + + public ChildWithNullable() { + } + + /** + **/ + public ChildWithNullable otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("otherProperty") + public String getOtherProperty() { + return otherProperty; + } + + @JsonProperty("otherProperty") + public void setOtherProperty(String otherProperty) { + this.otherProperty = otherProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ChildWithNullable childWithNullable = (ChildWithNullable) o; + return Objects.equals(this.otherProperty, childWithNullable.otherProperty) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(otherProperty, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ChildWithNullable {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" otherProperty: ").append(toIndentedString(otherProperty)).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 "); + } + + + public static ChildWithNullableBuilder builder() { + return new ChildWithNullableBuilderImpl(); + } + + private static final class ChildWithNullableBuilderImpl extends ChildWithNullableBuilder { + + @Override + protected ChildWithNullableBuilderImpl self() { + return this; + } + + @Override + public ChildWithNullable build() { + return new ChildWithNullable(this); + } + } + + public static abstract class ChildWithNullableBuilder> extends ParentWithNullableBuilder { + private String otherProperty; + + public B otherProperty(String otherProperty) { + this.otherProperty = otherProperty; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DeprecatedObject.java similarity index 57% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java rename to samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DeprecatedObject.java index e0408cdc6440..081822cc8425 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesArray.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/DeprecatedObject.java @@ -2,9 +2,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.List; -import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -18,14 +15,21 @@ -@JsonTypeName("AdditionalPropertiesArray") +@JsonTypeName("DeprecatedObject") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class AdditionalPropertiesArray extends HashMap implements Serializable { +public class DeprecatedObject implements Serializable { private String name; + protected DeprecatedObject(DeprecatedObjectBuilder b) { + this.name = b.name; + } + + public DeprecatedObject() { + } + /** **/ - public AdditionalPropertiesArray name(String name) { + public DeprecatedObject name(String name) { this.name = name; return this; } @@ -51,21 +55,20 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AdditionalPropertiesArray additionalPropertiesArray = (AdditionalPropertiesArray) o; - return Objects.equals(this.name, additionalPropertiesArray.name) && - super.equals(o); + DeprecatedObject deprecatedObject = (DeprecatedObject) o; + return Objects.equals(this.name, deprecatedObject.name); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return Objects.hash(name); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesArray {\n"); - sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append("class DeprecatedObject {\n"); + sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append("}"); return sb.toString(); @@ -83,5 +86,33 @@ private String toIndentedString(Object o) { } + public static DeprecatedObjectBuilder builder() { + return new DeprecatedObjectBuilderImpl(); + } + + private static final class DeprecatedObjectBuilderImpl extends DeprecatedObjectBuilder { + + @Override + protected DeprecatedObjectBuilderImpl self() { + return this; + } + + @Override + public DeprecatedObject build() { + return new DeprecatedObject(this); + } + } + + public static abstract class DeprecatedObjectBuilder> { + private String name; + protected abstract B self(); + + public abstract C build(); + + public B name(String name) { + this.name = name; + return self(); + } + } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java index 9509cb5cfab4..7267cf713f7a 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/EnumTest.java @@ -3,7 +3,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; import org.openapitools.model.OuterEnum; +import org.openapitools.model.OuterEnumDefaultValue; +import org.openapitools.model.OuterEnumInteger; +import org.openapitools.model.OuterEnumIntegerDefaultValue; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -213,6 +217,9 @@ public static EnumNumberEnum fromValue(Double value) { private EnumNumberEnum enumNumber; private OuterEnum outerEnum; + private OuterEnumInteger outerEnumInteger; + private OuterEnumDefaultValue outerEnumDefaultValue = OuterEnumDefaultValue.PLACED; + private OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue = OuterEnumIntegerDefaultValue.NUMBER_0; protected EnumTest(EnumTestBuilder b) { this.enumString = b.enumString; @@ -220,6 +227,9 @@ protected EnumTest(EnumTestBuilder b) { this.enumInteger = b.enumInteger; this.enumNumber = b.enumNumber; this.outerEnum = b.outerEnum; + this.outerEnumInteger = b.outerEnumInteger; + this.outerEnumDefaultValue = b.outerEnumDefaultValue; + this.outerEnumIntegerDefaultValue = b.outerEnumIntegerDefaultValue; } public EnumTest() { @@ -320,6 +330,63 @@ public void setOuterEnum(OuterEnum outerEnum) { this.outerEnum = outerEnum; } + /** + **/ + public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("outerEnumInteger") + @Valid public OuterEnumInteger getOuterEnumInteger() { + return outerEnumInteger; + } + + @JsonProperty("outerEnumInteger") + public void setOuterEnumInteger(OuterEnumInteger outerEnumInteger) { + this.outerEnumInteger = outerEnumInteger; + } + + /** + **/ + public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("outerEnumDefaultValue") + @Valid public OuterEnumDefaultValue getOuterEnumDefaultValue() { + return outerEnumDefaultValue; + } + + @JsonProperty("outerEnumDefaultValue") + public void setOuterEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) { + this.outerEnumDefaultValue = outerEnumDefaultValue; + } + + /** + **/ + public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("outerEnumIntegerDefaultValue") + @Valid public OuterEnumIntegerDefaultValue getOuterEnumIntegerDefaultValue() { + return outerEnumIntegerDefaultValue; + } + + @JsonProperty("outerEnumIntegerDefaultValue") + public void setOuterEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) { + this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue; + } + @Override public boolean equals(Object o) { @@ -334,12 +401,15 @@ public boolean equals(Object o) { Objects.equals(this.enumStringRequired, enumTest.enumStringRequired) && Objects.equals(this.enumInteger, enumTest.enumInteger) && Objects.equals(this.enumNumber, enumTest.enumNumber) && - Objects.equals(this.outerEnum, enumTest.outerEnum); + Objects.equals(this.outerEnum, enumTest.outerEnum) && + Objects.equals(this.outerEnumInteger, enumTest.outerEnumInteger) && + Objects.equals(this.outerEnumDefaultValue, enumTest.outerEnumDefaultValue) && + Objects.equals(this.outerEnumIntegerDefaultValue, enumTest.outerEnumIntegerDefaultValue); } @Override public int hashCode() { - return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum); + return Objects.hash(enumString, enumStringRequired, enumInteger, enumNumber, outerEnum, outerEnumInteger, outerEnumDefaultValue, outerEnumIntegerDefaultValue); } @Override @@ -352,6 +422,9 @@ public String toString() { 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(" outerEnumInteger: ").append(toIndentedString(outerEnumInteger)).append("\n"); + sb.append(" outerEnumDefaultValue: ").append(toIndentedString(outerEnumDefaultValue)).append("\n"); + sb.append(" outerEnumIntegerDefaultValue: ").append(toIndentedString(outerEnumIntegerDefaultValue)).append("\n"); sb.append("}"); return sb.toString(); } @@ -391,6 +464,9 @@ public static abstract class EnumTestBuilder someMap = new HashMap<>(); + + protected FakeBigDecimalMap200Response(FakeBigDecimalMap200ResponseBuilder b) { + this.someId = b.someId; + this.someMap = b.someMap; + } + + public FakeBigDecimalMap200Response() { + } + + /** + **/ + public FakeBigDecimalMap200Response someId(BigDecimal someId) { + this.someId = someId; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("someId") + @Valid public BigDecimal getSomeId() { + return someId; + } + + @JsonProperty("someId") + public void setSomeId(BigDecimal someId) { + this.someId = someId; + } + + /** + **/ + public FakeBigDecimalMap200Response someMap(Map someMap) { + this.someMap = someMap; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("someMap") + @Valid public Map getSomeMap() { + return someMap; + } + + @JsonProperty("someMap") + public void setSomeMap(Map someMap) { + this.someMap = someMap; + } + + public FakeBigDecimalMap200Response putSomeMapItem(String key, BigDecimal someMapItem) { + if (this.someMap == null) { + this.someMap = new HashMap<>(); + } + + this.someMap.put(key, someMapItem); + return this; + } + + public FakeBigDecimalMap200Response removeSomeMapItem(String key) { + if (this.someMap != null) { + this.someMap.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FakeBigDecimalMap200Response fakeBigDecimalMap200Response = (FakeBigDecimalMap200Response) o; + return Objects.equals(this.someId, fakeBigDecimalMap200Response.someId) && + Objects.equals(this.someMap, fakeBigDecimalMap200Response.someMap); + } + + @Override + public int hashCode() { + return Objects.hash(someId, someMap); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FakeBigDecimalMap200Response {\n"); + + sb.append(" someId: ").append(toIndentedString(someId)).append("\n"); + sb.append(" someMap: ").append(toIndentedString(someMap)).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 "); + } + + + public static FakeBigDecimalMap200ResponseBuilder builder() { + return new FakeBigDecimalMap200ResponseBuilderImpl(); + } + + private static final class FakeBigDecimalMap200ResponseBuilderImpl extends FakeBigDecimalMap200ResponseBuilder { + + @Override + protected FakeBigDecimalMap200ResponseBuilderImpl self() { + return this; + } + + @Override + public FakeBigDecimalMap200Response build() { + return new FakeBigDecimalMap200Response(this); + } + } + + public static abstract class FakeBigDecimalMap200ResponseBuilder> { + private BigDecimal someId; + private Map someMap = new HashMap<>(); + protected abstract B self(); + + public abstract C build(); + + public B someId(BigDecimal someId) { + this.someId = someId; + return self(); + } + public B someMap(Map someMap) { + this.someMap = someMap; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Foo.java similarity index 53% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java rename to samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Foo.java index e937b773d0a6..99b914db2112 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesBoolean.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/Foo.java @@ -2,8 +2,6 @@ import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import java.util.HashMap; -import java.util.Map; import java.io.Serializable; import javax.validation.constraints.*; import javax.validation.Valid; @@ -17,28 +15,35 @@ -@JsonTypeName("AdditionalPropertiesBoolean") +@JsonTypeName("Foo") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class AdditionalPropertiesBoolean extends HashMap implements Serializable { - private String name; +public class Foo implements Serializable { + private String bar = "bar"; + + protected Foo(FooBuilder b) { + this.bar = b.bar; + } + + public Foo() { + } /** **/ - public AdditionalPropertiesBoolean name(String name) { - this.name = name; + public Foo bar(String bar) { + this.bar = bar; return this; } @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; + @JsonProperty("bar") + public String getBar() { + return bar; } - @JsonProperty("name") - public void setName(String name) { - this.name = name; + @JsonProperty("bar") + public void setBar(String bar) { + this.bar = bar; } @@ -50,22 +55,21 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AdditionalPropertiesBoolean additionalPropertiesBoolean = (AdditionalPropertiesBoolean) o; - return Objects.equals(this.name, additionalPropertiesBoolean.name) && - super.equals(o); + Foo foo = (Foo) o; + return Objects.equals(this.bar, foo.bar); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return Objects.hash(bar); } @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("class Foo {\n"); + + sb.append(" bar: ").append(toIndentedString(bar)).append("\n"); sb.append("}"); return sb.toString(); } @@ -82,5 +86,33 @@ private String toIndentedString(Object o) { } + public static FooBuilder builder() { + return new FooBuilderImpl(); + } + + private static final class FooBuilderImpl extends FooBuilder { + + @Override + protected FooBuilderImpl self() { + return this; + } + + @Override + public Foo build() { + return new Foo(this); + } + } + + public static abstract class FooBuilder> { + private String bar = "bar"; + protected abstract B self(); + + public abstract C build(); + + public B bar(String bar) { + this.bar = bar; + return self(); + } + } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java new file mode 100644 index 000000000000..bb6d6c230f81 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FooGetDefaultResponse.java @@ -0,0 +1,120 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonTypeName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.Foo; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("_foo_get_default_response") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class FooGetDefaultResponse implements Serializable { + private Foo string; + + protected FooGetDefaultResponse(FooGetDefaultResponseBuilder b) { + this.string = b.string; + } + + public FooGetDefaultResponse() { + } + + /** + **/ + public FooGetDefaultResponse string(Foo string) { + this.string = string; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("string") + @Valid public Foo getString() { + return string; + } + + @JsonProperty("string") + public void setString(Foo string) { + this.string = string; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + FooGetDefaultResponse fooGetDefaultResponse = (FooGetDefaultResponse) o; + return Objects.equals(this.string, fooGetDefaultResponse.string); + } + + @Override + public int hashCode() { + return Objects.hash(string); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class FooGetDefaultResponse {\n"); + + sb.append(" string: ").append(toIndentedString(string)).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 "); + } + + + public static FooGetDefaultResponseBuilder builder() { + return new FooGetDefaultResponseBuilderImpl(); + } + + private static final class FooGetDefaultResponseBuilderImpl extends FooGetDefaultResponseBuilder { + + @Override + protected FooGetDefaultResponseBuilderImpl self() { + return this; + } + + @Override + public FooGetDefaultResponse build() { + return new FooGetDefaultResponse(this); + } + } + + public static abstract class FooGetDefaultResponseBuilder> { + private Foo string; + protected abstract B self(); + + public abstract C build(); + + public B string(Foo string) { + this.string = string; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java index 329a6a4ef27f..779c2a90fe65 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/FormatTest.java @@ -31,6 +31,7 @@ public class FormatTest implements Serializable { private BigDecimal number; private Float _float; private Double _double; + private BigDecimal decimal; private String string; private byte[] _byte; private File binary; @@ -38,7 +39,8 @@ public class FormatTest implements Serializable { private Date dateTime; private UUID uuid; private String password; - private BigDecimal bigDecimal; + private String patternWithDigits; + private String patternWithDigitsAndDelimiter; protected FormatTest(FormatTestBuilder b) { this.integer = b.integer; @@ -47,6 +49,7 @@ protected FormatTest(FormatTestBuilder b) { this.number = b.number; this._float = b._float; this._double = b._double; + this.decimal = b.decimal; this.string = b.string; this._byte = b._byte; this.binary = b.binary; @@ -54,7 +57,8 @@ protected FormatTest(FormatTestBuilder b) { this.dateTime = b.dateTime; this.uuid = b.uuid; this.password = b.password; - this.bigDecimal = b.bigDecimal; + this.patternWithDigits = b.patternWithDigits; + this.patternWithDigitsAndDelimiter = b.patternWithDigitsAndDelimiter; } public FormatTest() { @@ -184,6 +188,25 @@ public void setDouble(Double _double) { this._double = _double; } + /** + **/ + public FormatTest decimal(BigDecimal decimal) { + this.decimal = decimal; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("decimal") + @Valid public BigDecimal getDecimal() { + return decimal; + } + + @JsonProperty("decimal") + public void setDecimal(BigDecimal decimal) { + this.decimal = decimal; + } + /** **/ public FormatTest string(String string) { @@ -213,7 +236,7 @@ public FormatTest _byte(byte[] _byte) { @ApiModelProperty(required = true, value = "") @JsonProperty("byte") - @NotNull @Pattern(regexp="^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$")public byte[] getByte() { + @NotNull public byte[] getByte() { return _byte; } @@ -318,22 +341,43 @@ public void setPassword(String password) { } /** + * A string that is a 10 digit number. Can have leading zeros. **/ - public FormatTest bigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; + public FormatTest patternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; return this; } - @ApiModelProperty(value = "") - @JsonProperty("BigDecimal") - @Valid public BigDecimal getBigDecimal() { - return bigDecimal; + @ApiModelProperty(value = "A string that is a 10 digit number. Can have leading zeros.") + @JsonProperty("pattern_with_digits") + @Pattern(regexp="^\\d{10}$")public String getPatternWithDigits() { + return patternWithDigits; + } + + @JsonProperty("pattern_with_digits") + public void setPatternWithDigits(String patternWithDigits) { + this.patternWithDigits = patternWithDigits; } - @JsonProperty("BigDecimal") - public void setBigDecimal(BigDecimal bigDecimal) { - this.bigDecimal = bigDecimal; + /** + * A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01. + **/ + public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; + return this; + } + + + @ApiModelProperty(value = "A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01.") + @JsonProperty("pattern_with_digits_and_delimiter") + @Pattern(regexp="/^image_\\d{1,3}$/i")public String getPatternWithDigitsAndDelimiter() { + return patternWithDigitsAndDelimiter; + } + + @JsonProperty("pattern_with_digits_and_delimiter") + public void setPatternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) { + this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter; } @@ -352,6 +396,7 @@ public boolean equals(Object o) { Objects.equals(this.number, formatTest.number) && Objects.equals(this._float, formatTest._float) && Objects.equals(this._double, formatTest._double) && + Objects.equals(this.decimal, formatTest.decimal) && Objects.equals(this.string, formatTest.string) && Arrays.equals(this._byte, formatTest._byte) && Objects.equals(this.binary, formatTest.binary) && @@ -359,12 +404,13 @@ public boolean equals(Object o) { Objects.equals(this.dateTime, formatTest.dateTime) && Objects.equals(this.uuid, formatTest.uuid) && Objects.equals(this.password, formatTest.password) && - Objects.equals(this.bigDecimal, formatTest.bigDecimal); + Objects.equals(this.patternWithDigits, formatTest.patternWithDigits) && + Objects.equals(this.patternWithDigitsAndDelimiter, formatTest.patternWithDigitsAndDelimiter); } @Override public int hashCode() { - return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, bigDecimal); + return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter); } @Override @@ -378,6 +424,7 @@ public String toString() { 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(" decimal: ").append(toIndentedString(decimal)).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"); @@ -385,7 +432,8 @@ public String toString() { sb.append(" dateTime: ").append(toIndentedString(dateTime)).append("\n"); sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); sb.append(" password: ").append("*").append("\n"); - sb.append(" bigDecimal: ").append(toIndentedString(bigDecimal)).append("\n"); + sb.append(" patternWithDigits: ").append(toIndentedString(patternWithDigits)).append("\n"); + sb.append(" patternWithDigitsAndDelimiter: ").append(toIndentedString(patternWithDigitsAndDelimiter)).append("\n"); sb.append("}"); return sb.toString(); } @@ -426,6 +474,7 @@ public static abstract class FormatTestBuilder b) { + this.nullableMessage = b.nullableMessage; + } + + public HealthCheckResult() { + } + + /** + **/ + public HealthCheckResult nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("NullableMessage") + public String getNullableMessage() { + return nullableMessage; + } + + @JsonProperty("NullableMessage") + public void setNullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + HealthCheckResult healthCheckResult = (HealthCheckResult) o; + return Objects.equals(this.nullableMessage, healthCheckResult.nullableMessage); + } + + @Override + public int hashCode() { + return Objects.hash(nullableMessage); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class HealthCheckResult {\n"); + + sb.append(" nullableMessage: ").append(toIndentedString(nullableMessage)).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 "); + } + + + public static HealthCheckResultBuilder builder() { + return new HealthCheckResultBuilderImpl(); + } + + private static final class HealthCheckResultBuilderImpl extends HealthCheckResultBuilder { + + @Override + protected HealthCheckResultBuilderImpl self() { + return this; + } + + @Override + public HealthCheckResult build() { + return new HealthCheckResult(this); + } + } + + public static abstract class HealthCheckResultBuilder> { + private String nullableMessage; + protected abstract B self(); + + public abstract C build(); + + public B nullableMessage(String nullableMessage) { + this.nullableMessage = nullableMessage; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NullableClass.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NullableClass.java new file mode 100644 index 000000000000..6cd28826c693 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/NullableClass.java @@ -0,0 +1,431 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import org.joda.time.LocalDate; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("NullableClass") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class NullableClass extends HashMap implements Serializable { + private Integer integerProp; + private BigDecimal numberProp; + private Boolean booleanProp; + private String stringProp; + private LocalDate dateProp; + private Date datetimeProp; + private @Valid List arrayNullableProp; + private @Valid List arrayAndItemsNullableProp; + private @Valid List arrayItemsNullable = new ArrayList<>(); + private @Valid Map objectNullableProp; + private @Valid Map objectAndItemsNullableProp; + private @Valid Map objectItemsNullable = new HashMap<>(); + + /** + **/ + public NullableClass integerProp(Integer integerProp) { + this.integerProp = integerProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("integer_prop") + public Integer getIntegerProp() { + return integerProp; + } + + @JsonProperty("integer_prop") + public void setIntegerProp(Integer integerProp) { + this.integerProp = integerProp; + } + + /** + **/ + public NullableClass numberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("number_prop") + @Valid public BigDecimal getNumberProp() { + return numberProp; + } + + @JsonProperty("number_prop") + public void setNumberProp(BigDecimal numberProp) { + this.numberProp = numberProp; + } + + /** + **/ + public NullableClass booleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("boolean_prop") + public Boolean getBooleanProp() { + return booleanProp; + } + + @JsonProperty("boolean_prop") + public void setBooleanProp(Boolean booleanProp) { + this.booleanProp = booleanProp; + } + + /** + **/ + public NullableClass stringProp(String stringProp) { + this.stringProp = stringProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("string_prop") + public String getStringProp() { + return stringProp; + } + + @JsonProperty("string_prop") + public void setStringProp(String stringProp) { + this.stringProp = stringProp; + } + + /** + **/ + public NullableClass dateProp(LocalDate dateProp) { + this.dateProp = dateProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("date_prop") + @Valid public LocalDate getDateProp() { + return dateProp; + } + + @JsonProperty("date_prop") + public void setDateProp(LocalDate dateProp) { + this.dateProp = dateProp; + } + + /** + **/ + public NullableClass datetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("datetime_prop") + @Valid public Date getDatetimeProp() { + return datetimeProp; + } + + @JsonProperty("datetime_prop") + public void setDatetimeProp(Date datetimeProp) { + this.datetimeProp = datetimeProp; + } + + /** + **/ + public NullableClass arrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("array_nullable_prop") + public List getArrayNullableProp() { + return arrayNullableProp; + } + + @JsonProperty("array_nullable_prop") + public void setArrayNullableProp(List arrayNullableProp) { + this.arrayNullableProp = arrayNullableProp; + } + + public NullableClass addArrayNullablePropItem(Object arrayNullablePropItem) { + if (this.arrayNullableProp == null) { + this.arrayNullableProp = new ArrayList<>(); + } + + this.arrayNullableProp.add(arrayNullablePropItem); + return this; + } + + public NullableClass removeArrayNullablePropItem(Object arrayNullablePropItem) { + if (arrayNullablePropItem != null && this.arrayNullableProp != null) { + this.arrayNullableProp.remove(arrayNullablePropItem); + } + + return this; + } + /** + **/ + public NullableClass arrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("array_and_items_nullable_prop") + public List getArrayAndItemsNullableProp() { + return arrayAndItemsNullableProp; + } + + @JsonProperty("array_and_items_nullable_prop") + public void setArrayAndItemsNullableProp(List arrayAndItemsNullableProp) { + this.arrayAndItemsNullableProp = arrayAndItemsNullableProp; + } + + public NullableClass addArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (this.arrayAndItemsNullableProp == null) { + this.arrayAndItemsNullableProp = new ArrayList<>(); + } + + this.arrayAndItemsNullableProp.add(arrayAndItemsNullablePropItem); + return this; + } + + public NullableClass removeArrayAndItemsNullablePropItem(Object arrayAndItemsNullablePropItem) { + if (arrayAndItemsNullablePropItem != null && this.arrayAndItemsNullableProp != null) { + this.arrayAndItemsNullableProp.remove(arrayAndItemsNullablePropItem); + } + + return this; + } + /** + **/ + public NullableClass arrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("array_items_nullable") + public List getArrayItemsNullable() { + return arrayItemsNullable; + } + + @JsonProperty("array_items_nullable") + public void setArrayItemsNullable(List arrayItemsNullable) { + this.arrayItemsNullable = arrayItemsNullable; + } + + public NullableClass addArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (this.arrayItemsNullable == null) { + this.arrayItemsNullable = new ArrayList<>(); + } + + this.arrayItemsNullable.add(arrayItemsNullableItem); + return this; + } + + public NullableClass removeArrayItemsNullableItem(Object arrayItemsNullableItem) { + if (arrayItemsNullableItem != null && this.arrayItemsNullable != null) { + this.arrayItemsNullable.remove(arrayItemsNullableItem); + } + + return this; + } + /** + **/ + public NullableClass objectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("object_nullable_prop") + public Map getObjectNullableProp() { + return objectNullableProp; + } + + @JsonProperty("object_nullable_prop") + public void setObjectNullableProp(Map objectNullableProp) { + this.objectNullableProp = objectNullableProp; + } + + public NullableClass putObjectNullablePropItem(String key, Object objectNullablePropItem) { + if (this.objectNullableProp == null) { + this.objectNullableProp = new HashMap<>(); + } + + this.objectNullableProp.put(key, objectNullablePropItem); + return this; + } + + public NullableClass removeObjectNullablePropItem(String key) { + if (this.objectNullableProp != null) { + this.objectNullableProp.remove(key); + } + + return this; + } + /** + **/ + public NullableClass objectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("object_and_items_nullable_prop") + public Map getObjectAndItemsNullableProp() { + return objectAndItemsNullableProp; + } + + @JsonProperty("object_and_items_nullable_prop") + public void setObjectAndItemsNullableProp(Map objectAndItemsNullableProp) { + this.objectAndItemsNullableProp = objectAndItemsNullableProp; + } + + public NullableClass putObjectAndItemsNullablePropItem(String key, Object objectAndItemsNullablePropItem) { + if (this.objectAndItemsNullableProp == null) { + this.objectAndItemsNullableProp = new HashMap<>(); + } + + this.objectAndItemsNullableProp.put(key, objectAndItemsNullablePropItem); + return this; + } + + public NullableClass removeObjectAndItemsNullablePropItem(String key) { + if (this.objectAndItemsNullableProp != null) { + this.objectAndItemsNullableProp.remove(key); + } + + return this; + } + /** + **/ + public NullableClass objectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("object_items_nullable") + public Map getObjectItemsNullable() { + return objectItemsNullable; + } + + @JsonProperty("object_items_nullable") + public void setObjectItemsNullable(Map objectItemsNullable) { + this.objectItemsNullable = objectItemsNullable; + } + + public NullableClass putObjectItemsNullableItem(String key, Object objectItemsNullableItem) { + if (this.objectItemsNullable == null) { + this.objectItemsNullable = new HashMap<>(); + } + + this.objectItemsNullable.put(key, objectItemsNullableItem); + return this; + } + + public NullableClass removeObjectItemsNullableItem(String key) { + if (this.objectItemsNullable != null) { + this.objectItemsNullable.remove(key); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + NullableClass nullableClass = (NullableClass) o; + return Objects.equals(this.integerProp, nullableClass.integerProp) && + Objects.equals(this.numberProp, nullableClass.numberProp) && + Objects.equals(this.booleanProp, nullableClass.booleanProp) && + Objects.equals(this.stringProp, nullableClass.stringProp) && + Objects.equals(this.dateProp, nullableClass.dateProp) && + Objects.equals(this.datetimeProp, nullableClass.datetimeProp) && + Objects.equals(this.arrayNullableProp, nullableClass.arrayNullableProp) && + Objects.equals(this.arrayAndItemsNullableProp, nullableClass.arrayAndItemsNullableProp) && + Objects.equals(this.arrayItemsNullable, nullableClass.arrayItemsNullable) && + Objects.equals(this.objectNullableProp, nullableClass.objectNullableProp) && + Objects.equals(this.objectAndItemsNullableProp, nullableClass.objectAndItemsNullableProp) && + Objects.equals(this.objectItemsNullable, nullableClass.objectItemsNullable) && + super.equals(o); + } + + @Override + public int hashCode() { + return Objects.hash(integerProp, numberProp, booleanProp, stringProp, dateProp, datetimeProp, arrayNullableProp, arrayAndItemsNullableProp, arrayItemsNullable, objectNullableProp, objectAndItemsNullableProp, objectItemsNullable, super.hashCode()); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class NullableClass {\n"); + sb.append(" ").append(toIndentedString(super.toString())).append("\n"); + sb.append(" integerProp: ").append(toIndentedString(integerProp)).append("\n"); + sb.append(" numberProp: ").append(toIndentedString(numberProp)).append("\n"); + sb.append(" booleanProp: ").append(toIndentedString(booleanProp)).append("\n"); + sb.append(" stringProp: ").append(toIndentedString(stringProp)).append("\n"); + sb.append(" dateProp: ").append(toIndentedString(dateProp)).append("\n"); + sb.append(" datetimeProp: ").append(toIndentedString(datetimeProp)).append("\n"); + sb.append(" arrayNullableProp: ").append(toIndentedString(arrayNullableProp)).append("\n"); + sb.append(" arrayAndItemsNullableProp: ").append(toIndentedString(arrayAndItemsNullableProp)).append("\n"); + sb.append(" arrayItemsNullable: ").append(toIndentedString(arrayItemsNullable)).append("\n"); + sb.append(" objectNullableProp: ").append(toIndentedString(objectNullableProp)).append("\n"); + sb.append(" objectAndItemsNullableProp: ").append(toIndentedString(objectAndItemsNullableProp)).append("\n"); + sb.append(" objectItemsNullable: ").append(toIndentedString(objectItemsNullable)).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/jaxrs-spec/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java new file mode 100644 index 000000000000..2e83493af040 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ObjectWithDeprecatedFields.java @@ -0,0 +1,223 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import org.openapitools.model.DeprecatedObject; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("ObjectWithDeprecatedFields") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class ObjectWithDeprecatedFields implements Serializable { + private String uuid; + private BigDecimal id; + private DeprecatedObject deprecatedRef; + private @Valid List bars = new ArrayList<>(); + + protected ObjectWithDeprecatedFields(ObjectWithDeprecatedFieldsBuilder b) { + this.uuid = b.uuid; + this.id = b.id; + this.deprecatedRef = b.deprecatedRef; + this.bars = b.bars; + } + + public ObjectWithDeprecatedFields() { + } + + /** + **/ + public ObjectWithDeprecatedFields uuid(String uuid) { + this.uuid = uuid; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("uuid") + public String getUuid() { + return uuid; + } + + @JsonProperty("uuid") + public void setUuid(String uuid) { + this.uuid = uuid; + } + + /** + **/ + public ObjectWithDeprecatedFields id(BigDecimal id) { + this.id = id; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("id") + @Valid public BigDecimal getId() { + return id; + } + + @JsonProperty("id") + public void setId(BigDecimal id) { + this.id = id; + } + + /** + **/ + public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("deprecatedRef") + @Valid public DeprecatedObject getDeprecatedRef() { + return deprecatedRef; + } + + @JsonProperty("deprecatedRef") + public void setDeprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + } + + /** + **/ + public ObjectWithDeprecatedFields bars(List bars) { + this.bars = bars; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("bars") + public List getBars() { + return bars; + } + + @JsonProperty("bars") + public void setBars(List bars) { + this.bars = bars; + } + + public ObjectWithDeprecatedFields addBarsItem(String barsItem) { + if (this.bars == null) { + this.bars = new ArrayList<>(); + } + + this.bars.add(barsItem); + return this; + } + + public ObjectWithDeprecatedFields removeBarsItem(String barsItem) { + if (barsItem != null && this.bars != null) { + this.bars.remove(barsItem); + } + + return this; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ObjectWithDeprecatedFields objectWithDeprecatedFields = (ObjectWithDeprecatedFields) o; + return Objects.equals(this.uuid, objectWithDeprecatedFields.uuid) && + Objects.equals(this.id, objectWithDeprecatedFields.id) && + Objects.equals(this.deprecatedRef, objectWithDeprecatedFields.deprecatedRef) && + Objects.equals(this.bars, objectWithDeprecatedFields.bars); + } + + @Override + public int hashCode() { + return Objects.hash(uuid, id, deprecatedRef, bars); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ObjectWithDeprecatedFields {\n"); + + sb.append(" uuid: ").append(toIndentedString(uuid)).append("\n"); + sb.append(" id: ").append(toIndentedString(id)).append("\n"); + sb.append(" deprecatedRef: ").append(toIndentedString(deprecatedRef)).append("\n"); + sb.append(" bars: ").append(toIndentedString(bars)).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 "); + } + + + public static ObjectWithDeprecatedFieldsBuilder builder() { + return new ObjectWithDeprecatedFieldsBuilderImpl(); + } + + private static final class ObjectWithDeprecatedFieldsBuilderImpl extends ObjectWithDeprecatedFieldsBuilder { + + @Override + protected ObjectWithDeprecatedFieldsBuilderImpl self() { + return this; + } + + @Override + public ObjectWithDeprecatedFields build() { + return new ObjectWithDeprecatedFields(this); + } + } + + public static abstract class ObjectWithDeprecatedFieldsBuilder> { + private String uuid; + private BigDecimal id; + private DeprecatedObject deprecatedRef; + private List bars = new ArrayList<>(); + protected abstract B self(); + + public abstract C build(); + + public B uuid(String uuid) { + this.uuid = uuid; + return self(); + } + public B id(BigDecimal id) { + this.id = id; + return self(); + } + public B deprecatedRef(DeprecatedObject deprecatedRef) { + this.deprecatedRef = deprecatedRef; + return self(); + } + public B bars(List bars) { + this.bars = bars; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java index a4780a6f6900..5f86922395d7 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnum.java @@ -36,7 +36,7 @@ public static OuterEnum fromString(String s) { return b; } } - throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + return null; } @Override @@ -52,7 +52,7 @@ public static OuterEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return null; } } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java new file mode 100644 index 000000000000..f9fd44c8deb0 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumDefaultValue.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumDefaultValue + */ +public enum OuterEnumDefaultValue { + + PLACED("placed"), + + APPROVED("approved"), + + DELIVERED("delivered"); + + private String value; + + OuterEnumDefaultValue(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumDefaultValue fromString(String s) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumDefaultValue fromValue(String value) { + for (OuterEnumDefaultValue b : OuterEnumDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumInteger.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumInteger.java new file mode 100644 index 000000000000..a81c0a77bebf --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumInteger.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumInteger + */ +public enum OuterEnumInteger { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumInteger(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumInteger fromString(String s) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumInteger fromValue(Integer value) { + for (OuterEnumInteger b : OuterEnumInteger.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java new file mode 100644 index 000000000000..3f16a4d4e458 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterEnumIntegerDefaultValue.java @@ -0,0 +1,59 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets OuterEnumIntegerDefaultValue + */ +public enum OuterEnumIntegerDefaultValue { + + NUMBER_0(0), + + NUMBER_1(1), + + NUMBER_2(2); + + private Integer value; + + OuterEnumIntegerDefaultValue(Integer value) { + this.value = value; + } + + /** + * Convert a String into Integer, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static OuterEnumIntegerDefaultValue fromString(String s) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static OuterEnumIntegerDefaultValue fromValue(Integer value) { + for (OuterEnumIntegerDefaultValue b : OuterEnumIntegerDefaultValue.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java new file mode 100644 index 000000000000..96e42d7ac57b --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/OuterObjectWithEnumProperty.java @@ -0,0 +1,119 @@ +package org.openapitools.model; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.model.OuterEnumInteger; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + + + +@JsonTypeName("OuterObjectWithEnumProperty") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class OuterObjectWithEnumProperty implements Serializable { + private OuterEnumInteger value; + + protected OuterObjectWithEnumProperty(OuterObjectWithEnumPropertyBuilder b) { + this.value = b.value; + } + + public OuterObjectWithEnumProperty() { + } + + /** + **/ + public OuterObjectWithEnumProperty value(OuterEnumInteger value) { + this.value = value; + return this; + } + + + @ApiModelProperty(required = true, value = "") + @JsonProperty("value") + @NotNull @Valid public OuterEnumInteger getValue() { + return value; + } + + @JsonProperty("value") + public void setValue(OuterEnumInteger value) { + this.value = value; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + OuterObjectWithEnumProperty outerObjectWithEnumProperty = (OuterObjectWithEnumProperty) o; + return Objects.equals(this.value, outerObjectWithEnumProperty.value); + } + + @Override + public int hashCode() { + return Objects.hash(value); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class OuterObjectWithEnumProperty {\n"); + + sb.append(" value: ").append(toIndentedString(value)).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 "); + } + + + public static OuterObjectWithEnumPropertyBuilder builder() { + return new OuterObjectWithEnumPropertyBuilderImpl(); + } + + private static final class OuterObjectWithEnumPropertyBuilderImpl extends OuterObjectWithEnumPropertyBuilder { + + @Override + protected OuterObjectWithEnumPropertyBuilderImpl self() { + return this; + } + + @Override + public OuterObjectWithEnumProperty build() { + return new OuterObjectWithEnumProperty(this); + } + } + + public static abstract class OuterObjectWithEnumPropertyBuilder> { + private OuterEnumInteger value; + protected abstract B self(); + + public abstract C build(); + + public B value(OuterEnumInteger value) { + this.value = value; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ParentWithNullable.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ParentWithNullable.java new file mode 100644 index 000000000000..5edda7b53e8e --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/ParentWithNullable.java @@ -0,0 +1,201 @@ +package org.openapitools.model; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonSubTypes; +import com.fasterxml.jackson.annotation.JsonTypeInfo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import org.openapitools.jackson.nullable.JsonNullable; +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import io.swagger.annotations.*; +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonTypeName; + +@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", visible = true) +@JsonSubTypes({ + @JsonSubTypes.Type(value = ChildWithNullable.class, name = "ChildWithNullable"), +}) + + +@JsonTypeName("ParentWithNullable") +@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") +public class ParentWithNullable implements Serializable { + public enum TypeEnum { + + CHILDWITHNULLABLE(String.valueOf("ChildWithNullable")); + + + private String value; + + TypeEnum (String v) { + value = v; + } + + public String value() { + return value; + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static TypeEnum fromString(String s) { + for (TypeEnum b : TypeEnum.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @JsonCreator + public static TypeEnum fromValue(String value) { + for (TypeEnum b : TypeEnum.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + private TypeEnum type; + private String nullableProperty; + + protected ParentWithNullable(ParentWithNullableBuilder b) { + this.type = b.type; + this.nullableProperty = b.nullableProperty; + } + + public ParentWithNullable() { + } + + /** + **/ + public ParentWithNullable type(TypeEnum type) { + this.type = type; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("type") + public TypeEnum getType() { + return type; + } + + @JsonProperty("type") + public void setType(TypeEnum type) { + this.type = type; + } + + /** + **/ + public ParentWithNullable nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return this; + } + + + @ApiModelProperty(value = "") + @JsonProperty("nullableProperty") + public String getNullableProperty() { + return nullableProperty; + } + + @JsonProperty("nullableProperty") + public void setNullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + } + + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + ParentWithNullable parentWithNullable = (ParentWithNullable) o; + return Objects.equals(this.type, parentWithNullable.type) && + Objects.equals(this.nullableProperty, parentWithNullable.nullableProperty); + } + + @Override + public int hashCode() { + return Objects.hash(type, nullableProperty); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class ParentWithNullable {\n"); + + sb.append(" type: ").append(toIndentedString(type)).append("\n"); + sb.append(" nullableProperty: ").append(toIndentedString(nullableProperty)).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 "); + } + + + public static ParentWithNullableBuilder builder() { + return new ParentWithNullableBuilderImpl(); + } + + private static final class ParentWithNullableBuilderImpl extends ParentWithNullableBuilder { + + @Override + protected ParentWithNullableBuilderImpl self() { + return this; + } + + @Override + public ParentWithNullable build() { + return new ParentWithNullable(this); + } + } + + public static abstract class ParentWithNullableBuilder> { + private TypeEnum type; + private String nullableProperty; + protected abstract B self(); + + public abstract C build(); + + public B type(TypeEnum type) { + this.type = type; + return self(); + } + public B nullableProperty(String nullableProperty) { + this.nullableProperty = nullableProperty; + return self(); + } + } +} + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SingleRefType.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SingleRefType.java new file mode 100644 index 000000000000..3314a0f57b45 --- /dev/null +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SingleRefType.java @@ -0,0 +1,57 @@ +package org.openapitools.model; + +import java.io.Serializable; +import javax.validation.constraints.*; +import javax.validation.Valid; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonValue; + +/** + * Gets or Sets SingleRefType + */ +public enum SingleRefType { + + ADMIN("admin"), + + USER("user"); + + private String value; + + SingleRefType(String value) { + this.value = value; + } + + /** + * Convert a String into String, as specified in the + * See JAX RS 2.0 Specification, section 3.2, p. 12 + */ + public static SingleRefType fromString(String s) { + for (SingleRefType b : SingleRefType.values()) { + // using Objects.toString() to be safe if value type non-object type + // because types like 'int' etc. will be auto-boxed + if (java.util.Objects.toString(b.value).equals(s)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected string value '" + s + "'"); + } + + @Override + @JsonValue + public String toString() { + return String.valueOf(value); + } + + @JsonCreator + public static SingleRefType fromValue(String value) { + for (SingleRefType b : SingleRefType.values()) { + if (b.value.equals(value)) { + return b; + } + } + throw new IllegalArgumentException("Unexpected value '" + value + "'"); + } +} + + diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java index 88792d979615..a64e1e844fc9 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/SpecialModelName.java @@ -16,7 +16,7 @@ -@JsonTypeName("$special[model.name]") +@JsonTypeName("_special_model.name_") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") public class SpecialModelName implements Serializable { private Long $specialPropertyName; @@ -56,8 +56,8 @@ public boolean equals(Object o) { 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/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java similarity index 58% rename from samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java rename to samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java index 1c36e555587c..90f363bc2539 100644 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/AdditionalPropertiesAnyType.java +++ b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TestInlineFreeformAdditionalPropertiesRequest.java @@ -1,5 +1,6 @@ package org.openapitools.model; +import com.fasterxml.jackson.annotation.JsonTypeName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.util.HashMap; @@ -17,28 +18,28 @@ -@JsonTypeName("AdditionalPropertiesAnyType") +@JsonTypeName("testInlineFreeformAdditionalProperties_request") @javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class AdditionalPropertiesAnyType extends HashMap implements Serializable { - private String name; +public class TestInlineFreeformAdditionalPropertiesRequest extends HashMap implements Serializable { + private String someProperty; /** **/ - public AdditionalPropertiesAnyType name(String name) { - this.name = name; + public TestInlineFreeformAdditionalPropertiesRequest someProperty(String someProperty) { + this.someProperty = someProperty; return this; } @ApiModelProperty(value = "") - @JsonProperty("name") - public String getName() { - return name; + @JsonProperty("someProperty") + public String getSomeProperty() { + return someProperty; } - @JsonProperty("name") - public void setName(String name) { - this.name = name; + @JsonProperty("someProperty") + public void setSomeProperty(String someProperty) { + this.someProperty = someProperty; } @@ -50,22 +51,22 @@ public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } - AdditionalPropertiesAnyType additionalPropertiesAnyType = (AdditionalPropertiesAnyType) o; - return Objects.equals(this.name, additionalPropertiesAnyType.name) && + TestInlineFreeformAdditionalPropertiesRequest testInlineFreeformAdditionalPropertiesRequest = (TestInlineFreeformAdditionalPropertiesRequest) o; + return Objects.equals(this.someProperty, testInlineFreeformAdditionalPropertiesRequest.someProperty) && super.equals(o); } @Override public int hashCode() { - return Objects.hash(name, super.hashCode()); + return Objects.hash(someProperty, super.hashCode()); } @Override public String toString() { StringBuilder sb = new StringBuilder(); - sb.append("class AdditionalPropertiesAnyType {\n"); + sb.append("class TestInlineFreeformAdditionalPropertiesRequest {\n"); sb.append(" ").append(toIndentedString(super.toString())).append("\n"); - sb.append(" name: ").append(toIndentedString(name)).append("\n"); + sb.append(" someProperty: ").append(toIndentedString(someProperty)).append("\n"); sb.append("}"); return sb.toString(); } diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java deleted file mode 100644 index a92f92dc6353..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderDefault.java +++ /dev/null @@ -1,250 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("TypeHolderDefault") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class TypeHolderDefault implements Serializable { - private String stringItem = "what"; - private BigDecimal numberItem; - private Integer integerItem; - private Boolean boolItem = true; - private @Valid List arrayItem = new ArrayList<>(); - - protected TypeHolderDefault(TypeHolderDefaultBuilder b) { - this.stringItem = b.stringItem; - this.numberItem = b.numberItem; - this.integerItem = b.integerItem; - this.boolItem = b.boolItem; - this.arrayItem = b.arrayItem; - } - - public TypeHolderDefault() { - } - - /** - **/ - public TypeHolderDefault stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - - @ApiModelProperty(required = true, value = "") - @JsonProperty("string_item") - @NotNull public String getStringItem() { - return stringItem; - } - - @JsonProperty("string_item") - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - /** - **/ - public TypeHolderDefault numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - - @ApiModelProperty(required = true, value = "") - @JsonProperty("number_item") - @NotNull @Valid public BigDecimal getNumberItem() { - return numberItem; - } - - @JsonProperty("number_item") - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - /** - **/ - public TypeHolderDefault integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - - @ApiModelProperty(required = true, value = "") - @JsonProperty("integer_item") - @NotNull public Integer getIntegerItem() { - return integerItem; - } - - @JsonProperty("integer_item") - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - /** - **/ - public TypeHolderDefault boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - - @ApiModelProperty(required = true, value = "") - @JsonProperty("bool_item") - @NotNull public Boolean getBoolItem() { - return boolItem; - } - - @JsonProperty("bool_item") - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - /** - **/ - public TypeHolderDefault arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - - @ApiModelProperty(required = true, value = "") - @JsonProperty("array_item") - @NotNull public List getArrayItem() { - return arrayItem; - } - - @JsonProperty("array_item") - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - - this.arrayItem.add(arrayItemItem); - return this; - } - - public TypeHolderDefault removeArrayItemItem(Integer arrayItemItem) { - if (arrayItemItem != null && this.arrayItem != null) { - this.arrayItem.remove(arrayItemItem); - } - - return this; - } - - @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 "); - } - - - public static TypeHolderDefaultBuilder builder() { - return new TypeHolderDefaultBuilderImpl(); - } - - private static final class TypeHolderDefaultBuilderImpl extends TypeHolderDefaultBuilder { - - @Override - protected TypeHolderDefaultBuilderImpl self() { - return this; - } - - @Override - public TypeHolderDefault build() { - return new TypeHolderDefault(this); - } - } - - public static abstract class TypeHolderDefaultBuilder> { - private String stringItem = "what"; - private BigDecimal numberItem; - private Integer integerItem; - private Boolean boolItem = true; - private List arrayItem = new ArrayList<>(); - protected abstract B self(); - - public abstract C build(); - - public B stringItem(String stringItem) { - this.stringItem = stringItem; - return self(); - } - public B numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return self(); - } - public B integerItem(Integer integerItem) { - this.integerItem = integerItem; - return self(); - } - public B boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return self(); - } - public B arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return self(); - } - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java deleted file mode 100644 index 2843c906a91b..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/TypeHolderExample.java +++ /dev/null @@ -1,278 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("TypeHolderExample") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class TypeHolderExample implements Serializable { - private String stringItem; - private BigDecimal numberItem; - private Float floatItem; - private Integer integerItem; - private Boolean boolItem; - private @Valid List arrayItem = new ArrayList<>(); - - protected TypeHolderExample(TypeHolderExampleBuilder b) { - this.stringItem = b.stringItem; - this.numberItem = b.numberItem; - this.floatItem = b.floatItem; - this.integerItem = b.integerItem; - this.boolItem = b.boolItem; - this.arrayItem = b.arrayItem; - } - - public TypeHolderExample() { - } - - /** - **/ - public TypeHolderExample stringItem(String stringItem) { - this.stringItem = stringItem; - return this; - } - - - @ApiModelProperty(example = "what", required = true, value = "") - @JsonProperty("string_item") - @NotNull public String getStringItem() { - return stringItem; - } - - @JsonProperty("string_item") - public void setStringItem(String stringItem) { - this.stringItem = stringItem; - } - - /** - **/ - public TypeHolderExample numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return this; - } - - - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty("number_item") - @NotNull @Valid public BigDecimal getNumberItem() { - return numberItem; - } - - @JsonProperty("number_item") - public void setNumberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - } - - /** - **/ - public TypeHolderExample floatItem(Float floatItem) { - this.floatItem = floatItem; - return this; - } - - - @ApiModelProperty(example = "1.234", required = true, value = "") - @JsonProperty("float_item") - @NotNull public Float getFloatItem() { - return floatItem; - } - - @JsonProperty("float_item") - public void setFloatItem(Float floatItem) { - this.floatItem = floatItem; - } - - /** - **/ - public TypeHolderExample integerItem(Integer integerItem) { - this.integerItem = integerItem; - return this; - } - - - @ApiModelProperty(example = "-2", required = true, value = "") - @JsonProperty("integer_item") - @NotNull public Integer getIntegerItem() { - return integerItem; - } - - @JsonProperty("integer_item") - public void setIntegerItem(Integer integerItem) { - this.integerItem = integerItem; - } - - /** - **/ - public TypeHolderExample boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return this; - } - - - @ApiModelProperty(example = "true", required = true, value = "") - @JsonProperty("bool_item") - @NotNull public Boolean getBoolItem() { - return boolItem; - } - - @JsonProperty("bool_item") - public void setBoolItem(Boolean boolItem) { - this.boolItem = boolItem; - } - - /** - **/ - public TypeHolderExample arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return this; - } - - - @ApiModelProperty(example = "[0, 1, 2, 3]", required = true, value = "") - @JsonProperty("array_item") - @NotNull public List getArrayItem() { - return arrayItem; - } - - @JsonProperty("array_item") - public void setArrayItem(List arrayItem) { - this.arrayItem = arrayItem; - } - - public TypeHolderExample addArrayItemItem(Integer arrayItemItem) { - if (this.arrayItem == null) { - this.arrayItem = new ArrayList<>(); - } - - this.arrayItem.add(arrayItemItem); - return this; - } - - public TypeHolderExample removeArrayItemItem(Integer arrayItemItem) { - if (arrayItemItem != null && this.arrayItem != null) { - this.arrayItem.remove(arrayItemItem); - } - - return this; - } - - @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 "); - } - - - public static TypeHolderExampleBuilder builder() { - return new TypeHolderExampleBuilderImpl(); - } - - private static final class TypeHolderExampleBuilderImpl extends TypeHolderExampleBuilder { - - @Override - protected TypeHolderExampleBuilderImpl self() { - return this; - } - - @Override - public TypeHolderExample build() { - return new TypeHolderExample(this); - } - } - - public static abstract class TypeHolderExampleBuilder> { - private String stringItem; - private BigDecimal numberItem; - private Float floatItem; - private Integer integerItem; - private Boolean boolItem; - private List arrayItem = new ArrayList<>(); - protected abstract B self(); - - public abstract C build(); - - public B stringItem(String stringItem) { - this.stringItem = stringItem; - return self(); - } - public B numberItem(BigDecimal numberItem) { - this.numberItem = numberItem; - return self(); - } - public B floatItem(Float floatItem) { - this.floatItem = floatItem; - return self(); - } - public B integerItem(Integer integerItem) { - this.integerItem = integerItem; - return self(); - } - public B boolItem(Boolean boolItem) { - this.boolItem = boolItem; - return self(); - } - public B arrayItem(List arrayItem) { - this.arrayItem = arrayItem; - return self(); - } - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java b/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java deleted file mode 100644 index 712b29ff2d74..000000000000 --- a/samples/server/petstore/jaxrs-spec/src/gen/java/org/openapitools/model/XmlItem.java +++ /dev/null @@ -1,1050 +0,0 @@ -package org.openapitools.model; - -import io.swagger.annotations.ApiModel; -import io.swagger.annotations.ApiModelProperty; -import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.io.Serializable; -import javax.validation.constraints.*; -import javax.validation.Valid; - -import io.swagger.annotations.*; -import java.util.Objects; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.annotation.JsonTypeName; - - - -@JsonTypeName("XmlItem") -@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen", comments = "Generator version: 7.6.0-SNAPSHOT") -public class XmlItem implements Serializable { - private String attributeString; - private BigDecimal attributeNumber; - private Integer attributeInteger; - private Boolean attributeBoolean; - private @Valid List wrappedArray = new ArrayList<>(); - private String nameString; - private BigDecimal nameNumber; - private Integer nameInteger; - private Boolean nameBoolean; - private @Valid List nameArray = new ArrayList<>(); - private @Valid List nameWrappedArray = new ArrayList<>(); - private String prefixString; - private BigDecimal prefixNumber; - private Integer prefixInteger; - private Boolean prefixBoolean; - private @Valid List prefixArray = new ArrayList<>(); - private @Valid List prefixWrappedArray = new ArrayList<>(); - private String namespaceString; - private BigDecimal namespaceNumber; - private Integer namespaceInteger; - private Boolean namespaceBoolean; - private @Valid List namespaceArray = new ArrayList<>(); - private @Valid List namespaceWrappedArray = new ArrayList<>(); - private String prefixNsString; - private BigDecimal prefixNsNumber; - private Integer prefixNsInteger; - private Boolean prefixNsBoolean; - private @Valid List prefixNsArray = new ArrayList<>(); - private @Valid List prefixNsWrappedArray = new ArrayList<>(); - - protected XmlItem(XmlItemBuilder b) { - this.attributeString = b.attributeString; - this.attributeNumber = b.attributeNumber; - this.attributeInteger = b.attributeInteger; - this.attributeBoolean = b.attributeBoolean; - this.wrappedArray = b.wrappedArray; - this.nameString = b.nameString; - this.nameNumber = b.nameNumber; - this.nameInteger = b.nameInteger; - this.nameBoolean = b.nameBoolean; - this.nameArray = b.nameArray; - this.nameWrappedArray = b.nameWrappedArray; - this.prefixString = b.prefixString; - this.prefixNumber = b.prefixNumber; - this.prefixInteger = b.prefixInteger; - this.prefixBoolean = b.prefixBoolean; - this.prefixArray = b.prefixArray; - this.prefixWrappedArray = b.prefixWrappedArray; - this.namespaceString = b.namespaceString; - this.namespaceNumber = b.namespaceNumber; - this.namespaceInteger = b.namespaceInteger; - this.namespaceBoolean = b.namespaceBoolean; - this.namespaceArray = b.namespaceArray; - this.namespaceWrappedArray = b.namespaceWrappedArray; - this.prefixNsString = b.prefixNsString; - this.prefixNsNumber = b.prefixNsNumber; - this.prefixNsInteger = b.prefixNsInteger; - this.prefixNsBoolean = b.prefixNsBoolean; - this.prefixNsArray = b.prefixNsArray; - this.prefixNsWrappedArray = b.prefixNsWrappedArray; - } - - public XmlItem() { - } - - /** - **/ - public XmlItem attributeString(String attributeString) { - this.attributeString = attributeString; - return this; - } - - - @ApiModelProperty(example = "string", value = "") - @JsonProperty("attribute_string") - public String getAttributeString() { - return attributeString; - } - - @JsonProperty("attribute_string") - public void setAttributeString(String attributeString) { - this.attributeString = attributeString; - } - - /** - **/ - public XmlItem attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return this; - } - - - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty("attribute_number") - @Valid public BigDecimal getAttributeNumber() { - return attributeNumber; - } - - @JsonProperty("attribute_number") - public void setAttributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - } - - /** - **/ - public XmlItem attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return this; - } - - - @ApiModelProperty(example = "-2", value = "") - @JsonProperty("attribute_integer") - public Integer getAttributeInteger() { - return attributeInteger; - } - - @JsonProperty("attribute_integer") - public void setAttributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - } - - /** - **/ - public XmlItem attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return this; - } - - - @ApiModelProperty(example = "true", value = "") - @JsonProperty("attribute_boolean") - public Boolean getAttributeBoolean() { - return attributeBoolean; - } - - @JsonProperty("attribute_boolean") - public void setAttributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - } - - /** - **/ - public XmlItem wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("wrapped_array") - public List getWrappedArray() { - return wrappedArray; - } - - @JsonProperty("wrapped_array") - public void setWrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - } - - public XmlItem addWrappedArrayItem(Integer wrappedArrayItem) { - if (this.wrappedArray == null) { - this.wrappedArray = new ArrayList<>(); - } - - this.wrappedArray.add(wrappedArrayItem); - return this; - } - - public XmlItem removeWrappedArrayItem(Integer wrappedArrayItem) { - if (wrappedArrayItem != null && this.wrappedArray != null) { - this.wrappedArray.remove(wrappedArrayItem); - } - - return this; - } - /** - **/ - public XmlItem nameString(String nameString) { - this.nameString = nameString; - return this; - } - - - @ApiModelProperty(example = "string", value = "") - @JsonProperty("name_string") - public String getNameString() { - return nameString; - } - - @JsonProperty("name_string") - public void setNameString(String nameString) { - this.nameString = nameString; - } - - /** - **/ - public XmlItem nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return this; - } - - - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty("name_number") - @Valid public BigDecimal getNameNumber() { - return nameNumber; - } - - @JsonProperty("name_number") - public void setNameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - } - - /** - **/ - public XmlItem nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return this; - } - - - @ApiModelProperty(example = "-2", value = "") - @JsonProperty("name_integer") - public Integer getNameInteger() { - return nameInteger; - } - - @JsonProperty("name_integer") - public void setNameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - } - - /** - **/ - public XmlItem nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return this; - } - - - @ApiModelProperty(example = "true", value = "") - @JsonProperty("name_boolean") - public Boolean getNameBoolean() { - return nameBoolean; - } - - @JsonProperty("name_boolean") - public void setNameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - } - - /** - **/ - public XmlItem nameArray(List nameArray) { - this.nameArray = nameArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("name_array") - public List getNameArray() { - return nameArray; - } - - @JsonProperty("name_array") - public void setNameArray(List nameArray) { - this.nameArray = nameArray; - } - - public XmlItem addNameArrayItem(Integer nameArrayItem) { - if (this.nameArray == null) { - this.nameArray = new ArrayList<>(); - } - - this.nameArray.add(nameArrayItem); - return this; - } - - public XmlItem removeNameArrayItem(Integer nameArrayItem) { - if (nameArrayItem != null && this.nameArray != null) { - this.nameArray.remove(nameArrayItem); - } - - return this; - } - /** - **/ - public XmlItem nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("name_wrapped_array") - public List getNameWrappedArray() { - return nameWrappedArray; - } - - @JsonProperty("name_wrapped_array") - public void setNameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - } - - public XmlItem addNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (this.nameWrappedArray == null) { - this.nameWrappedArray = new ArrayList<>(); - } - - this.nameWrappedArray.add(nameWrappedArrayItem); - return this; - } - - public XmlItem removeNameWrappedArrayItem(Integer nameWrappedArrayItem) { - if (nameWrappedArrayItem != null && this.nameWrappedArray != null) { - this.nameWrappedArray.remove(nameWrappedArrayItem); - } - - return this; - } - /** - **/ - public XmlItem prefixString(String prefixString) { - this.prefixString = prefixString; - return this; - } - - - @ApiModelProperty(example = "string", value = "") - @JsonProperty("prefix_string") - public String getPrefixString() { - return prefixString; - } - - @JsonProperty("prefix_string") - public void setPrefixString(String prefixString) { - this.prefixString = prefixString; - } - - /** - **/ - public XmlItem prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return this; - } - - - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty("prefix_number") - @Valid public BigDecimal getPrefixNumber() { - return prefixNumber; - } - - @JsonProperty("prefix_number") - public void setPrefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - } - - /** - **/ - public XmlItem prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return this; - } - - - @ApiModelProperty(example = "-2", value = "") - @JsonProperty("prefix_integer") - public Integer getPrefixInteger() { - return prefixInteger; - } - - @JsonProperty("prefix_integer") - public void setPrefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - } - - /** - **/ - public XmlItem prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return this; - } - - - @ApiModelProperty(example = "true", value = "") - @JsonProperty("prefix_boolean") - public Boolean getPrefixBoolean() { - return prefixBoolean; - } - - @JsonProperty("prefix_boolean") - public void setPrefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - } - - /** - **/ - public XmlItem prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("prefix_array") - public List getPrefixArray() { - return prefixArray; - } - - @JsonProperty("prefix_array") - public void setPrefixArray(List prefixArray) { - this.prefixArray = prefixArray; - } - - public XmlItem addPrefixArrayItem(Integer prefixArrayItem) { - if (this.prefixArray == null) { - this.prefixArray = new ArrayList<>(); - } - - this.prefixArray.add(prefixArrayItem); - return this; - } - - public XmlItem removePrefixArrayItem(Integer prefixArrayItem) { - if (prefixArrayItem != null && this.prefixArray != null) { - this.prefixArray.remove(prefixArrayItem); - } - - return this; - } - /** - **/ - public XmlItem prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("prefix_wrapped_array") - public List getPrefixWrappedArray() { - return prefixWrappedArray; - } - - @JsonProperty("prefix_wrapped_array") - public void setPrefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - } - - public XmlItem addPrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (this.prefixWrappedArray == null) { - this.prefixWrappedArray = new ArrayList<>(); - } - - this.prefixWrappedArray.add(prefixWrappedArrayItem); - return this; - } - - public XmlItem removePrefixWrappedArrayItem(Integer prefixWrappedArrayItem) { - if (prefixWrappedArrayItem != null && this.prefixWrappedArray != null) { - this.prefixWrappedArray.remove(prefixWrappedArrayItem); - } - - return this; - } - /** - **/ - public XmlItem namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return this; - } - - - @ApiModelProperty(example = "string", value = "") - @JsonProperty("namespace_string") - public String getNamespaceString() { - return namespaceString; - } - - @JsonProperty("namespace_string") - public void setNamespaceString(String namespaceString) { - this.namespaceString = namespaceString; - } - - /** - **/ - public XmlItem namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return this; - } - - - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty("namespace_number") - @Valid public BigDecimal getNamespaceNumber() { - return namespaceNumber; - } - - @JsonProperty("namespace_number") - public void setNamespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - } - - /** - **/ - public XmlItem namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return this; - } - - - @ApiModelProperty(example = "-2", value = "") - @JsonProperty("namespace_integer") - public Integer getNamespaceInteger() { - return namespaceInteger; - } - - @JsonProperty("namespace_integer") - public void setNamespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - } - - /** - **/ - public XmlItem namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return this; - } - - - @ApiModelProperty(example = "true", value = "") - @JsonProperty("namespace_boolean") - public Boolean getNamespaceBoolean() { - return namespaceBoolean; - } - - @JsonProperty("namespace_boolean") - public void setNamespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - } - - /** - **/ - public XmlItem namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("namespace_array") - public List getNamespaceArray() { - return namespaceArray; - } - - @JsonProperty("namespace_array") - public void setNamespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - } - - public XmlItem addNamespaceArrayItem(Integer namespaceArrayItem) { - if (this.namespaceArray == null) { - this.namespaceArray = new ArrayList<>(); - } - - this.namespaceArray.add(namespaceArrayItem); - return this; - } - - public XmlItem removeNamespaceArrayItem(Integer namespaceArrayItem) { - if (namespaceArrayItem != null && this.namespaceArray != null) { - this.namespaceArray.remove(namespaceArrayItem); - } - - return this; - } - /** - **/ - public XmlItem namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("namespace_wrapped_array") - public List getNamespaceWrappedArray() { - return namespaceWrappedArray; - } - - @JsonProperty("namespace_wrapped_array") - public void setNamespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - } - - public XmlItem addNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (this.namespaceWrappedArray == null) { - this.namespaceWrappedArray = new ArrayList<>(); - } - - this.namespaceWrappedArray.add(namespaceWrappedArrayItem); - return this; - } - - public XmlItem removeNamespaceWrappedArrayItem(Integer namespaceWrappedArrayItem) { - if (namespaceWrappedArrayItem != null && this.namespaceWrappedArray != null) { - this.namespaceWrappedArray.remove(namespaceWrappedArrayItem); - } - - return this; - } - /** - **/ - public XmlItem prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return this; - } - - - @ApiModelProperty(example = "string", value = "") - @JsonProperty("prefix_ns_string") - public String getPrefixNsString() { - return prefixNsString; - } - - @JsonProperty("prefix_ns_string") - public void setPrefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - } - - /** - **/ - public XmlItem prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return this; - } - - - @ApiModelProperty(example = "1.234", value = "") - @JsonProperty("prefix_ns_number") - @Valid public BigDecimal getPrefixNsNumber() { - return prefixNsNumber; - } - - @JsonProperty("prefix_ns_number") - public void setPrefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - } - - /** - **/ - public XmlItem prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return this; - } - - - @ApiModelProperty(example = "-2", value = "") - @JsonProperty("prefix_ns_integer") - public Integer getPrefixNsInteger() { - return prefixNsInteger; - } - - @JsonProperty("prefix_ns_integer") - public void setPrefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - } - - /** - **/ - public XmlItem prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return this; - } - - - @ApiModelProperty(example = "true", value = "") - @JsonProperty("prefix_ns_boolean") - public Boolean getPrefixNsBoolean() { - return prefixNsBoolean; - } - - @JsonProperty("prefix_ns_boolean") - public void setPrefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - } - - /** - **/ - public XmlItem prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("prefix_ns_array") - public List getPrefixNsArray() { - return prefixNsArray; - } - - @JsonProperty("prefix_ns_array") - public void setPrefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - } - - public XmlItem addPrefixNsArrayItem(Integer prefixNsArrayItem) { - if (this.prefixNsArray == null) { - this.prefixNsArray = new ArrayList<>(); - } - - this.prefixNsArray.add(prefixNsArrayItem); - return this; - } - - public XmlItem removePrefixNsArrayItem(Integer prefixNsArrayItem) { - if (prefixNsArrayItem != null && this.prefixNsArray != null) { - this.prefixNsArray.remove(prefixNsArrayItem); - } - - return this; - } - /** - **/ - public XmlItem prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return this; - } - - - @ApiModelProperty(value = "") - @JsonProperty("prefix_ns_wrapped_array") - public List getPrefixNsWrappedArray() { - return prefixNsWrappedArray; - } - - @JsonProperty("prefix_ns_wrapped_array") - public void setPrefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - } - - public XmlItem addPrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (this.prefixNsWrappedArray == null) { - this.prefixNsWrappedArray = new ArrayList<>(); - } - - this.prefixNsWrappedArray.add(prefixNsWrappedArrayItem); - return this; - } - - public XmlItem removePrefixNsWrappedArrayItem(Integer prefixNsWrappedArrayItem) { - if (prefixNsWrappedArrayItem != null && this.prefixNsWrappedArray != null) { - this.prefixNsWrappedArray.remove(prefixNsWrappedArrayItem); - } - - return this; - } - - @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 "); - } - - - public static XmlItemBuilder builder() { - return new XmlItemBuilderImpl(); - } - - private static final class XmlItemBuilderImpl extends XmlItemBuilder { - - @Override - protected XmlItemBuilderImpl self() { - return this; - } - - @Override - public XmlItem build() { - return new XmlItem(this); - } - } - - public static abstract class XmlItemBuilder> { - private String attributeString; - private BigDecimal attributeNumber; - private Integer attributeInteger; - private Boolean attributeBoolean; - private List wrappedArray = new ArrayList<>(); - private String nameString; - private BigDecimal nameNumber; - private Integer nameInteger; - private Boolean nameBoolean; - private List nameArray = new ArrayList<>(); - private List nameWrappedArray = new ArrayList<>(); - private String prefixString; - private BigDecimal prefixNumber; - private Integer prefixInteger; - private Boolean prefixBoolean; - private List prefixArray = new ArrayList<>(); - private List prefixWrappedArray = new ArrayList<>(); - private String namespaceString; - private BigDecimal namespaceNumber; - private Integer namespaceInteger; - private Boolean namespaceBoolean; - private List namespaceArray = new ArrayList<>(); - private List namespaceWrappedArray = new ArrayList<>(); - private String prefixNsString; - private BigDecimal prefixNsNumber; - private Integer prefixNsInteger; - private Boolean prefixNsBoolean; - private List prefixNsArray = new ArrayList<>(); - private List prefixNsWrappedArray = new ArrayList<>(); - protected abstract B self(); - - public abstract C build(); - - public B attributeString(String attributeString) { - this.attributeString = attributeString; - return self(); - } - public B attributeNumber(BigDecimal attributeNumber) { - this.attributeNumber = attributeNumber; - return self(); - } - public B attributeInteger(Integer attributeInteger) { - this.attributeInteger = attributeInteger; - return self(); - } - public B attributeBoolean(Boolean attributeBoolean) { - this.attributeBoolean = attributeBoolean; - return self(); - } - public B wrappedArray(List wrappedArray) { - this.wrappedArray = wrappedArray; - return self(); - } - public B nameString(String nameString) { - this.nameString = nameString; - return self(); - } - public B nameNumber(BigDecimal nameNumber) { - this.nameNumber = nameNumber; - return self(); - } - public B nameInteger(Integer nameInteger) { - this.nameInteger = nameInteger; - return self(); - } - public B nameBoolean(Boolean nameBoolean) { - this.nameBoolean = nameBoolean; - return self(); - } - public B nameArray(List nameArray) { - this.nameArray = nameArray; - return self(); - } - public B nameWrappedArray(List nameWrappedArray) { - this.nameWrappedArray = nameWrappedArray; - return self(); - } - public B prefixString(String prefixString) { - this.prefixString = prefixString; - return self(); - } - public B prefixNumber(BigDecimal prefixNumber) { - this.prefixNumber = prefixNumber; - return self(); - } - public B prefixInteger(Integer prefixInteger) { - this.prefixInteger = prefixInteger; - return self(); - } - public B prefixBoolean(Boolean prefixBoolean) { - this.prefixBoolean = prefixBoolean; - return self(); - } - public B prefixArray(List prefixArray) { - this.prefixArray = prefixArray; - return self(); - } - public B prefixWrappedArray(List prefixWrappedArray) { - this.prefixWrappedArray = prefixWrappedArray; - return self(); - } - public B namespaceString(String namespaceString) { - this.namespaceString = namespaceString; - return self(); - } - public B namespaceNumber(BigDecimal namespaceNumber) { - this.namespaceNumber = namespaceNumber; - return self(); - } - public B namespaceInteger(Integer namespaceInteger) { - this.namespaceInteger = namespaceInteger; - return self(); - } - public B namespaceBoolean(Boolean namespaceBoolean) { - this.namespaceBoolean = namespaceBoolean; - return self(); - } - public B namespaceArray(List namespaceArray) { - this.namespaceArray = namespaceArray; - return self(); - } - public B namespaceWrappedArray(List namespaceWrappedArray) { - this.namespaceWrappedArray = namespaceWrappedArray; - return self(); - } - public B prefixNsString(String prefixNsString) { - this.prefixNsString = prefixNsString; - return self(); - } - public B prefixNsNumber(BigDecimal prefixNsNumber) { - this.prefixNsNumber = prefixNsNumber; - return self(); - } - public B prefixNsInteger(Integer prefixNsInteger) { - this.prefixNsInteger = prefixNsInteger; - return self(); - } - public B prefixNsBoolean(Boolean prefixNsBoolean) { - this.prefixNsBoolean = prefixNsBoolean; - return self(); - } - public B prefixNsArray(List prefixNsArray) { - this.prefixNsArray = prefixNsArray; - return self(); - } - public B prefixNsWrappedArray(List prefixNsWrappedArray) { - this.prefixNsWrappedArray = prefixNsWrappedArray; - return self(); - } - } -} - diff --git a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml b/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml index 6415519aac29..d456aa0a571c 100644 --- a/samples/server/petstore/jaxrs-spec/src/main/openapi/openapi.yaml +++ b/samples/server/petstore/jaxrs-spec/src/main/openapi/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:\ @@ -9,7 +9,30 @@ info: title: OpenAPI Petstore version: 1.0.0 servers: -- url: http://petstore.swagger.io:80/v2 +- description: petstore server + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" +- description: The local server + url: "https://localhost:8080/{version}" + variables: + version: + default: v2 + enum: + - v1 + - v2 +- description: The local server without variables + url: https://127.0.0.1/no_varaible tags: - description: Everything about your Pets name: pet @@ -18,25 +41,27 @@ tags: - description: Operations about user name: user paths: + /foo: + get: + responses: + default: + content: + application/json: + schema: + $ref: '#/components/schemas/_foo_get_default_response' + description: response + x-accepts: + - application/json /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 + description: Successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -45,36 +70,24 @@ 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 + description: Successful operation "400": - content: {} description: Invalid ID supplied "404": - content: {} description: Pet not found "405": - content: {} description: Validation exception security: - petstore_auth: @@ -83,18 +96,37 @@ paths: summary: Update an existing pet tags: - pet - x-codegen-request-body-name: body + x-webclient-blocking: true x-content-type: application/json x-accepts: - application/json x-tags: - tag: pet + servers: + - url: http://petstore.swagger.io/v2 + - url: http://path-server-test.petstore.local/v2 + - description: test server with variables + url: "http://{server}.swagger.io:{port}/v2" + variables: + server: + default: petstore + description: target server + enum: + - petstore + - qa-petstore + - dev-petstore + port: + default: "80" + enum: + - "80" + - "8080" /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 + - deprecated: true + description: Status values that need to be considered for filter explode: false in: query name: status @@ -124,7 +156,6 @@ paths: type: array description: successful operation "400": - content: {} description: Invalid status value security: - petstore_auth: @@ -133,6 +164,7 @@ paths: summary: Finds Pets by status tags: - pet + x-webclient-blocking: true x-accepts: - application/json - application/xml @@ -173,7 +205,6 @@ paths: uniqueItems: true description: successful operation "400": - content: {} description: Invalid tag value security: - petstore_auth: @@ -182,6 +213,7 @@ paths: summary: Finds Pets by tags tags: - pet + x-webclient-blocking: true x-accepts: - application/json - application/xml @@ -189,25 +221,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 + description: Successful operation "400": - content: {} description: Invalid pet value security: - petstore_auth: @@ -225,12 +261,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: @@ -242,39 +280,42 @@ paths: $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-webclient-blocking: true x-accepts: - application/json - application/xml 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: schema: $ref: '#/components/schemas/updatePetWithForm_request' responses: + "200": + description: Successful operation "405": - content: {} description: Invalid input security: - petstore_auth: @@ -290,15 +331,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: @@ -342,16 +386,18 @@ paths: summary: Returns pet inventories by status tags: - store + x-webclient-blocking: false x-accepts: - application/json x-tags: - tag: store /store/order: post: + description: "" operationId: placeOrder requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/Order' description: order placed for purchasing the pet @@ -367,13 +413,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 - application/xml @@ -386,17 +430,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: @@ -411,6 +455,7 @@ paths: operationId: getOrderById parameters: - description: ID of pet that needs to be fetched + explode: false in: path name: order_id required: true @@ -419,6 +464,7 @@ paths: maximum: 5 minimum: 1 type: integer + style: simple responses: "200": content: @@ -430,10 +476,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: @@ -449,90 +493,77 @@ 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: @@ -546,16 +577,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: @@ -567,10 +601,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: @@ -585,17 +619,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: @@ -605,14 +639,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: @@ -624,10 +661,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: @@ -642,30 +677,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: @@ -675,12 +709,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: @@ -693,7 +722,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 @@ -705,44 +733,60 @@ 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 + security: + - bearer_test: [] summary: Fake endpoint to test group parameters (optional) tags: - fake @@ -759,6 +803,7 @@ paths: explode: false in: header name: enum_header_string_array + required: false schema: items: default: $ @@ -769,8 +814,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: @@ -778,10 +825,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: $ @@ -792,8 +841,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: @@ -801,24 +852,40 @@ 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 + - explode: true + in: query + name: enum_query_model_array + required: false + schema: + items: + $ref: '#/components/schemas/EnumClass' + type: array + style: form requestBody: content: application/x-www-form-urlencoded: @@ -826,10 +893,8 @@ paths: $ref: '#/components/schemas/testEnumParameters_request' responses: "400": - content: {} description: Invalid request "404": - content: {} description: Not found summary: To test enum parameters tags: @@ -843,12 +908,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: @@ -859,39 +919,35 @@ 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: - tag: fake post: - description: |- + 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: |- + summary: | Fake endpoint for testing various parameters - 假端點 - 偽のエンドポイント - 가짜 엔드 포인트 + 假端點 + 偽のエンドポイント + 가짜 엔드 포인트 tags: - fake x-content-type: application/x-www-form-urlencoded @@ -905,11 +961,10 @@ paths: operationId: fakeOuterNumberSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterNumber' description: Input number as post body - required: false responses: "200": content: @@ -919,8 +974,32 @@ 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 + /fake/property/enum-int: + post: + description: Test serialization of enum (int) properties with examples + operationId: fakePropertyEnumIntegerSerialize + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Input enum (int) as post body + required: true + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/OuterObjectWithEnumProperty' + description: Output enum (int) + tags: + - fake + x-content-type: application/json x-accepts: - '*/*' x-tags: @@ -931,11 +1010,10 @@ paths: operationId: fakeOuterStringSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterString' description: Input string as post body - required: false responses: "200": content: @@ -945,8 +1023,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: @@ -957,11 +1034,10 @@ paths: operationId: fakeOuterBooleanSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterBoolean' description: Input boolean as post body - required: false responses: "200": content: @@ -971,8 +1047,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: @@ -983,11 +1058,10 @@ paths: operationId: fakeOuterCompositeSerialize requestBody: content: - '*/*': + application/json: schema: $ref: '#/components/schemas/OuterComposite' description: Input composite as post body - required: false responses: "200": content: @@ -997,24 +1071,40 @@ 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/BigDecimalMap: + get: + description: "for Java apache and Java native, test toUrlQueryString for maps\ + \ with BegDecimal keys" + operationId: fakeBigDecimalMap + responses: + "200": + content: + '*/*': + schema: + $ref: '#/components/schemas/fakeBigDecimalMap_200_response' + description: successful operation + tags: + - fake 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: @@ -1024,8 +1114,53 @@ paths: - application/json x-tags: - tag: fake + /fake/additionalProperties-reference: + post: + description: "" + operationId: testAdditionalPropertiesReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/FreeFormObject' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced additionalProperties + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/stringMap-reference: + post: + description: "" + operationId: testStringMapReference + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/MapOfString' + description: request body + required: true + responses: + "200": + description: successful operation + summary: test referenced string map + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake /fake/inline-additionalProperties: post: + description: "" operationId: testInlineAdditionalProperties requestBody: content: @@ -1038,102 +1173,92 @@ 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: - tag: fake - /fake/body-with-query-params: - put: - operationId: testBodyWithQueryParams - parameters: - - in: query - name: query - required: true - schema: - type: string + /fake/inline-freeform-additionalProperties: + post: + description: "" + operationId: testInlineFreeformAdditionalProperties requestBody: content: application/json: schema: - $ref: '#/components/schemas/User' + $ref: '#/components/schemas/testInlineFreeformAdditionalProperties_request' + description: request body required: true responses: "200": - content: {} - description: Success + description: successful operation + summary: test inline free-form additionalProperties 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: + /fake/nullable: post: - description: this route creates an XmlItem - operationId: createXmlItem + description: "" + operationId: testNullable 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: + application/json: schema: - $ref: '#/components/schemas/XmlItem' - description: XmlItem Body + $ref: '#/components/schemas/ChildWithNullable' + description: request body required: true responses: "200": - content: {} description: successful operation - summary: creates an XmlItem + summary: test nullable parent property tags: - fake - x-codegen-request-body-name: XmlItem - x-content-type: application/xml + x-content-type: application/json 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 + /fake/body-with-query-params: + put: + operationId: testBodyWithQueryParams parameters: - - description: to test uuid example value - in: header - name: uuid_test + - explode: true + in: query + name: query required: true schema: - format: uuid type: string + style: form requestBody: content: application/json: schema: - $ref: '#/components/schemas/Client' - description: client model + $ref: '#/components/schemas/User' required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: application/json + 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: + $ref: '#/components/requestBodies/Client' responses: "200": content: @@ -1144,7 +1269,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 @@ -1152,7 +1276,7 @@ paths: - tag: $another-fake? /fake/body-with-file-schema: put: - description: "For this test, the body for this request much reference a schema\ + description: "For this test, the body for this request must reference a schema\ \ named `File`." operationId: testBodyWithFileSchema requestBody: @@ -1163,16 +1287,37 @@ 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: - tag: fake + /fake/body-with-binary: + put: + description: "For this test, the body has to be a binary file." + operationId: testBodyWithBinary + requestBody: + content: + image/png: + schema: + format: binary + nullable: true + type: string + description: image to upload + required: true + responses: + "200": + description: Success + tags: + - fake + x-content-type: image/png + x-accepts: + - application/json + x-tags: + - tag: fake /fake/test-query-parameters: put: description: To test the collection format in query parameters @@ -1186,15 +1331,18 @@ paths: items: type: string type: array - style: form - - in: query + style: pipeDelimited + - explode: false + in: query name: ioutil required: true schema: items: type: string type: array - - in: query + style: form + - explode: false + in: query name: http required: true schema: @@ -1220,9 +1368,26 @@ paths: type: string type: array style: form + - explode: true + in: query + name: language + required: false + schema: + additionalProperties: + format: string + type: string + type: object + style: form + - allowEmptyValue: true + explode: true + in: query + name: allowEmpty + required: true + schema: + type: string + style: form responses: "200": - content: {} description: Success tags: - fake @@ -1232,21 +1397,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: @@ -1266,8 +1433,97 @@ paths: - application/json x-tags: - tag: pet + /fake/health: + get: + responses: + "200": + content: + application/json: + schema: + $ref: '#/components/schemas/HealthCheckResult' + description: The instance started successfully + summary: Health check endpoint + tags: + - fake + x-accepts: + - application/json + x-tags: + - tag: fake + /fake/http-signature-test: + get: + operationId: fake-http-signature-test + parameters: + - description: query parameter + explode: true + in: query + name: query_1 + required: false + schema: + type: string + style: form + - description: header parameter + explode: false + in: header + name: header_1 + required: false + schema: + type: string + style: simple + requestBody: + $ref: '#/components/requestBodies/Pet' + responses: + "200": + description: The instance started successfully + security: + - http_signature_test: [] + summary: test http signature authentication + tags: + - fake + x-content-type: application/json + x-accepts: + - application/json + x-tags: + - tag: fake components: + requestBodies: + UserArray: + content: + application/json: + schema: + items: + $ref: '#/components/schemas/User' + type: array + description: List of user object + required: true + Client: + content: + application/json: + schema: + $ref: '#/components/schemas/Client' + description: client model + required: true + Pet: + content: + application/json: + schema: + $ref: '#/components/schemas/Pet' + application/xml: + schema: + $ref: '#/components/schemas/Pet' + description: Pet object that needs to be added to the store + required: true schemas: + Foo: + example: + bar: bar + properties: + bar: + default: bar + type: string + type: object + Bar: + default: bar + type: string Order: example: petId: 6 @@ -1433,21 +1689,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: @@ -1467,7 +1714,6 @@ components: type: integer required: - name - type: object xml: name: Name "200_response": @@ -1478,7 +1724,6 @@ components: type: integer class: type: string - type: object xml: name: Name ClassModel: @@ -1486,7 +1731,6 @@ components: properties: _class: type: string - type: object Dog: allOf: - $ref: '#/components/schemas/Animal' @@ -1501,20 +1745,11 @@ components: declawed: type: boolean type: object - BigCat: - allOf: - - $ref: '#/components/schemas/Cat' - - properties: - kind: - enum: - - lions - - tigers - - leopards - - jaguars - type: string - type: object Animal: discriminator: + mapping: + DOG: '#/components/schemas/Dog' + CAT: '#/components/schemas/Cat' propertyName: className properties: className: @@ -1557,12 +1792,14 @@ components: maximum: 123.4 minimum: 67.8 type: number + decimal: + format: number + type: string 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 @@ -1582,8 +1819,14 @@ components: maxLength: 64 minLength: 10 type: string - BigDecimal: - format: number + pattern_with_digits: + description: A string that is a 10 digit number. Can have leading zeros. + pattern: "^\\d{10}$" + type: string + pattern_with_digits_and_delimiter: + description: A string starting with 'image_' (case insensitive) and one + to three digits following i.e. Image_01. + pattern: "/^image_\\d{1,3}$/i" type: string required: - byte @@ -1626,117 +1869,27 @@ components: type: number outerEnum: $ref: '#/components/schemas/OuterEnum' + outerEnumInteger: + $ref: '#/components/schemas/OuterEnumInteger' + outerEnumDefaultValue: + $ref: '#/components/schemas/OuterEnumDefaultValue' + outerEnumIntegerDefaultValue: + $ref: '#/components/schemas/OuterEnumIntegerDefaultValue' required: - enum_string_required type: object AdditionalPropertiesClass: properties: - map_string: + map_property: 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: + map_of_map_property: 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: @@ -1826,6 +1979,8 @@ components: array_of_string: items: type: string + maxItems: 3 + minItems: 0 type: array array_array_of_integer: items: @@ -1877,12 +2032,43 @@ components: type: string type: array type: object + FreeFormObject: + additionalProperties: true + description: A schema consisting only of additional properties + type: object + MapOfString: + additionalProperties: + type: string + description: A schema consisting only of additional properties of type string + type: object OuterEnum: + enum: + - placed + - approved + - delivered + nullable: true + type: string + OuterEnumInteger: + enum: + - 0 + - 1 + - 2 + example: 2 + type: integer + OuterEnumDefaultValue: + default: placed enum: - placed - approved - delivered type: string + OuterEnumIntegerDefaultValue: + default: 0 + enum: + - 0 + - 1 + - 2 + type: integer OuterComposite: example: my_string: my_string @@ -1904,6 +2090,29 @@ components: OuterBoolean: type: boolean x-codegen-body-parameter-name: boolean_post_body + ParentWithNullable: + discriminator: + propertyName: type + properties: + type: + enum: + - ChildWithNullable + type: string + nullableProperty: + nullable: true + type: string + type: object + ChildWithNullable: + allOf: + - $ref: '#/components/schemas/ParentWithNullable' + - properties: + otherProperty: + type: string + type: object + example: + otherProperty: otherProperty + nullableProperty: nullableProperty + type: ChildWithNullable StringBooleanMap: additionalProperties: type: boolean @@ -1932,243 +2141,133 @@ components: description: Test capitalization type: string type: object - TypeHolderDefault: + _special_model.name_: properties: - string_item: - default: what - type: string - number_item: - type: number - integer_item: + $special[property.name]: + format: int64 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: + xml: + name: "$special[model.name]" + HealthCheckResult: + description: Just a string to inform instance is up and running. Make it nullable + in hope to get it as pointer in generated model. + example: + NullableMessage: NullableMessage properties: - string_item: - example: what + NullableMessage: + nullable: true 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: + NullableClass: + additionalProperties: + nullable: true + type: object properties: - attribute_string: - example: string - type: string - xml: - attribute: true - attribute_number: - example: 1.234 - type: number - xml: - attribute: true - attribute_integer: - example: -2 + integer_prop: + nullable: true 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 + number_prop: + nullable: true type: number - xml: - name: xml_name_number - name_integer: - example: -2 - type: integer - xml: - name: xml_name_integer - name_boolean: - example: true + boolean_prop: + nullable: 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 + string_prop: + nullable: true 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: + date_prop: + format: date + nullable: true + type: string + datetime_prop: + format: date-time + nullable: true + type: string + array_nullable_prop: items: - type: integer - xml: - prefix: mn + type: object + nullable: true 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: + array_and_items_nullable_prop: items: - type: integer - xml: - namespace: http://e.com/schema + nullable: true + type: object + nullable: true type: array - namespace_wrapped_array: + array_items_nullable: items: - type: integer - xml: - namespace: http://g.com/schema + nullable: true + type: object type: array - xml: - namespace: http://f.com/schema - wrapped: true - prefix_ns_string: - example: string + object_nullable_prop: + additionalProperties: + type: object + nullable: true + type: object + object_and_items_nullable_prop: + additionalProperties: + nullable: true + type: object + nullable: true + type: object + object_items_nullable: + additionalProperties: + nullable: true + type: object + type: object + type: object + OuterObjectWithEnumProperty: + example: + value: 2 + properties: + value: + $ref: '#/components/schemas/OuterEnumInteger' + required: + - value + type: object + DeprecatedObject: + deprecated: true + properties: + name: type: string - xml: - namespace: http://a.com/schema - prefix: a - prefix_ns_number: - example: 1.234 + type: object + ObjectWithDeprecatedFields: + properties: + uuid: + type: string + id: + deprecated: true 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: + deprecatedRef: + $ref: '#/components/schemas/DeprecatedObject' + bars: + deprecated: true items: - type: integer - xml: - namespace: http://g.com/schema - prefix: g + $ref: '#/components/schemas/Bar' type: array - xml: - namespace: http://f.com/schema - prefix: f - wrapped: true type: object - xml: - namespace: http://a.com/schema - prefix: pre + AllOfWithSingleRef: + properties: + username: + type: string + SingleRefType: + allOf: + - $ref: '#/components/schemas/SingleRefType' + type: object + SingleRefType: + enum: + - admin + - user + title: SingleRefType + type: string + _foo_get_default_response: + example: + string: + bar: bar + properties: + string: + $ref: '#/components/schemas/Foo' + type: object updatePetWithForm_request: properties: name: @@ -2212,7 +2311,6 @@ components: properties: integer: description: None - format: int32 maximum: 100 minimum: 10 type: integer @@ -2281,6 +2379,19 @@ components: - number - pattern_without_delimiter type: object + fakeBigDecimalMap_200_response: + example: + someId: 0.8008281904610115 + someMap: + key: 6.027456183070403 + properties: + someId: + type: number + someMap: + additionalProperties: + type: number + type: object + type: object testJsonFormData_request: properties: param: @@ -2293,6 +2404,12 @@ components: - param - param2 type: object + testInlineFreeformAdditionalProperties_request: + additionalProperties: true + properties: + someProperty: + type: string + type: object uploadFileWithRequiredFile_request: properties: additionalMetadata: @@ -2325,4 +2442,10 @@ components: http_basic_test: scheme: basic type: http -x-original-swagger-version: "2.0" + bearer_test: + bearerFormat: JWT + scheme: bearer + type: http + http_signature_test: + scheme: signature + type: http From cd30301f8eb4de46c101e05da05546d1e5103cd4 Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 May 2024 16:53:21 +0800 Subject: [PATCH 3/4] Revert "update samples" This reverts commit 2377d98de3b38a105fc970e8a97282fafb8a48ad. --- samples/documentation/html2/index.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/documentation/html2/index.html b/samples/documentation/html2/index.html index 4a8a3c3e0ff7..192377211d37 100644 --- a/samples/documentation/html2/index.html +++ b/samples/documentation/html2/index.html @@ -9524,19 +9524,19 @@

Description - SetMinusCookie + SetDashCookie String Cookie authentication key for use with the `api_key` apiKey authentication. - XMinusRateMinusLimit + XDashRateDashLimit Integer int32 calls per hour allowed by the user - XMinusExpiresMinusAfter + XDashExpiresDashAfter Date date-time date in UTC when token expires From 61eeb8c01b73f5b28535d7b224978edac157fbac Mon Sep 17 00:00:00 2001 From: William Cheng Date: Wed, 8 May 2024 17:12:48 +0800 Subject: [PATCH 4/4] update samples --- .../server/petstore/jaxrs-spec-interface-response/pom.xml | 6 ++++++ samples/server/petstore/jaxrs-spec-interface/pom.xml | 6 ++++++ samples/server/petstore/jaxrs-spec-jakarta/pom.xml | 6 ++++++ .../jaxrs-spec-required-and-readonly-property/pom.xml | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml index becf131d1dec..67ece8e73f0b 100644 --- a/samples/server/petstore/jaxrs-spec-interface-response/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml @@ -88,6 +88,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -100,5 +105,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec-interface/pom.xml b/samples/server/petstore/jaxrs-spec-interface/pom.xml index b614cca47966..f9ac6496192a 100644 --- a/samples/server/petstore/jaxrs-spec-interface/pom.xml +++ b/samples/server/petstore/jaxrs-spec-interface/pom.xml @@ -88,6 +88,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -100,5 +105,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec-jakarta/pom.xml b/samples/server/petstore/jaxrs-spec-jakarta/pom.xml index 6012c2602778..0d0ce11b1b31 100644 --- a/samples/server/petstore/jaxrs-spec-jakarta/pom.xml +++ b/samples/server/petstore/jaxrs-spec-jakarta/pom.xml @@ -123,6 +123,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -135,5 +140,6 @@ 2.1.1 3.0.2 3.1.0 + 0.2.6 diff --git a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml index 031d2beeafb0..0cd16dc39fd8 100644 --- a/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml +++ b/samples/server/petstore/jaxrs-spec-required-and-readonly-property/pom.xml @@ -123,6 +123,11 @@ ${beanvalidation-version} provided + + org.openapitools + jackson-databind-nullable + ${jackson-databind-nullable-version} + 1.8 @@ -135,5 +140,6 @@ 1.3.2 2.0.2 2.1.6 + 0.2.6