[spring] fix default value for nullable containers (#14959)

* fix default value, update spec to 3.0

* add tests for container default value

* update java camel samples

* remove samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable

* remove ./bin/configs/spring-boot-beanvalidation-no-nullable-oas3.yaml

* remove samples/openapi3/server/petstore/springboot-useoptional

* remove samples/openapi3/server/petstore/springboot-reactive

* update github workflow

* fix default in add, put operation
This commit is contained in:
William Cheng 2023-03-17 10:16:17 +08:00 committed by GitHub
parent e626b43e27
commit d0f7bd18ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
669 changed files with 8763 additions and 40246 deletions

View File

@ -30,9 +30,7 @@ jobs:
- samples/openapi3/server/petstore/springboot
- samples/server/petstore/springboot-beanvalidation
- samples/server/petstore/springboot-useoptional
- samples/openapi3/server/petstore/springboot-useoptional
- samples/server/petstore/springboot-reactive
- samples/openapi3/server/petstore/springboot-reactive
- samples/server/petstore/springboot-implicitHeaders
- samples/openapi3/server/petstore/springboot-implicitHeaders
- samples/server/petstore/springboot-delegate

View File

@ -1,13 +0,0 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-beanvalidation-no-nullable
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springdoc
java8: "false"
useBeanValidation: true
artifactId: spring-boot-beanvalidation-no-nullable
hideGenerationTimestamp: "true"
openApiNullable: "false"

View File

@ -1,9 +1,10 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-beanvalidation-no-nullable
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springfox
java8: "false"
useBeanValidation: true

View File

@ -1,7 +1,7 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-beanvalidation
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox

View File

@ -1,6 +1,6 @@
generatorName: spring
outputDir: samples/server/petstore/spring-boot-defaultInterface-unhandledException
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: spring-boot-defaultInterface-unhandledException

View File

@ -1,6 +1,6 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-delegate-j8
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox

View File

@ -1,6 +1,6 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-delegate
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3

View File

@ -1,6 +1,6 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-delegate
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox

View File

@ -1,6 +1,6 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-implicitHeaders
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3

View File

@ -1,6 +1,6 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-implicitHeaders
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: springboot-implicitHeaders

View File

@ -1,11 +0,0 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-reactive
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springdoc
artifactId: springboot-reactive
reactive: "true"
hideGenerationTimestamp: "true"
delegatePattern: "true"

View File

@ -1,8 +1,9 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-reactive
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
artifactId: springboot-reactive
documentationProvider: springfox
reactive: "true"

View File

@ -1,10 +0,0 @@
generatorName: spring
outputDir: samples/openapi3/server/petstore/springboot-useoptional
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springdoc
useOptional: true
artifactId: spring-boot-useoptional
hideGenerationTimestamp: "true"

View File

@ -1,8 +1,9 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-useoptional
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3
documentationProvider: springfox
useOptional: true
artifactId: spring-boot-useoptional

View File

@ -1,7 +1,7 @@
generatorName: spring
outputDir: samples/server/petstore/springboot-virtualan
library: spring-boot
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springdoc

View File

@ -1,6 +1,6 @@
generatorName: spring
outputDir: samples/server/petstore/springboot
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
documentationProvider: springfox

View File

@ -1,7 +1,7 @@
generatorName: spring
library: spring-cloud
outputDir: samples/openapi3/client/petstore/spring-cloud-oas3-fakeapi
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
groupId: org.openapitools.openapi3

View File

@ -1,7 +1,7 @@
generatorName: spring
library: spring-http-interface
outputDir: samples/client/petstore/spring-http-interface-reactive
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: spring-http-interface-reactive

View File

@ -1,7 +1,7 @@
generatorName: spring
library: spring-http-interface
outputDir: samples/client/petstore/spring-http-interface
inputSpec: modules/openapi-generator/src/test/resources/2_0/petstore-with-fake-endpoints-models-for-testing.yaml
inputSpec: modules/openapi-generator/src/test/resources/3_0/spring/petstore-with-fake-endpoints-models-for-testing.yaml
templateDir: modules/openapi-generator/src/main/resources/JavaSpring
additionalProperties:
artifactId: spring-http-interface

View File

@ -59,10 +59,10 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#isContainer}}
{{#useBeanValidation}}@Valid{{/useBeanValidation}}
{{#openApiNullable}}
private {{>nullableDataType}} {{name}} = {{#isNullable}}JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#required}}{{{defaultValue}}}{{/required}}{{^required}}null{{/required}}{{/isNullable}};
private {{>nullableDataType}} {{name}}{{#isNullable}} = JsonNullable.undefined(){{/isNullable}}{{^isNullable}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/isNullable}};
{{/openApiNullable}}
{{^openApiNullable}}
private {{>nullableDataType}} {{name}} = {{#required}}{{{defaultValue}}}{{/required}}{{^required}}null{{/required}};
private {{>nullableDataType}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/openApiNullable}}
{{/isContainer}}
{{^isContainer}}
@ -128,16 +128,14 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) {
{{#openApiNullable}}
{{^required}}
if (this.{{name}} == null{{#isNullable}} || !this.{{name}}.isPresent(){{/isNullable}}) {
this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}}{{#isNullable}}){{/isNullable}};
}
{{/required}}
this.{{name}}{{#isNullable}}.get(){{/isNullable}}.add({{name}}Item);
{{/openApiNullable}}
{{^openApiNullable}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}};
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new {{#uniqueItems}}LinkedHashSet{{/uniqueItems}}{{^uniqueItems}}ArrayList{{/uniqueItems}}<>(){{/defaultValue}};
}
this.{{name}}.add({{name}}Item);
{{/openApiNullable}}
@ -147,11 +145,9 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{#isMap}}
public {{classname}} put{{nameInCamelCase}}Item(String key, {{{items.datatypeWithEnum}}} {{name}}Item) {
{{^required}}
if (this.{{name}} == null) {
this.{{name}} = {{{defaultValue}}}{{^defaultValue}}new HashMap<>(){{/defaultValue}};
}
{{/required}}
this.{{name}}.put(key, {{name}}Item);
return this;
}

View File

@ -43,7 +43,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -165,6 +165,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -43,7 +43,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -165,6 +165,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -43,7 +43,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -165,6 +165,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -43,7 +43,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -165,6 +165,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -27,6 +27,7 @@ src/main/java/org/openapitools/model/CatAllOf.java
src/main/java/org/openapitools/model/Category.java
src/main/java/org/openapitools/model/ClassModel.java
src/main/java/org/openapitools/model/Client.java
src/main/java/org/openapitools/model/ContainerDefaultValue.java
src/main/java/org/openapitools/model/Dog.java
src/main/java/org/openapitools/model/DogAllOf.java
src/main/java/org/openapitools/model/EnumArrays.java

View File

@ -28,7 +28,7 @@ public interface AnotherFakeApi {
* PATCH /another-fake/dummy : To test special tags
* To test special tags and operation ID starting with number
*
* @param body client model (required)
* @param client client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -38,7 +38,7 @@ public interface AnotherFakeApi {
contentType = "application/json"
)
Mono<ResponseEntity<Client>> call123testSpecialTags(
@RequestBody Mono<Client> body
@RequestBody Mono<Client> client
);
}

View File

@ -62,7 +62,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/boolean",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<Boolean>> fakeOuterBooleanSerialize(
@RequestBody(required = false) Mono<Boolean> body
@ -73,17 +73,17 @@ public interface FakeApi {
* POST /fake/outer/composite
* Test serialization of object with outer number type
*
* @param body Input composite as post body (optional)
* @param outerComposite Input composite as post body (optional)
* @return Output composite (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/fake/outer/composite",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<OuterComposite>> fakeOuterCompositeSerialize(
@RequestBody(required = false) Mono<OuterComposite> body
@RequestBody(required = false) Mono<OuterComposite> outerComposite
);
@ -98,7 +98,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/number",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<BigDecimal>> fakeOuterNumberSerialize(
@RequestBody(required = false) Mono<BigDecimal> body
@ -116,7 +116,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/string",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<String>> fakeOuterStringSerialize(
@RequestBody(required = false) Mono<String> body
@ -127,7 +127,7 @@ public interface FakeApi {
* PUT /fake/body-with-file-schema
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @param body (required)
* @param fileSchemaTestClass (required)
* @return Success (status code 200)
*/
@HttpExchange(
@ -137,7 +137,7 @@ public interface FakeApi {
contentType = "application/json"
)
Mono<ResponseEntity<Void>> testBodyWithFileSchema(
@RequestBody Mono<FileSchemaTestClass> body
@RequestBody Mono<FileSchemaTestClass> fileSchemaTestClass
);
@ -145,7 +145,7 @@ public interface FakeApi {
* PUT /fake/body-with-query-params
*
* @param query (required)
* @param body (required)
* @param user (required)
* @return Success (status code 200)
*/
@HttpExchange(
@ -156,7 +156,7 @@ public interface FakeApi {
)
Mono<ResponseEntity<Void>> testBodyWithQueryParams(
@RequestParam(value = "query", required = true) String query,
@RequestBody Mono<User> body
@RequestBody Mono<User> user
);
@ -164,7 +164,7 @@ public interface FakeApi {
* PATCH /fake : To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
*
* @param body client model (required)
* @param client client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -174,7 +174,7 @@ public interface FakeApi {
contentType = "application/json"
)
Mono<ResponseEntity<Client>> testClientModel(
@RequestBody Mono<Client> body
@RequestBody Mono<Client> client
);
@ -285,8 +285,9 @@ public interface FakeApi {
/**
* POST /fake/inline-additionalProperties : test inline additionalProperties
*
*
* @param param request body (required)
* @param requestBody request body (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -296,12 +297,13 @@ public interface FakeApi {
contentType = "application/json"
)
Mono<ResponseEntity<Void>> testInlineAdditionalProperties(
@RequestBody Mono<Map<String, String>> param
@RequestBody Mono<Map<String, String>> requestBody
);
/**
* GET /fake/jsonFormData : test json serialization of form data
*
*
* @param param field1 (required)
* @param param2 field2 (required)
@ -324,7 +326,6 @@ public interface FakeApi {
* To test the collection format in query parameters
*
* @param pipe (required)
* @param ioutil (required)
* @param http (required)
* @param url (required)
* @param context (required)
@ -337,7 +338,6 @@ public interface FakeApi {
)
Mono<ResponseEntity<Void>> testQueryParameterCollectionFormat(
@RequestParam(value = "pipe", required = true) List<String> pipe,
@RequestParam(value = "ioutil", required = true) List<String> ioutil,
@RequestParam(value = "http", required = true) List<String> http,
@RequestParam(value = "url", required = true) List<String> url,
@RequestParam(value = "context", required = true) List<String> context

View File

@ -28,7 +28,7 @@ public interface FakeClassnameTags123Api {
* PATCH /fake_classname_test : To test class name in snake case
* To test class name in snake case
*
* @param body client model (required)
* @param client client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -38,7 +38,7 @@ public interface FakeClassnameTags123Api {
contentType = "application/json"
)
Mono<ResponseEntity<Client>> testClassname(
@RequestBody Mono<Client> body
@RequestBody Mono<Client> client
);
}

View File

@ -28,8 +28,9 @@ public interface PetApi {
/**
* POST /pet : Add a new pet to the store
*
*
* @param body Pet object that needs to be added to the store (required)
* @param pet Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
@ -40,12 +41,13 @@ public interface PetApi {
contentType = "application/json"
)
Mono<ResponseEntity<Void>> addPet(
@RequestBody Mono<Pet> body
@RequestBody Mono<Pet> pet
);
/**
* DELETE /pet/{petId} : Deletes a pet
*
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
@ -122,8 +124,9 @@ public interface PetApi {
/**
* PUT /pet : Update an existing pet
*
*
* @param body Pet object that needs to be added to the store (required)
* @param pet Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
@ -136,12 +139,13 @@ public interface PetApi {
contentType = "application/json"
)
Mono<ResponseEntity<Void>> updatePet(
@RequestBody Mono<Pet> body
@RequestBody Mono<Pet> pet
);
/**
* POST /pet/{petId} : Updates a pet in the store with form data
*
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
@ -163,6 +167,7 @@ public interface PetApi {
/**
* POST /pet/{petId}/uploadImage : uploads an image
*
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
@ -184,6 +189,7 @@ public interface PetApi {
/**
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
*
*
* @param petId ID of pet to update (required)
* @param requiredFile file to upload (required)

View File

@ -80,8 +80,9 @@ public interface StoreApi {
/**
* POST /store/order : Place an order for a pet
*
*
* @param body order placed for purchasing the pet (required)
* @param order order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
@ -89,10 +90,10 @@ public interface StoreApi {
method = "POST",
value = "/store/order",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<Order>> placeOrder(
@RequestBody Mono<Order> body
@RequestBody Mono<Order> order
);
}

View File

@ -30,51 +30,53 @@ public interface UserApi {
* POST /user : Create user
* This can only be done by the logged in user.
*
* @param body Created user object (required)
* @param user Created user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<Void>> createUser(
@RequestBody Mono<User> body
@RequestBody Mono<User> user
);
/**
* POST /user/createWithArray : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user/createWithArray",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<Void>> createUsersWithArrayInput(
@RequestBody Flux<User> body
@RequestBody Flux<User> user
);
/**
* POST /user/createWithList : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user/createWithList",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<Void>> createUsersWithListInput(
@RequestBody Flux<User> body
@RequestBody Flux<User> user
);
@ -98,6 +100,7 @@ public interface UserApi {
/**
* GET /user/{username} : Get user by user name
*
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return successful operation (status code 200)
@ -116,6 +119,7 @@ public interface UserApi {
/**
* GET /user/login : Logs user into the system
*
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
@ -135,6 +139,7 @@ public interface UserApi {
/**
* GET /user/logout : Logs out current logged in user session
*
*
* @return successful operation (status code 200)
*/
@ -153,7 +158,7 @@ public interface UserApi {
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @param user Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
@ -161,11 +166,11 @@ public interface UserApi {
method = "PUT",
value = "/user/{username}",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
Mono<ResponseEntity<Void>> updateUser(
@PathVariable("username") String username,
@RequestBody Mono<User> body
@RequestBody Mono<User> user
);
}

View File

@ -5,10 +5,13 @@ import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import jakarta.validation.constraints.NotNull;
@ -25,41 +28,41 @@ public class AdditionalPropertiesClass {
@JsonProperty("map_string")
private Map<String, String> mapString = null;
private Map<String, String> mapString = new HashMap<>();
@JsonProperty("map_number")
private Map<String, BigDecimal> mapNumber = null;
private Map<String, BigDecimal> mapNumber = new HashMap<>();
@JsonProperty("map_integer")
private Map<String, Integer> mapInteger = null;
private Map<String, Integer> mapInteger = new HashMap<>();
@JsonProperty("map_boolean")
private Map<String, Boolean> mapBoolean = null;
private Map<String, Boolean> mapBoolean = new HashMap<>();
@JsonProperty("map_array_integer")
private Map<String, List<Integer>> mapArrayInteger = null;
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
@JsonProperty("map_array_anytype")
private Map<String, List<Object>> mapArrayAnytype = null;
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
@JsonProperty("map_map_string")
private Map<String, Map<String, String>> mapMapString = null;
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
@JsonProperty("map_map_anytype")
private Map<String, Map<String, Object>> mapMapAnytype = null;
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
@JsonProperty("anytype_1")
private Object anytype1;
@JsonProperty("anytype_2")
private Object anytype2;
private JsonNullable<Object> anytype2 = JsonNullable.undefined();
@JsonProperty("anytype_3")
private Object anytype3;
@ -291,7 +294,7 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass anytype2(Object anytype2) {
this.anytype2 = anytype2;
this.anytype2 = JsonNullable.of(anytype2);
return this;
}
@ -300,11 +303,11 @@ public class AdditionalPropertiesClass {
* @return anytype2
*/
public Object getAnytype2() {
public JsonNullable<Object> getAnytype2() {
return anytype2;
}
public void setAnytype2(Object anytype2) {
public void setAnytype2(JsonNullable<Object> anytype2) {
this.anytype2 = anytype2;
}
@ -344,13 +347,24 @@ public class AdditionalPropertiesClass {
Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) &&
Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override

View File

@ -24,7 +24,7 @@ public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = null;
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;

View File

@ -24,7 +24,7 @@ public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
private List<BigDecimal> arrayNumber = null;
private List<BigDecimal> arrayNumber = new ArrayList<>();
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;

View File

@ -24,15 +24,15 @@ public class ArrayTest {
@JsonProperty("array_of_string")
private List<String> arrayOfString = null;
private List<String> arrayOfString = new ArrayList<>();
@JsonProperty("array_array_of_integer")
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
@JsonProperty("array_array_of_model")
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;

View File

@ -0,0 +1,218 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import jakarta.validation.constraints.NotNull;
import java.util.*;
import jakarta.annotation.Generated;
/**
* ContainerDefaultValue
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class ContainerDefaultValue {
@JsonProperty("nullable_array")
private JsonNullable<List<String>> nullableArray = JsonNullable.undefined();
@JsonProperty("nullable_required_array")
private JsonNullable<List<String>> nullableRequiredArray = JsonNullable.undefined();
@JsonProperty("required_array")
private List<String> requiredArray = new ArrayList<>();
@JsonProperty("nullable_array_with_default")
private JsonNullable<List<String>> nullableArrayWithDefault = JsonNullable.undefined();
/**
* Default constructor
* @deprecated Use {@link ContainerDefaultValue#ContainerDefaultValue(List<String>, List<String>)}
*/
@Deprecated
public ContainerDefaultValue() {
super();
}
/**
* Constructor with only required parameters
*/
public ContainerDefaultValue(List<String> nullableRequiredArray, List<String> requiredArray) {
this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray);
this.requiredArray = requiredArray;
}
public ContainerDefaultValue nullableArray(List<String> nullableArray) {
this.nullableArray = JsonNullable.of(nullableArray);
return this;
}
public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) {
if (this.nullableArray == null || !this.nullableArray.isPresent()) {
this.nullableArray = JsonNullable.of(new ArrayList<>());
}
this.nullableArray.get().add(nullableArrayItem);
return this;
}
/**
* Get nullableArray
* @return nullableArray
*/
public JsonNullable<List<String>> getNullableArray() {
return nullableArray;
}
public void setNullableArray(JsonNullable<List<String>> nullableArray) {
this.nullableArray = nullableArray;
}
public ContainerDefaultValue nullableRequiredArray(List<String> nullableRequiredArray) {
this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray);
return this;
}
public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) {
if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) {
this.nullableRequiredArray = JsonNullable.of(new ArrayList<>());
}
this.nullableRequiredArray.get().add(nullableRequiredArrayItem);
return this;
}
/**
* Get nullableRequiredArray
* @return nullableRequiredArray
*/
@NotNull
public JsonNullable<List<String>> getNullableRequiredArray() {
return nullableRequiredArray;
}
public void setNullableRequiredArray(JsonNullable<List<String>> nullableRequiredArray) {
this.nullableRequiredArray = nullableRequiredArray;
}
public ContainerDefaultValue requiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
return this;
}
public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) {
if (this.requiredArray == null) {
this.requiredArray = new ArrayList<>();
}
this.requiredArray.add(requiredArrayItem);
return this;
}
/**
* Get requiredArray
* @return requiredArray
*/
@NotNull
public List<String> getRequiredArray() {
return requiredArray;
}
public void setRequiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
}
public ContainerDefaultValue nullableArrayWithDefault(List<String> nullableArrayWithDefault) {
this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault);
return this;
}
public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) {
if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) {
this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar")));
}
this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem);
return this;
}
/**
* Get nullableArrayWithDefault
* @return nullableArrayWithDefault
*/
public JsonNullable<List<String>> getNullableArrayWithDefault() {
return nullableArrayWithDefault;
}
public void setNullableArrayWithDefault(JsonNullable<List<String>> nullableArrayWithDefault) {
this.nullableArrayWithDefault = nullableArrayWithDefault;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o;
return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) &&
Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) &&
Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) &&
equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault));
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContainerDefaultValue {\n");
sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n");
sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n");
sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n");
sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -97,7 +97,7 @@ public class EnumArrays {
@JsonProperty("array_enum")
private List<ArrayEnumEnum> arrayEnum = null;
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;

View File

@ -27,7 +27,7 @@ public class FileSchemaTestClass {
@JsonProperty("files")
private List<File> files = null;
private List<File> files = new ArrayList<>();
public FileSchemaTestClass file(File file) {
this.file = file;

View File

@ -24,7 +24,7 @@ public class MapTest {
@JsonProperty("map_map_of_string")
private Map<String, Map<String, String>> mapMapOfString = null;
private Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
/**
* Gets or Sets inner
@ -63,15 +63,15 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap = new HashMap<>();
@JsonProperty("indirect_map")
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap = new HashMap<>();
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;

View File

@ -34,7 +34,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("map")
private Map<String, Animal> map = null;
private Map<String, Animal> map = new HashMap<>();
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
this.uuid = uuid;

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
private List<Tag> tags = null;
private List<Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -161,6 +161,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new LinkedHashSet<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -17,7 +17,7 @@ import jakarta.annotation.Generated;
* SpecialModelName
*/
@JsonTypeName("$special[model.name]")
@JsonTypeName("_special_model.name_")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class SpecialModelName {
@ -50,8 +50,8 @@ public class SpecialModelName {
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName $specialModelName = (SpecialModelName) o;
return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName);
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName);
}
@Override

View File

@ -26,17 +26,17 @@ public class TypeHolderDefault {
private String stringItem = "what";
@JsonProperty("number_item")
private BigDecimal numberItem;
private BigDecimal numberItem = new BigDecimal("1.234");
@JsonProperty("integer_item")
private Integer integerItem;
private Integer integerItem = -2;
@JsonProperty("bool_item")
private Boolean boolItem = true;
@JsonProperty("array_item")
private List<Integer> arrayItem = new ArrayList<>();
private List<Integer> arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
/**
* Default constructor
@ -136,6 +136,9 @@ public class TypeHolderDefault {
}
public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@ -158,6 +158,9 @@ public class TypeHolderExample {
}
public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@ -36,7 +36,7 @@ public class XmlItem {
@JsonProperty("wrapped_array")
private List<Integer> wrappedArray = null;
private List<Integer> wrappedArray = new ArrayList<>();
@JsonProperty("name_string")
private String nameString;
@ -52,11 +52,11 @@ public class XmlItem {
@JsonProperty("name_array")
private List<Integer> nameArray = null;
private List<Integer> nameArray = new ArrayList<>();
@JsonProperty("name_wrapped_array")
private List<Integer> nameWrappedArray = null;
private List<Integer> nameWrappedArray = new ArrayList<>();
@JsonProperty("prefix_string")
private String prefixString;
@ -72,11 +72,11 @@ public class XmlItem {
@JsonProperty("prefix_array")
private List<Integer> prefixArray = null;
private List<Integer> prefixArray = new ArrayList<>();
@JsonProperty("prefix_wrapped_array")
private List<Integer> prefixWrappedArray = null;
private List<Integer> prefixWrappedArray = new ArrayList<>();
@JsonProperty("namespace_string")
private String namespaceString;
@ -92,11 +92,11 @@ public class XmlItem {
@JsonProperty("namespace_array")
private List<Integer> namespaceArray = null;
private List<Integer> namespaceArray = new ArrayList<>();
@JsonProperty("namespace_wrapped_array")
private List<Integer> namespaceWrappedArray = null;
private List<Integer> namespaceWrappedArray = new ArrayList<>();
@JsonProperty("prefix_ns_string")
private String prefixNsString;
@ -112,11 +112,11 @@ public class XmlItem {
@JsonProperty("prefix_ns_array")
private List<Integer> prefixNsArray = null;
private List<Integer> prefixNsArray = new ArrayList<>();
@JsonProperty("prefix_ns_wrapped_array")
private List<Integer> prefixNsWrappedArray = null;
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
public XmlItem attributeString(String attributeString) {
this.attributeString = attributeString;

View File

@ -28,6 +28,7 @@ src/main/java/org/openapitools/model/CatDto.java
src/main/java/org/openapitools/model/CategoryDto.java
src/main/java/org/openapitools/model/ClassModelDto.java
src/main/java/org/openapitools/model/ClientDto.java
src/main/java/org/openapitools/model/ContainerDefaultValueDto.java
src/main/java/org/openapitools/model/DogAllOfDto.java
src/main/java/org/openapitools/model/DogDto.java
src/main/java/org/openapitools/model/EnumArraysDto.java

View File

@ -24,7 +24,7 @@ public interface AnotherFakeApi {
* PATCH /another-fake/dummy : To test special tags
* To test special tags and operation ID starting with number
*
* @param body client model (required)
* @param clientDto client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -34,7 +34,7 @@ public interface AnotherFakeApi {
contentType = "application/json"
)
ResponseEntity<ClientDto> call123testSpecialTags(
@RequestBody ClientDto body
@RequestBody ClientDto clientDto
);
}

View File

@ -33,7 +33,7 @@ public interface FakeApi {
* POST /fake/create_xml_item : creates an XmlItem
* this route creates an XmlItem
*
* @param xmlItem XmlItem Body (required)
* @param xmlItemDto XmlItem Body (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -43,7 +43,7 @@ public interface FakeApi {
contentType = "application/xml"
)
ResponseEntity<Void> createXmlItem(
@RequestBody XmlItemDto xmlItem
@RequestBody XmlItemDto xmlItemDto
);
@ -58,7 +58,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/boolean",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Boolean> fakeOuterBooleanSerialize(
@RequestBody(required = false) Boolean body
@ -69,17 +69,17 @@ public interface FakeApi {
* POST /fake/outer/composite
* Test serialization of object with outer number type
*
* @param body Input composite as post body (optional)
* @param outerCompositeDto Input composite as post body (optional)
* @return Output composite (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/fake/outer/composite",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<OuterCompositeDto> fakeOuterCompositeSerialize(
@RequestBody(required = false) OuterCompositeDto body
@RequestBody(required = false) OuterCompositeDto outerCompositeDto
);
@ -94,7 +94,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/number",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(
@RequestBody(required = false) BigDecimal body
@ -112,7 +112,7 @@ public interface FakeApi {
method = "POST",
value = "/fake/outer/string",
accept = "*/*",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<String> fakeOuterStringSerialize(
@RequestBody(required = false) String body
@ -123,7 +123,7 @@ public interface FakeApi {
* PUT /fake/body-with-file-schema
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @param body (required)
* @param fileSchemaTestClassDto (required)
* @return Success (status code 200)
*/
@HttpExchange(
@ -133,7 +133,7 @@ public interface FakeApi {
contentType = "application/json"
)
ResponseEntity<Void> testBodyWithFileSchema(
@RequestBody FileSchemaTestClassDto body
@RequestBody FileSchemaTestClassDto fileSchemaTestClassDto
);
@ -141,7 +141,7 @@ public interface FakeApi {
* PUT /fake/body-with-query-params
*
* @param query (required)
* @param body (required)
* @param userDto (required)
* @return Success (status code 200)
*/
@HttpExchange(
@ -152,7 +152,7 @@ public interface FakeApi {
)
ResponseEntity<Void> testBodyWithQueryParams(
@RequestParam(value = "query", required = true) String query,
@RequestBody UserDto body
@RequestBody UserDto userDto
);
@ -160,7 +160,7 @@ public interface FakeApi {
* PATCH /fake : To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
*
* @param body client model (required)
* @param clientDto client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -170,7 +170,7 @@ public interface FakeApi {
contentType = "application/json"
)
ResponseEntity<ClientDto> testClientModel(
@RequestBody ClientDto body
@RequestBody ClientDto clientDto
);
@ -281,8 +281,9 @@ public interface FakeApi {
/**
* POST /fake/inline-additionalProperties : test inline additionalProperties
*
*
* @param param request body (required)
* @param requestBody request body (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -292,12 +293,13 @@ public interface FakeApi {
contentType = "application/json"
)
ResponseEntity<Void> testInlineAdditionalProperties(
@RequestBody Map<String, String> param
@RequestBody Map<String, String> requestBody
);
/**
* GET /fake/jsonFormData : test json serialization of form data
*
*
* @param param field1 (required)
* @param param2 field2 (required)
@ -320,7 +322,6 @@ public interface FakeApi {
* To test the collection format in query parameters
*
* @param pipe (required)
* @param ioutil (required)
* @param http (required)
* @param url (required)
* @param context (required)
@ -333,7 +334,6 @@ public interface FakeApi {
)
ResponseEntity<Void> testQueryParameterCollectionFormat(
@RequestParam(value = "pipe", required = true) List<String> pipe,
@RequestParam(value = "ioutil", required = true) List<String> ioutil,
@RequestParam(value = "http", required = true) List<String> http,
@RequestParam(value = "url", required = true) List<String> url,
@RequestParam(value = "context", required = true) List<String> context

View File

@ -24,7 +24,7 @@ public interface FakeClassnameTags123Api {
* PATCH /fake_classname_test : To test class name in snake case
* To test class name in snake case
*
* @param body client model (required)
* @param clientDto client model (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
@ -34,7 +34,7 @@ public interface FakeClassnameTags123Api {
contentType = "application/json"
)
ResponseEntity<ClientDto> testClassname(
@RequestBody ClientDto body
@RequestBody ClientDto clientDto
);
}

View File

@ -24,8 +24,9 @@ public interface PetApi {
/**
* POST /pet : Add a new pet to the store
*
*
* @param body Pet object that needs to be added to the store (required)
* @param petDto Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
@ -36,12 +37,13 @@ public interface PetApi {
contentType = "application/json"
)
ResponseEntity<Void> addPet(
@RequestBody PetDto body
@RequestBody PetDto petDto
);
/**
* DELETE /pet/{petId} : Deletes a pet
*
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
@ -118,8 +120,9 @@ public interface PetApi {
/**
* PUT /pet : Update an existing pet
*
*
* @param body Pet object that needs to be added to the store (required)
* @param petDto Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
@ -132,12 +135,13 @@ public interface PetApi {
contentType = "application/json"
)
ResponseEntity<Void> updatePet(
@RequestBody PetDto body
@RequestBody PetDto petDto
);
/**
* POST /pet/{petId} : Updates a pet in the store with form data
*
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
@ -159,6 +163,7 @@ public interface PetApi {
/**
* POST /pet/{petId}/uploadImage : uploads an image
*
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
@ -180,6 +185,7 @@ public interface PetApi {
/**
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
*
*
* @param petId ID of pet to update (required)
* @param requiredFile file to upload (required)

View File

@ -76,8 +76,9 @@ public interface StoreApi {
/**
* POST /store/order : Place an order for a pet
*
*
* @param body order placed for purchasing the pet (required)
* @param orderDto order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
@ -85,10 +86,10 @@ public interface StoreApi {
method = "POST",
value = "/store/order",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<OrderDto> placeOrder(
@RequestBody OrderDto body
@RequestBody OrderDto orderDto
);
}

View File

@ -26,51 +26,53 @@ public interface UserApi {
* POST /user : Create user
* This can only be done by the logged in user.
*
* @param body Created user object (required)
* @param userDto Created user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> createUser(
@RequestBody UserDto body
@RequestBody UserDto userDto
);
/**
* POST /user/createWithArray : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param userDto List of user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user/createWithArray",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> createUsersWithArrayInput(
@RequestBody List<UserDto> body
@RequestBody List<UserDto> userDto
);
/**
* POST /user/createWithList : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param userDto List of user object (required)
* @return successful operation (status code 200)
*/
@HttpExchange(
method = "POST",
value = "/user/createWithList",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> createUsersWithListInput(
@RequestBody List<UserDto> body
@RequestBody List<UserDto> userDto
);
@ -94,6 +96,7 @@ public interface UserApi {
/**
* GET /user/{username} : Get user by user name
*
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return successful operation (status code 200)
@ -112,6 +115,7 @@ public interface UserApi {
/**
* GET /user/login : Logs user into the system
*
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
@ -131,6 +135,7 @@ public interface UserApi {
/**
* GET /user/logout : Logs out current logged in user session
*
*
* @return successful operation (status code 200)
*/
@ -149,7 +154,7 @@ public interface UserApi {
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @param userDto Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
@ -157,11 +162,11 @@ public interface UserApi {
method = "PUT",
value = "/user/{username}",
accept = "application/json",
contentType = "*/*"
contentType = "application/json"
)
ResponseEntity<Void> updateUser(
@PathVariable("username") String username,
@RequestBody UserDto body
@RequestBody UserDto userDto
);
}

View File

@ -6,10 +6,13 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import jakarta.validation.constraints.NotNull;
@ -27,41 +30,41 @@ public class AdditionalPropertiesClassDto {
@JsonProperty("map_string")
private Map<String, String> mapString = null;
private Map<String, String> mapString = new HashMap<>();
@JsonProperty("map_number")
private Map<String, BigDecimal> mapNumber = null;
private Map<String, BigDecimal> mapNumber = new HashMap<>();
@JsonProperty("map_integer")
private Map<String, Integer> mapInteger = null;
private Map<String, Integer> mapInteger = new HashMap<>();
@JsonProperty("map_boolean")
private Map<String, Boolean> mapBoolean = null;
private Map<String, Boolean> mapBoolean = new HashMap<>();
@JsonProperty("map_array_integer")
private Map<String, List<Integer>> mapArrayInteger = null;
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
@JsonProperty("map_array_anytype")
private Map<String, List<Object>> mapArrayAnytype = null;
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
@JsonProperty("map_map_string")
private Map<String, Map<String, String>> mapMapString = null;
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
@JsonProperty("map_map_anytype")
private Map<String, Map<String, Object>> mapMapAnytype = null;
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
@JsonProperty("anytype_1")
private Object anytype1;
@JsonProperty("anytype_2")
private Object anytype2;
private JsonNullable<Object> anytype2 = JsonNullable.undefined();
@JsonProperty("anytype_3")
private Object anytype3;
@ -293,7 +296,7 @@ public class AdditionalPropertiesClassDto {
}
public AdditionalPropertiesClassDto anytype2(Object anytype2) {
this.anytype2 = anytype2;
this.anytype2 = JsonNullable.of(anytype2);
return this;
}
@ -302,11 +305,11 @@ public class AdditionalPropertiesClassDto {
* @return anytype2
*/
public Object getAnytype2() {
public JsonNullable<Object> getAnytype2() {
return anytype2;
}
public void setAnytype2(Object anytype2) {
public void setAnytype2(JsonNullable<Object> anytype2) {
this.anytype2 = anytype2;
}
@ -346,13 +349,24 @@ public class AdditionalPropertiesClassDto {
Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) &&
Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override

View File

@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnlyDto {
@JsonProperty("ArrayArrayNumber")
private List<List<BigDecimal>> arrayArrayNumber = null;
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
public ArrayOfArrayOfNumberOnlyDto arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;

View File

@ -26,7 +26,7 @@ public class ArrayOfNumberOnlyDto {
@JsonProperty("ArrayNumber")
private List<BigDecimal> arrayNumber = null;
private List<BigDecimal> arrayNumber = new ArrayList<>();
public ArrayOfNumberOnlyDto arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;

View File

@ -26,15 +26,15 @@ public class ArrayTestDto {
@JsonProperty("array_of_string")
private List<String> arrayOfString = null;
private List<String> arrayOfString = new ArrayList<>();
@JsonProperty("array_array_of_integer")
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
@JsonProperty("array_array_of_model")
private List<List<ReadOnlyFirstDto>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirstDto>> arrayArrayOfModel = new ArrayList<>();
public ArrayTestDto arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;

View File

@ -0,0 +1,203 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import jakarta.validation.constraints.NotNull;
import java.util.*;
import jakarta.annotation.Generated;
/**
* ContainerDefaultValueDto
*/
@JsonTypeName("ContainerDefaultValue")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class ContainerDefaultValueDto {
@JsonProperty("nullable_array")
private JsonNullable<List<String>> nullableArray = JsonNullable.undefined();
@JsonProperty("nullable_required_array")
private JsonNullable<List<String>> nullableRequiredArray = JsonNullable.undefined();
@JsonProperty("required_array")
private List<String> requiredArray = new ArrayList<>();
@JsonProperty("nullable_array_with_default")
private JsonNullable<List<String>> nullableArrayWithDefault = JsonNullable.undefined();
public ContainerDefaultValueDto nullableArray(List<String> nullableArray) {
this.nullableArray = JsonNullable.of(nullableArray);
return this;
}
public ContainerDefaultValueDto addNullableArrayItem(String nullableArrayItem) {
if (this.nullableArray == null || !this.nullableArray.isPresent()) {
this.nullableArray = JsonNullable.of(new ArrayList<>());
}
this.nullableArray.get().add(nullableArrayItem);
return this;
}
/**
* Get nullableArray
* @return nullableArray
*/
public JsonNullable<List<String>> getNullableArray() {
return nullableArray;
}
public void setNullableArray(JsonNullable<List<String>> nullableArray) {
this.nullableArray = nullableArray;
}
public ContainerDefaultValueDto nullableRequiredArray(List<String> nullableRequiredArray) {
this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray);
return this;
}
public ContainerDefaultValueDto addNullableRequiredArrayItem(String nullableRequiredArrayItem) {
if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) {
this.nullableRequiredArray = JsonNullable.of(new ArrayList<>());
}
this.nullableRequiredArray.get().add(nullableRequiredArrayItem);
return this;
}
/**
* Get nullableRequiredArray
* @return nullableRequiredArray
*/
@NotNull
public JsonNullable<List<String>> getNullableRequiredArray() {
return nullableRequiredArray;
}
public void setNullableRequiredArray(JsonNullable<List<String>> nullableRequiredArray) {
this.nullableRequiredArray = nullableRequiredArray;
}
public ContainerDefaultValueDto requiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
return this;
}
public ContainerDefaultValueDto addRequiredArrayItem(String requiredArrayItem) {
if (this.requiredArray == null) {
this.requiredArray = new ArrayList<>();
}
this.requiredArray.add(requiredArrayItem);
return this;
}
/**
* Get requiredArray
* @return requiredArray
*/
@NotNull
public List<String> getRequiredArray() {
return requiredArray;
}
public void setRequiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
}
public ContainerDefaultValueDto nullableArrayWithDefault(List<String> nullableArrayWithDefault) {
this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault);
return this;
}
public ContainerDefaultValueDto addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) {
if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) {
this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar")));
}
this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem);
return this;
}
/**
* Get nullableArrayWithDefault
* @return nullableArrayWithDefault
*/
public JsonNullable<List<String>> getNullableArrayWithDefault() {
return nullableArrayWithDefault;
}
public void setNullableArrayWithDefault(JsonNullable<List<String>> nullableArrayWithDefault) {
this.nullableArrayWithDefault = nullableArrayWithDefault;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContainerDefaultValueDto containerDefaultValue = (ContainerDefaultValueDto) o;
return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) &&
Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) &&
Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) &&
equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault));
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContainerDefaultValueDto {\n");
sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n");
sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n");
sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n");
sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -99,7 +99,7 @@ public class EnumArraysDto {
@JsonProperty("array_enum")
private List<ArrayEnumEnum> arrayEnum = null;
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
public EnumArraysDto justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;

View File

@ -29,7 +29,7 @@ public class FileSchemaTestClassDto {
@JsonProperty("files")
private List<FileDto> files = null;
private List<FileDto> files = new ArrayList<>();
public FileSchemaTestClassDto file(FileDto file) {
this.file = file;

View File

@ -26,7 +26,7 @@ public class MapTestDto {
@JsonProperty("map_map_of_string")
private Map<String, Map<String, String>> mapMapOfString = null;
private Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
/**
* Gets or Sets inner
@ -65,15 +65,15 @@ public class MapTestDto {
@JsonProperty("map_of_enum_string")
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
@JsonProperty("direct_map")
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap = new HashMap<>();
@JsonProperty("indirect_map")
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap = new HashMap<>();
public MapTestDto mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;

View File

@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClassDto {
@JsonProperty("map")
private Map<String, AnimalDto> map = null;
private Map<String, AnimalDto> map = new HashMap<>();
public MixedPropertiesAndAdditionalPropertiesClassDto uuid(UUID uuid) {
this.uuid = uuid;

View File

@ -44,7 +44,7 @@ public class PetDto {
@JsonProperty("tags")
private List<TagDto> tags = null;
private List<TagDto> tags = new ArrayList<>();
/**
* pet status in the store
@ -146,6 +146,9 @@ public class PetDto {
}
public PetDto addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new LinkedHashSet<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -17,7 +17,7 @@ import jakarta.annotation.Generated;
* SpecialModelNameDto
*/
@JsonTypeName("$special[model.name]")
@JsonTypeName("_special_model.name_")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class SpecialModelNameDto {
@ -50,8 +50,8 @@ public class SpecialModelNameDto {
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelNameDto $specialModelName = (SpecialModelNameDto) o;
return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName);
SpecialModelNameDto specialModelName = (SpecialModelNameDto) o;
return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName);
}
@Override

View File

@ -28,17 +28,17 @@ public class TypeHolderDefaultDto {
private String stringItem = "what";
@JsonProperty("number_item")
private BigDecimal numberItem;
private BigDecimal numberItem = new BigDecimal("1.234");
@JsonProperty("integer_item")
private Integer integerItem;
private Integer integerItem = -2;
@JsonProperty("bool_item")
private Boolean boolItem = true;
@JsonProperty("array_item")
private List<Integer> arrayItem = new ArrayList<>();
private List<Integer> arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
public TypeHolderDefaultDto stringItem(String stringItem) {
this.stringItem = stringItem;
@ -118,6 +118,9 @@ public class TypeHolderDefaultDto {
}
public TypeHolderDefaultDto addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@ -139,6 +139,9 @@ public class TypeHolderExampleDto {
}
public TypeHolderExampleDto addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@ -38,7 +38,7 @@ public class XmlItemDto {
@JsonProperty("wrapped_array")
private List<Integer> wrappedArray = null;
private List<Integer> wrappedArray = new ArrayList<>();
@JsonProperty("name_string")
private String nameString;
@ -54,11 +54,11 @@ public class XmlItemDto {
@JsonProperty("name_array")
private List<Integer> nameArray = null;
private List<Integer> nameArray = new ArrayList<>();
@JsonProperty("name_wrapped_array")
private List<Integer> nameWrappedArray = null;
private List<Integer> nameWrappedArray = new ArrayList<>();
@JsonProperty("prefix_string")
private String prefixString;
@ -74,11 +74,11 @@ public class XmlItemDto {
@JsonProperty("prefix_array")
private List<Integer> prefixArray = null;
private List<Integer> prefixArray = new ArrayList<>();
@JsonProperty("prefix_wrapped_array")
private List<Integer> prefixWrappedArray = null;
private List<Integer> prefixWrappedArray = new ArrayList<>();
@JsonProperty("namespace_string")
private String namespaceString;
@ -94,11 +94,11 @@ public class XmlItemDto {
@JsonProperty("namespace_array")
private List<Integer> namespaceArray = null;
private List<Integer> namespaceArray = new ArrayList<>();
@JsonProperty("namespace_wrapped_array")
private List<Integer> namespaceWrappedArray = null;
private List<Integer> namespaceWrappedArray = new ArrayList<>();
@JsonProperty("prefix_ns_string")
private String prefixNsString;
@ -114,11 +114,11 @@ public class XmlItemDto {
@JsonProperty("prefix_ns_array")
private List<Integer> prefixNsArray = null;
private List<Integer> prefixNsArray = new ArrayList<>();
@JsonProperty("prefix_ns_wrapped_array")
private List<Integer> prefixNsWrappedArray = null;
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
public XmlItemDto attributeString(String attributeString) {
this.attributeString = attributeString;

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -26,6 +26,7 @@ src/main/java/org/openapitools/model/CatAllOf.java
src/main/java/org/openapitools/model/Category.java
src/main/java/org/openapitools/model/ClassModel.java
src/main/java/org/openapitools/model/Client.java
src/main/java/org/openapitools/model/ContainerDefaultValue.java
src/main/java/org/openapitools/model/Dog.java
src/main/java/org/openapitools/model/DogAllOf.java
src/main/java/org/openapitools/model/EnumArrays.java

View File

@ -41,7 +41,7 @@ public interface AnotherFakeApi {
* PATCH /another-fake/dummy : To test special tags
* To test special tags and operation ID starting with number
*
* @param body client model (required)
* @param client client model (required)
* @return successful operation (status code 200)
*/
@Operation(
@ -62,7 +62,7 @@ public interface AnotherFakeApi {
consumes = "application/json"
)
ResponseEntity<Client> call123testSpecialTags(
@Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body
@Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client
);
}

View File

@ -92,7 +92,8 @@ public interface FakeApi {
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/boolean",
produces = "*/*"
produces = "*/*",
consumes = "application/json"
)
ResponseEntity<Boolean> fakeOuterBooleanSerialize(
@Parameter(name = "body", description = "Input boolean as post body") @Valid @RequestBody(required = false) Boolean body
@ -103,7 +104,7 @@ public interface FakeApi {
* POST /fake/outer/composite
* Test serialization of object with outer number type
*
* @param body Input composite as post body (optional)
* @param outerComposite Input composite as post body (optional)
* @return Output composite (status code 200)
*/
@Operation(
@ -119,10 +120,11 @@ public interface FakeApi {
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/composite",
produces = "*/*"
produces = "*/*",
consumes = "application/json"
)
ResponseEntity<OuterComposite> fakeOuterCompositeSerialize(
@Parameter(name = "body", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite body
@Parameter(name = "OuterComposite", description = "Input composite as post body") @Valid @RequestBody(required = false) OuterComposite outerComposite
);
@ -146,7 +148,8 @@ public interface FakeApi {
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/number",
produces = "*/*"
produces = "*/*",
consumes = "application/json"
)
ResponseEntity<BigDecimal> fakeOuterNumberSerialize(
@Parameter(name = "body", description = "Input number as post body") @Valid @RequestBody(required = false) BigDecimal body
@ -173,7 +176,8 @@ public interface FakeApi {
@RequestMapping(
method = RequestMethod.POST,
value = "/fake/outer/string",
produces = "*/*"
produces = "*/*",
consumes = "application/json"
)
ResponseEntity<String> fakeOuterStringSerialize(
@Parameter(name = "body", description = "Input string as post body") @Valid @RequestBody(required = false) String body
@ -184,7 +188,7 @@ public interface FakeApi {
* PUT /fake/body-with-file-schema
* For this test, the body for this request much reference a schema named &#x60;File&#x60;.
*
* @param body (required)
* @param fileSchemaTestClass (required)
* @return Success (status code 200)
*/
@Operation(
@ -201,7 +205,7 @@ public interface FakeApi {
consumes = "application/json"
)
ResponseEntity<Void> testBodyWithFileSchema(
@Parameter(name = "body", description = "", required = true) @Valid @RequestBody FileSchemaTestClass body
@Parameter(name = "FileSchemaTestClass", description = "", required = true) @Valid @RequestBody FileSchemaTestClass fileSchemaTestClass
);
@ -209,7 +213,7 @@ public interface FakeApi {
* PUT /fake/body-with-query-params
*
* @param query (required)
* @param body (required)
* @param user (required)
* @return Success (status code 200)
*/
@Operation(
@ -226,7 +230,7 @@ public interface FakeApi {
)
ResponseEntity<Void> testBodyWithQueryParams(
@NotNull @Parameter(name = "query", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "query", required = true) String query,
@Parameter(name = "body", description = "", required = true) @Valid @RequestBody User body
@Parameter(name = "User", description = "", required = true) @Valid @RequestBody User user
);
@ -234,7 +238,7 @@ public interface FakeApi {
* PATCH /fake : To test \&quot;client\&quot; model
* To test \&quot;client\&quot; model
*
* @param body client model (required)
* @param client client model (required)
* @return successful operation (status code 200)
*/
@Operation(
@ -255,7 +259,7 @@ public interface FakeApi {
consumes = "application/json"
)
ResponseEntity<Client> testClientModel(
@Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body
@Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client
);
@ -395,13 +399,15 @@ public interface FakeApi {
/**
* POST /fake/inline-additionalProperties : test inline additionalProperties
*
*
* @param param request body (required)
* @param requestBody request body (required)
* @return successful operation (status code 200)
*/
@Operation(
operationId = "testInlineAdditionalProperties",
summary = "test inline additionalProperties",
description = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
@ -413,12 +419,13 @@ public interface FakeApi {
consumes = "application/json"
)
ResponseEntity<Void> testInlineAdditionalProperties(
@Parameter(name = "param", description = "request body", required = true) @Valid @RequestBody Map<String, String> param
@Parameter(name = "request_body", description = "request body", required = true) @Valid @RequestBody Map<String, String> requestBody
);
/**
* GET /fake/jsonFormData : test json serialization of form data
*
*
* @param param field1 (required)
* @param param2 field2 (required)
@ -427,6 +434,7 @@ public interface FakeApi {
@Operation(
operationId = "testJsonFormData",
summary = "test json serialization of form data",
description = "",
tags = { "fake" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation")
@ -448,7 +456,6 @@ public interface FakeApi {
* To test the collection format in query parameters
*
* @param pipe (required)
* @param ioutil (required)
* @param http (required)
* @param url (required)
* @param context (required)
@ -468,7 +475,6 @@ public interface FakeApi {
)
ResponseEntity<Void> testQueryParameterCollectionFormat(
@NotNull @Parameter(name = "pipe", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "pipe", required = true) List<String> pipe,
@NotNull @Parameter(name = "ioutil", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "ioutil", required = true) List<String> ioutil,
@NotNull @Parameter(name = "http", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "http", required = true) List<String> http,
@NotNull @Parameter(name = "url", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "url", required = true) List<String> url,
@NotNull @Parameter(name = "context", description = "", required = true, in = ParameterIn.QUERY) @Valid @RequestParam(value = "context", required = true) List<String> context

View File

@ -41,7 +41,7 @@ public interface FakeClassnameTags123Api {
* PATCH /fake_classname_test : To test class name in snake case
* To test class name in snake case
*
* @param body client model (required)
* @param client client model (required)
* @return successful operation (status code 200)
*/
@Operation(
@ -65,7 +65,7 @@ public interface FakeClassnameTags123Api {
consumes = "application/json"
)
ResponseEntity<Client> testClassname(
@Parameter(name = "body", description = "client model", required = true) @Valid @RequestBody Client body
@Parameter(name = "Client", description = "client model", required = true) @Valid @RequestBody Client client
);
}

View File

@ -41,14 +41,16 @@ public interface PetApi {
/**
* POST /pet : Add a new pet to the store
*
*
* @param body Pet object that needs to be added to the store (required)
* @param pet Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid input (status code 405)
*/
@Operation(
operationId = "addPet",
summary = "Add a new pet to the store",
description = "",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation"),
@ -64,12 +66,13 @@ public interface PetApi {
consumes = "application/json"
)
ResponseEntity<Void> addPet(
@Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
);
/**
* DELETE /pet/{petId} : Deletes a pet
*
*
* @param petId Pet id to delete (required)
* @param apiKey (optional)
@ -79,6 +82,7 @@ public interface PetApi {
@Operation(
operationId = "deletePet",
summary = "Deletes a pet",
description = "",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation"),
@ -206,8 +210,9 @@ public interface PetApi {
/**
* PUT /pet : Update an existing pet
*
*
* @param body Pet object that needs to be added to the store (required)
* @param pet Pet object that needs to be added to the store (required)
* @return successful operation (status code 200)
* or Invalid ID supplied (status code 400)
* or Pet not found (status code 404)
@ -216,6 +221,7 @@ public interface PetApi {
@Operation(
operationId = "updatePet",
summary = "Update an existing pet",
description = "",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation"),
@ -233,12 +239,13 @@ public interface PetApi {
consumes = "application/json"
)
ResponseEntity<Void> updatePet(
@Parameter(name = "body", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet body
@Parameter(name = "Pet", description = "Pet object that needs to be added to the store", required = true) @Valid @RequestBody Pet pet
);
/**
* POST /pet/{petId} : Updates a pet in the store with form data
*
*
* @param petId ID of pet that needs to be updated (required)
* @param name Updated name of the pet (optional)
@ -248,6 +255,7 @@ public interface PetApi {
@Operation(
operationId = "updatePetWithForm",
summary = "Updates a pet in the store with form data",
description = "",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "405", description = "Invalid input")
@ -270,6 +278,7 @@ public interface PetApi {
/**
* POST /pet/{petId}/uploadImage : uploads an image
*
*
* @param petId ID of pet to update (required)
* @param additionalMetadata Additional data to pass to server (optional)
@ -279,6 +288,7 @@ public interface PetApi {
@Operation(
operationId = "uploadFile",
summary = "uploads an image",
description = "",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = {
@ -304,6 +314,7 @@ public interface PetApi {
/**
* POST /fake/{petId}/uploadImageWithRequiredFile : uploads an image (required)
*
*
* @param petId ID of pet to update (required)
* @param requiredFile file to upload (required)
@ -313,6 +324,7 @@ public interface PetApi {
@Operation(
operationId = "uploadFileWithRequiredFile",
summary = "uploads an image (required)",
description = "",
tags = { "pet" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = {

View File

@ -130,14 +130,16 @@ public interface StoreApi {
/**
* POST /store/order : Place an order for a pet
*
*
* @param body order placed for purchasing the pet (required)
* @param order order placed for purchasing the pet (required)
* @return successful operation (status code 200)
* or Invalid Order (status code 400)
*/
@Operation(
operationId = "placeOrder",
summary = "Place an order for a pet",
description = "",
tags = { "store" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = {
@ -150,10 +152,11 @@ public interface StoreApi {
@RequestMapping(
method = RequestMethod.POST,
value = "/store/order",
produces = "application/json"
produces = "application/json",
consumes = "application/json"
)
ResponseEntity<Order> placeOrder(
@Parameter(name = "body", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order body
@Parameter(name = "Order", description = "order placed for purchasing the pet", required = true) @Valid @RequestBody Order order
);
}

View File

@ -43,7 +43,7 @@ public interface UserApi {
* POST /user : Create user
* This can only be done by the logged in user.
*
* @param body Created user object (required)
* @param user Created user object (required)
* @return successful operation (status code 200)
*/
@Operation(
@ -57,22 +57,25 @@ public interface UserApi {
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user"
value = "/user",
consumes = "application/json"
)
ResponseEntity<Void> createUser(
@Parameter(name = "body", description = "Created user object", required = true) @Valid @RequestBody User body
@Parameter(name = "User", description = "Created user object", required = true) @Valid @RequestBody User user
);
/**
* POST /user/createWithArray : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
@Operation(
operationId = "createUsersWithArrayInput",
summary = "Creates list of users with given input array",
description = "",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "default", description = "successful operation")
@ -80,22 +83,25 @@ public interface UserApi {
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithArray"
value = "/user/createWithArray",
consumes = "application/json"
)
ResponseEntity<Void> createUsersWithArrayInput(
@Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List<User> body
@Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<User> user
);
/**
* POST /user/createWithList : Creates list of users with given input array
*
*
* @param body List of user object (required)
* @param user List of user object (required)
* @return successful operation (status code 200)
*/
@Operation(
operationId = "createUsersWithListInput",
summary = "Creates list of users with given input array",
description = "",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "default", description = "successful operation")
@ -103,10 +109,11 @@ public interface UserApi {
)
@RequestMapping(
method = RequestMethod.POST,
value = "/user/createWithList"
value = "/user/createWithList",
consumes = "application/json"
)
ResponseEntity<Void> createUsersWithListInput(
@Parameter(name = "body", description = "List of user object", required = true) @Valid @RequestBody List<User> body
@Parameter(name = "User", description = "List of user object", required = true) @Valid @RequestBody List<User> user
);
@ -139,6 +146,7 @@ public interface UserApi {
/**
* GET /user/{username} : Get user by user name
*
*
* @param username The name that needs to be fetched. Use user1 for testing. (required)
* @return successful operation (status code 200)
@ -148,6 +156,7 @@ public interface UserApi {
@Operation(
operationId = "getUserByName",
summary = "Get user by user name",
description = "",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = {
@ -170,6 +179,7 @@ public interface UserApi {
/**
* GET /user/login : Logs user into the system
*
*
* @param username The user name for login (required)
* @param password The password for login in clear text (required)
@ -179,6 +189,7 @@ public interface UserApi {
@Operation(
operationId = "loginUser",
summary = "Logs user into the system",
description = "",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "200", description = "successful operation", content = {
@ -201,12 +212,14 @@ public interface UserApi {
/**
* GET /user/logout : Logs out current logged in user session
*
*
* @return successful operation (status code 200)
*/
@Operation(
operationId = "logoutUser",
summary = "Logs out current logged in user session",
description = "",
tags = { "user" },
responses = {
@ApiResponse(responseCode = "default", description = "successful operation")
@ -226,7 +239,7 @@ public interface UserApi {
* This can only be done by the logged in user.
*
* @param username name that need to be deleted (required)
* @param body Updated user object (required)
* @param user Updated user object (required)
* @return Invalid user supplied (status code 400)
* or User not found (status code 404)
*/
@ -242,11 +255,12 @@ public interface UserApi {
)
@RequestMapping(
method = RequestMethod.PUT,
value = "/user/{username}"
value = "/user/{username}",
consumes = "application/json"
)
ResponseEntity<Void> updateUser(
@Parameter(name = "username", description = "name that need to be deleted", required = true, in = ParameterIn.PATH) @PathVariable("username") String username,
@Parameter(name = "body", description = "Updated user object", required = true) @Valid @RequestBody User body
@Parameter(name = "User", description = "Updated user object", required = true) @Valid @RequestBody User user
);
}

View File

@ -5,10 +5,13 @@ import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
@ -27,41 +30,41 @@ public class AdditionalPropertiesClass {
@JsonProperty("map_string")
@Valid
private Map<String, String> mapString = null;
private Map<String, String> mapString = new HashMap<>();
@JsonProperty("map_number")
@Valid
private Map<String, BigDecimal> mapNumber = null;
private Map<String, BigDecimal> mapNumber = new HashMap<>();
@JsonProperty("map_integer")
@Valid
private Map<String, Integer> mapInteger = null;
private Map<String, Integer> mapInteger = new HashMap<>();
@JsonProperty("map_boolean")
@Valid
private Map<String, Boolean> mapBoolean = null;
private Map<String, Boolean> mapBoolean = new HashMap<>();
@JsonProperty("map_array_integer")
@Valid
private Map<String, List<Integer>> mapArrayInteger = null;
private Map<String, List<Integer>> mapArrayInteger = new HashMap<>();
@JsonProperty("map_array_anytype")
@Valid
private Map<String, List<Object>> mapArrayAnytype = null;
private Map<String, List<Object>> mapArrayAnytype = new HashMap<>();
@JsonProperty("map_map_string")
@Valid
private Map<String, Map<String, String>> mapMapString = null;
private Map<String, Map<String, String>> mapMapString = new HashMap<>();
@JsonProperty("map_map_anytype")
@Valid
private Map<String, Map<String, Object>> mapMapAnytype = null;
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<>();
@JsonProperty("anytype_1")
private Object anytype1;
@JsonProperty("anytype_2")
private Object anytype2;
private JsonNullable<Object> anytype2 = JsonNullable.undefined();
@JsonProperty("anytype_3")
private Object anytype3;
@ -302,7 +305,7 @@ public class AdditionalPropertiesClass {
}
public AdditionalPropertiesClass anytype2(Object anytype2) {
this.anytype2 = anytype2;
this.anytype2 = JsonNullable.of(anytype2);
return this;
}
@ -312,11 +315,11 @@ public class AdditionalPropertiesClass {
*/
@Schema(name = "anytype_2", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
public Object getAnytype2() {
public JsonNullable<Object> getAnytype2() {
return anytype2;
}
public void setAnytype2(Object anytype2) {
public void setAnytype2(JsonNullable<Object> anytype2) {
this.anytype2 = anytype2;
}
@ -357,13 +360,24 @@ public class AdditionalPropertiesClass {
Objects.equals(this.mapMapString, additionalPropertiesClass.mapMapString) &&
Objects.equals(this.mapMapAnytype, additionalPropertiesClass.mapMapAnytype) &&
Objects.equals(this.anytype1, additionalPropertiesClass.anytype1) &&
Objects.equals(this.anytype2, additionalPropertiesClass.anytype2) &&
equalsNullable(this.anytype2, additionalPropertiesClass.anytype2) &&
Objects.equals(this.anytype3, additionalPropertiesClass.anytype3);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, anytype2, anytype3);
return Objects.hash(mapString, mapNumber, mapInteger, mapBoolean, mapArrayInteger, mapArrayAnytype, mapMapString, mapMapAnytype, anytype1, hashCodeNullable(anytype2), anytype3);
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override

View File

@ -26,7 +26,7 @@ public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
@Valid
private List<List<BigDecimal>> arrayArrayNumber = null;
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<>();
public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
this.arrayArrayNumber = arrayArrayNumber;

View File

@ -26,7 +26,7 @@ public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
@Valid
private List<BigDecimal> arrayNumber = null;
private List<BigDecimal> arrayNumber = new ArrayList<>();
public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
this.arrayNumber = arrayNumber;

View File

@ -26,15 +26,15 @@ public class ArrayTest {
@JsonProperty("array_of_string")
@Valid
private List<String> arrayOfString = null;
private List<String> arrayOfString = new ArrayList<>();
@JsonProperty("array_array_of_integer")
@Valid
private List<List<Long>> arrayArrayOfInteger = null;
private List<List<Long>> arrayArrayOfInteger = new ArrayList<>();
@JsonProperty("array_array_of_model")
@Valid
private List<List<ReadOnlyFirst>> arrayArrayOfModel = null;
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<>();
public ArrayTest arrayOfString(List<String> arrayOfString) {
this.arrayOfString = arrayOfString;

View File

@ -0,0 +1,207 @@
package org.openapitools.model;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.openapitools.jackson.nullable.JsonNullable;
import java.util.NoSuchElementException;
import org.openapitools.jackson.nullable.JsonNullable;
import java.time.OffsetDateTime;
import javax.validation.Valid;
import javax.validation.constraints.*;
import io.swagger.v3.oas.annotations.media.Schema;
import java.util.*;
import javax.annotation.Generated;
/**
* ContainerDefaultValue
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class ContainerDefaultValue {
@JsonProperty("nullable_array")
@Valid
private JsonNullable<List<String>> nullableArray = JsonNullable.undefined();
@JsonProperty("nullable_required_array")
@Valid
private JsonNullable<List<String>> nullableRequiredArray = JsonNullable.undefined();
@JsonProperty("required_array")
@Valid
private List<String> requiredArray = new ArrayList<>();
@JsonProperty("nullable_array_with_default")
@Valid
private JsonNullable<List<String>> nullableArrayWithDefault = JsonNullable.undefined();
public ContainerDefaultValue nullableArray(List<String> nullableArray) {
this.nullableArray = JsonNullable.of(nullableArray);
return this;
}
public ContainerDefaultValue addNullableArrayItem(String nullableArrayItem) {
if (this.nullableArray == null || !this.nullableArray.isPresent()) {
this.nullableArray = JsonNullable.of(new ArrayList<>());
}
this.nullableArray.get().add(nullableArrayItem);
return this;
}
/**
* Get nullableArray
* @return nullableArray
*/
@Schema(name = "nullable_array", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
public JsonNullable<List<String>> getNullableArray() {
return nullableArray;
}
public void setNullableArray(JsonNullable<List<String>> nullableArray) {
this.nullableArray = nullableArray;
}
public ContainerDefaultValue nullableRequiredArray(List<String> nullableRequiredArray) {
this.nullableRequiredArray = JsonNullable.of(nullableRequiredArray);
return this;
}
public ContainerDefaultValue addNullableRequiredArrayItem(String nullableRequiredArrayItem) {
if (this.nullableRequiredArray == null || !this.nullableRequiredArray.isPresent()) {
this.nullableRequiredArray = JsonNullable.of(new ArrayList<>());
}
this.nullableRequiredArray.get().add(nullableRequiredArrayItem);
return this;
}
/**
* Get nullableRequiredArray
* @return nullableRequiredArray
*/
@NotNull
@Schema(name = "nullable_required_array", requiredMode = Schema.RequiredMode.REQUIRED)
public JsonNullable<List<String>> getNullableRequiredArray() {
return nullableRequiredArray;
}
public void setNullableRequiredArray(JsonNullable<List<String>> nullableRequiredArray) {
this.nullableRequiredArray = nullableRequiredArray;
}
public ContainerDefaultValue requiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
return this;
}
public ContainerDefaultValue addRequiredArrayItem(String requiredArrayItem) {
if (this.requiredArray == null) {
this.requiredArray = new ArrayList<>();
}
this.requiredArray.add(requiredArrayItem);
return this;
}
/**
* Get requiredArray
* @return requiredArray
*/
@NotNull
@Schema(name = "required_array", requiredMode = Schema.RequiredMode.REQUIRED)
public List<String> getRequiredArray() {
return requiredArray;
}
public void setRequiredArray(List<String> requiredArray) {
this.requiredArray = requiredArray;
}
public ContainerDefaultValue nullableArrayWithDefault(List<String> nullableArrayWithDefault) {
this.nullableArrayWithDefault = JsonNullable.of(nullableArrayWithDefault);
return this;
}
public ContainerDefaultValue addNullableArrayWithDefaultItem(String nullableArrayWithDefaultItem) {
if (this.nullableArrayWithDefault == null || !this.nullableArrayWithDefault.isPresent()) {
this.nullableArrayWithDefault = JsonNullable.of(new ArrayList<>(Arrays.asList("foo", "bar")));
}
this.nullableArrayWithDefault.get().add(nullableArrayWithDefaultItem);
return this;
}
/**
* Get nullableArrayWithDefault
* @return nullableArrayWithDefault
*/
@Schema(name = "nullable_array_with_default", requiredMode = Schema.RequiredMode.NOT_REQUIRED)
public JsonNullable<List<String>> getNullableArrayWithDefault() {
return nullableArrayWithDefault;
}
public void setNullableArrayWithDefault(JsonNullable<List<String>> nullableArrayWithDefault) {
this.nullableArrayWithDefault = nullableArrayWithDefault;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ContainerDefaultValue containerDefaultValue = (ContainerDefaultValue) o;
return equalsNullable(this.nullableArray, containerDefaultValue.nullableArray) &&
Objects.equals(this.nullableRequiredArray, containerDefaultValue.nullableRequiredArray) &&
Objects.equals(this.requiredArray, containerDefaultValue.requiredArray) &&
equalsNullable(this.nullableArrayWithDefault, containerDefaultValue.nullableArrayWithDefault);
}
private static <T> boolean equalsNullable(JsonNullable<T> a, JsonNullable<T> b) {
return a == b || (a != null && b != null && a.isPresent() && b.isPresent() && Objects.deepEquals(a.get(), b.get()));
}
@Override
public int hashCode() {
return Objects.hash(hashCodeNullable(nullableArray), nullableRequiredArray, requiredArray, hashCodeNullable(nullableArrayWithDefault));
}
private static <T> int hashCodeNullable(JsonNullable<T> a) {
if (a == null) {
return 1;
}
return a.isPresent() ? Arrays.deepHashCode(new Object[]{a.get()}) : 31;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ContainerDefaultValue {\n");
sb.append(" nullableArray: ").append(toIndentedString(nullableArray)).append("\n");
sb.append(" nullableRequiredArray: ").append(toIndentedString(nullableRequiredArray)).append("\n");
sb.append(" requiredArray: ").append(toIndentedString(requiredArray)).append("\n");
sb.append(" nullableArrayWithDefault: ").append(toIndentedString(nullableArrayWithDefault)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}

View File

@ -99,7 +99,7 @@ public class EnumArrays {
@JsonProperty("array_enum")
@Valid
private List<ArrayEnumEnum> arrayEnum = null;
private List<ArrayEnumEnum> arrayEnum = new ArrayList<>();
public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
this.justSymbol = justSymbol;

View File

@ -29,7 +29,7 @@ public class FileSchemaTestClass {
@JsonProperty("files")
@Valid
private List<@Valid File> files = null;
private List<@Valid File> files = new ArrayList<>();
public FileSchemaTestClass file(File file) {
this.file = file;

View File

@ -26,7 +26,7 @@ public class MapTest {
@JsonProperty("map_map_of_string")
@Valid
private Map<String, Map<String, String>> mapMapOfString = null;
private Map<String, Map<String, String>> mapMapOfString = new HashMap<>();
/**
* Gets or Sets inner
@ -65,15 +65,15 @@ public class MapTest {
@JsonProperty("map_of_enum_string")
@Valid
private Map<String, InnerEnum> mapOfEnumString = null;
private Map<String, InnerEnum> mapOfEnumString = new HashMap<>();
@JsonProperty("direct_map")
@Valid
private Map<String, Boolean> directMap = null;
private Map<String, Boolean> directMap = new HashMap<>();
@JsonProperty("indirect_map")
@Valid
private Map<String, Boolean> indirectMap = null;
private Map<String, Boolean> indirectMap = new HashMap<>();
public MapTest mapMapOfString(Map<String, Map<String, String>> mapMapOfString) {
this.mapMapOfString = mapMapOfString;

View File

@ -36,7 +36,7 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
@JsonProperty("map")
@Valid
private Map<String, Animal> map = null;
private Map<String, Animal> map = new HashMap<>();
public MixedPropertiesAndAdditionalPropertiesClass uuid(UUID uuid) {
this.uuid = uuid;

View File

@ -44,7 +44,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -149,6 +149,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new LinkedHashSet<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -19,7 +19,7 @@ import javax.annotation.Generated;
* SpecialModelName
*/
@JsonTypeName("$special[model.name]")
@JsonTypeName("_special_model.name_")
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen")
public class SpecialModelName {
@ -53,8 +53,8 @@ public class SpecialModelName {
if (o == null || getClass() != o.getClass()) {
return false;
}
SpecialModelName $specialModelName = (SpecialModelName) o;
return Objects.equals(this.$specialPropertyName, $specialModelName.$specialPropertyName);
SpecialModelName specialModelName = (SpecialModelName) o;
return Objects.equals(this.$specialPropertyName, specialModelName.$specialPropertyName);
}
@Override

View File

@ -28,17 +28,17 @@ public class TypeHolderDefault {
private String stringItem = "what";
@JsonProperty("number_item")
private BigDecimal numberItem;
private BigDecimal numberItem = new BigDecimal("1.234");
@JsonProperty("integer_item")
private Integer integerItem;
private Integer integerItem = -2;
@JsonProperty("bool_item")
private Boolean boolItem = true;
@JsonProperty("array_item")
@Valid
private List<Integer> arrayItem = new ArrayList<>();
private List<Integer> arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
public TypeHolderDefault stringItem(String stringItem) {
this.stringItem = stringItem;
@ -122,6 +122,9 @@ public class TypeHolderDefault {
}
public TypeHolderDefault addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>(Arrays.asList(0, 1, 2, 3));
}
this.arrayItem.add(arrayItemItem);
return this;
}

View File

@ -144,6 +144,9 @@ public class TypeHolderExample {
}
public TypeHolderExample addArrayItemItem(Integer arrayItemItem) {
if (this.arrayItem == null) {
this.arrayItem = new ArrayList<>();
}
this.arrayItem.add(arrayItemItem);
return this;
}
@ -153,7 +156,7 @@ public class TypeHolderExample {
* @return arrayItem
*/
@NotNull
@Schema(name = "array_item", example = "[0, 1, 2, 3]", requiredMode = Schema.RequiredMode.REQUIRED)
@Schema(name = "array_item", example = "[0,1,2,3]", requiredMode = Schema.RequiredMode.REQUIRED)
public List<Integer> getArrayItem() {
return arrayItem;
}

View File

@ -38,7 +38,7 @@ public class XmlItem {
@JsonProperty("wrapped_array")
@Valid
private List<Integer> wrappedArray = null;
private List<Integer> wrappedArray = new ArrayList<>();
@JsonProperty("name_string")
private String nameString;
@ -54,11 +54,11 @@ public class XmlItem {
@JsonProperty("name_array")
@Valid
private List<Integer> nameArray = null;
private List<Integer> nameArray = new ArrayList<>();
@JsonProperty("name_wrapped_array")
@Valid
private List<Integer> nameWrappedArray = null;
private List<Integer> nameWrappedArray = new ArrayList<>();
@JsonProperty("prefix_string")
private String prefixString;
@ -74,11 +74,11 @@ public class XmlItem {
@JsonProperty("prefix_array")
@Valid
private List<Integer> prefixArray = null;
private List<Integer> prefixArray = new ArrayList<>();
@JsonProperty("prefix_wrapped_array")
@Valid
private List<Integer> prefixWrappedArray = null;
private List<Integer> prefixWrappedArray = new ArrayList<>();
@JsonProperty("namespace_string")
private String namespaceString;
@ -94,11 +94,11 @@ public class XmlItem {
@JsonProperty("namespace_array")
@Valid
private List<Integer> namespaceArray = null;
private List<Integer> namespaceArray = new ArrayList<>();
@JsonProperty("namespace_wrapped_array")
@Valid
private List<Integer> namespaceWrappedArray = null;
private List<Integer> namespaceWrappedArray = new ArrayList<>();
@JsonProperty("prefix_ns_string")
private String prefixNsString;
@ -114,11 +114,11 @@ public class XmlItem {
@JsonProperty("prefix_ns_array")
@Valid
private List<Integer> prefixNsArray = null;
private List<Integer> prefixNsArray = new ArrayList<>();
@JsonProperty("prefix_ns_wrapped_array")
@Valid
private List<Integer> prefixNsWrappedArray = null;
private List<Integer> prefixNsWrappedArray = new ArrayList<>();
public XmlItem attributeString(String attributeString) {
this.attributeString = attributeString;

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -42,7 +42,7 @@ public class Pet {
@JsonProperty("tags")
@Valid
private List<@Valid Tag> tags = null;
private List<@Valid Tag> tags = new ArrayList<>();
/**
* pet status in the store
@ -164,6 +164,9 @@ public class Pet {
}
public Pet addPhotoUrlsItem(String photoUrlsItem) {
if (this.photoUrls == null) {
this.photoUrls = new ArrayList<>();
}
this.photoUrls.add(photoUrlsItem);
return this;
}

View File

@ -1,23 +0,0 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator
# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.
# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs
# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux
# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux
# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md

View File

@ -1,71 +0,0 @@
README.md
pom.xml
src/main/java/org/openapitools/OpenApiGeneratorApplication.java
src/main/java/org/openapitools/RFC3339DateFormat.java
src/main/java/org/openapitools/api/AnotherFakeApi.java
src/main/java/org/openapitools/api/AnotherFakeApiController.java
src/main/java/org/openapitools/api/ApiUtil.java
src/main/java/org/openapitools/api/FakeApi.java
src/main/java/org/openapitools/api/FakeApiController.java
src/main/java/org/openapitools/api/FakeClassnameTestApi.java
src/main/java/org/openapitools/api/FakeClassnameTestApiController.java
src/main/java/org/openapitools/api/PetApi.java
src/main/java/org/openapitools/api/PetApiController.java
src/main/java/org/openapitools/api/StoreApi.java
src/main/java/org/openapitools/api/StoreApiController.java
src/main/java/org/openapitools/api/UserApi.java
src/main/java/org/openapitools/api/UserApiController.java
src/main/java/org/openapitools/configuration/EnumConverterConfiguration.java
src/main/java/org/openapitools/configuration/HomeController.java
src/main/java/org/openapitools/configuration/SpringDocConfiguration.java
src/main/java/org/openapitools/model/AdditionalPropertiesAnyType.java
src/main/java/org/openapitools/model/AdditionalPropertiesArray.java
src/main/java/org/openapitools/model/AdditionalPropertiesBoolean.java
src/main/java/org/openapitools/model/AdditionalPropertiesClass.java
src/main/java/org/openapitools/model/AdditionalPropertiesInteger.java
src/main/java/org/openapitools/model/AdditionalPropertiesNumber.java
src/main/java/org/openapitools/model/AdditionalPropertiesObject.java
src/main/java/org/openapitools/model/AdditionalPropertiesString.java
src/main/java/org/openapitools/model/Animal.java
src/main/java/org/openapitools/model/ArrayOfArrayOfNumberOnly.java
src/main/java/org/openapitools/model/ArrayOfNumberOnly.java
src/main/java/org/openapitools/model/ArrayTest.java
src/main/java/org/openapitools/model/BigCat.java
src/main/java/org/openapitools/model/BigCatAllOf.java
src/main/java/org/openapitools/model/Capitalization.java
src/main/java/org/openapitools/model/Cat.java
src/main/java/org/openapitools/model/CatAllOf.java
src/main/java/org/openapitools/model/Category.java
src/main/java/org/openapitools/model/ClassModel.java
src/main/java/org/openapitools/model/Client.java
src/main/java/org/openapitools/model/Dog.java
src/main/java/org/openapitools/model/DogAllOf.java
src/main/java/org/openapitools/model/EnumArrays.java
src/main/java/org/openapitools/model/EnumClass.java
src/main/java/org/openapitools/model/EnumTest.java
src/main/java/org/openapitools/model/File.java
src/main/java/org/openapitools/model/FileSchemaTestClass.java
src/main/java/org/openapitools/model/FormatTest.java
src/main/java/org/openapitools/model/HasOnlyReadOnly.java
src/main/java/org/openapitools/model/MapTest.java
src/main/java/org/openapitools/model/MixedPropertiesAndAdditionalPropertiesClass.java
src/main/java/org/openapitools/model/Model200Response.java
src/main/java/org/openapitools/model/ModelApiResponse.java
src/main/java/org/openapitools/model/ModelList.java
src/main/java/org/openapitools/model/ModelReturn.java
src/main/java/org/openapitools/model/Name.java
src/main/java/org/openapitools/model/NumberOnly.java
src/main/java/org/openapitools/model/Order.java
src/main/java/org/openapitools/model/OuterComposite.java
src/main/java/org/openapitools/model/OuterEnum.java
src/main/java/org/openapitools/model/Pet.java
src/main/java/org/openapitools/model/ReadOnlyFirst.java
src/main/java/org/openapitools/model/SpecialModelName.java
src/main/java/org/openapitools/model/Tag.java
src/main/java/org/openapitools/model/TypeHolderDefault.java
src/main/java/org/openapitools/model/TypeHolderExample.java
src/main/java/org/openapitools/model/User.java
src/main/java/org/openapitools/model/XmlItem.java
src/main/resources/application.properties
src/main/resources/openapi.yaml
src/test/java/org/openapitools/OpenApiGeneratorApplicationTests.java

View File

@ -1,21 +0,0 @@
# OpenAPI generated server
Spring Boot Server
## Overview
This server was generated by the [OpenAPI Generator](https://openapi-generator.tech) project.
By using the [OpenAPI-Spec](https://openapis.org), you can easily generate a server stub.
This is an example of building a OpenAPI-enabled server in Java using the SpringBoot framework.
The underlying library integrating OpenAPI to Spring Boot is [springdoc](https://springdoc.org).
Springdoc will generate an OpenAPI v3 specification based on the generated Controller and Model classes.
The specification is available to download using the following url:
http://localhost:80/v3/api-docs/
Start your server as a simple java application
You can view the api documentation in swagger-ui by pointing to
http://localhost:80/swagger-ui.html
Change default port value in application.properties

Some files were not shown because too many files have changed in this diff Show More