diff --git a/bin/configs/jaxrs-spec.yaml b/bin/configs/jaxrs-spec.yaml
index dbbb86bb420..0eca24e4259 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 7e8a93d919f..d860a344b2a 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 abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
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 65a46053d53..f44c6083fdd 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 00000000000..28b35f47071
--- /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-interface-response/pom.xml b/samples/server/petstore/jaxrs-spec-interface-response/pom.xml
index becf131d1de..67ece8e73f0 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 b614cca4796..f9ac6496192 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 6012c260277..0d0ce11b1b3 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 031d2beeafb..0cd16dc39fd 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
diff --git a/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES b/samples/server/petstore/jaxrs-spec/.openapi-generator/FILES
index 3ed6ff4d23c..6576c008a87 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 031d2beeafb..0cd16dc39fd 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 5a40b56eef4..403d1a84a91 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 c4bac86519b..1bc3632286b 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 @@ import javax.validation.Valid;
@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 createXmlItem(@Valid @NotNull XmlItem xmlItem) {
+ 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 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 class FakeApi {
@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 class FakeApi {
@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 class FakeApi {
return Response.ok().entity("magic!").build();
}
- @PUT
- @Path("/body-with-file-schema")
+ @POST
+ @Path("/property/enum-int")
@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" })
+ @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 testBodyWithFileSchema(@Valid @NotNull FileSchemaTestClass body) {
+ 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 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 fileSchemaTestClass) {
return Response.ok().entity("magic!").build();
}
@@ -104,7 +173,7 @@ public class FakeApi {
@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 class FakeApi {
@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 class FakeApi {
@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 class FakeApi {
@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 class FakeApi {
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 aa82ecdfecb..df957b59d08 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 00000000000..e40e0d569c5
--- /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 ad23a1b0113..8132bac1b84 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 class PetApi {
@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 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 = 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 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 = 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 7ced493a15d..820f4f22384 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 class StoreApi {
@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 af9989fdd51..292d2e1f84e 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 @@ import javax.validation.Valid;
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 class UserApi {
@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 8529b0c6023..2d6e2c04b1c 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 @@ 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.List;
import java.util.Map;
import java.io.Serializable;
import javax.validation.constraints.*;
@@ -22,30 +20,12 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@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 class AdditionalPropertiesClass implements Serializable {
/**
**/
- 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