Add new option allArgConstructor for java client, spring generators (#18538)

* allArgConstructor for java

* Remove leftover from builder pattern branch

* Rename generateConstructorWithAllArgs and use x- in vendorExtensions

* Test issue #18340

* Add evidences for allVars issue (#18340)

* remove eol

* update doc

---------

Co-authored-by: jpfinne <jeanpaul@finne.be>
This commit is contained in:
William Cheng 2024-05-01 18:10:35 +08:00 committed by GitHub
parent 98d026118c
commit 2a1b4f90df
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
565 changed files with 1715 additions and 1869 deletions

View File

@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
useJakartaEe: true
generateConstructorWithAllArgs: true

View File

@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
containerDefaultToNull: true
generateConstructorWithAllArgs: true

View File

@ -11,3 +11,4 @@ additionalProperties:
useBeanValidation: true
withXml: true
hideGenerationTimestamp: "true"
generateConstructorWithAllArgs: true

View File

@ -8,3 +8,4 @@ additionalProperties:
hideGenerationTimestamp: "true"
java8: true
delegatePattern: "true"
generateConstructorWithAllArgs: true

View File

@ -7,3 +7,4 @@ additionalProperties:
artifactId: springboot-lombok-data
hideGenerationTimestamp: "true"
additionalModelTypeAnnotations: "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor"
generateConstructorWithAllArgs: true

View File

@ -39,6 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springfox**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|

View File

@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| ||
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|helidonVersion|Helidon version for generated code| |3.0.1|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

View File

@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|fullProject|If set to true, it will generate all files; if set to false, it will only generate API files. If unspecified, the behavior depends on whether a project exists or not: if it does not, same as true; if it does, same as false. Note that test files are never overwritten.| ||
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProject|Whether to generate gradle project instead of maven.| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|helidonVersion|Helidon version for generated code| |3.0.1|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -50,6 +50,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateOperationOnlyForFirstTag|When false, the operation method will be duplicated in each of the tags if multiple tags are assigned to this operation. If true, each operation will be generated only once in the first assigned tag.| |false|
|generateSwaggerAnnotations|Specify if you want to generate swagger annotations and which version|<dl><dt>**swagger2**</dt><dd>Use io.swagger.core.v3:swagger-annotations for annotating operations and schemas</dd><dt>**true**</dt><dd>Equivalent to &quot;swagger2&quot;</dd><dt>**false**</dt><dd>Do not generate swagger annotations</dd><dt>**swagger1**</dt><dd>Use io.swagger:swagger-annotations for annotating operations and schemas</dd></dl>|false|
|groupId|groupId in generated pom.xml| |org.openapitools|

View File

@ -45,6 +45,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateControllerAsAbstract|Generate an abstract class for controller to be extended. (apiPackage is then used for the abstract class, and controllerPackage is used for implementation that extends it.)| |false|
|generateControllerFromExamples|Generate the implementation of controller and tests from parameter and return examples that will verify that the api works as desired (for testing)| |false|
|generateOperationOnlyForFirstTag|When false, the operation method will be duplicated in each of the tags if multiple tags are assigned to this operation. If true, each operation will be generated only once in the first assigned tag.| |true|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -43,6 +43,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|eurekaUri|Eureka URI| |null|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |com.prokarma|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -44,6 +44,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|handleExceptions|Add a 'throw exception' to each controller function. Add also a custom error handler where you can put your custom logic| |true|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -49,6 +49,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|errorObjectType|Error Object type. (This option is for okhttp-gson only)| |null|
|generateClientAsBean|For resttemplate, configure whether to create `ApiClient.java` and Apis clients as bean (with `@Component` annotation).| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|gradleProperties|Append additional Gradle properties to the gradle.properties file| |null|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

View File

@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateBuilders|Whether to generate builders for models.| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|generateNonSpringApplication|Generate non-Spring application| |false|
|generateOperationBody|Generate fully functional operation bodies| |false|

View File

@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|generateNonSpringApplication|Generate non-Spring application| |false|
|generateSpringApplication|Generate Spring application| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

View File

@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generateJbossDeploymentDescriptor|Generate Jboss Deployment Descriptor| |false|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

View File

@ -42,6 +42,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateBuilders|Whether to generate builders for models.| |false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatePom|Whether to generate pom.xml if the file does not already exist.| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

View File

@ -48,6 +48,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|documentationProvider|Select the OpenAPI documentation provider.|<dl><dt>**none**</dt><dd>Do not publish an OpenAPI specification.</dd><dt>**source**</dt><dd>Publish the original input OpenAPI specification.</dd><dt>**springfox**</dt><dd>Generate an OpenAPI 2 (fka Swagger RESTful API Documentation Specification) specification using SpringFox 2.x. Deprecated (for removal); use springdoc instead.</dd><dt>**springdoc**</dt><dd>Generate an OpenAPI 3 specification using SpringDoc.</dd></dl>|springdoc|
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
|enumUnknownDefaultCase|If the server adds new enum cases, that are unknown by an old spec/client, the client will fail to parse the network response.With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the server sends an enum case that is not known by the client/spec, they can safely fallback to this case.|<dl><dt>**false**</dt><dd>No changes to the enum's are made, this is the default option.</dd><dt>**true**</dt><dd>With this option enabled, each enum will have a new case, 'unknown_default_open_api', so that when the enum case sent by the server is not known by the client/spec, can safely be decoded to this case.</dd></dl>|false|
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
|groupId|groupId in generated pom.xml| |org.openapitools|
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|

View File

@ -61,6 +61,7 @@ import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import static org.openapitools.codegen.utils.CamelizeOption.*;
import static org.openapitools.codegen.utils.OnceLogger.once;
import static org.openapitools.codegen.utils.StringUtils.*;
public abstract class AbstractJavaCodegen extends DefaultCodegen implements CodegenConfig,
@ -93,6 +94,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
public static final String USE_ONE_OF_INTERFACES = "useOneOfInterfaces";
public static final String LOMBOK = "lombok";
public static final String DEFAULT_TEST_FOLDER = "${project.build.directory}/generated-test-sources/openapi";
public static final String GENERATE_CONSTRUCTOR_WITH_ALL_ARGS = "generateConstructorWithAllArgs";
protected String dateLibrary = "java8";
protected boolean supportAsync = false;
@ -142,7 +144,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
protected boolean camelCaseDollarSign = false;
protected boolean useJakartaEe = false;
protected boolean containerDefaultToNull = false;
protected boolean generateConstructorWithAllArgs = false;
private Map<String, String> schemaKeyToModelNameCache = new HashMap<>();
public AbstractJavaCodegen() {
@ -282,6 +284,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
cliOptions.add(CliOption.newBoolean(CAMEL_CASE_DOLLAR_SIGN, "Fix camelCase when starting with $ sign. when true : $Value when false : $value"));
cliOptions.add(CliOption.newBoolean(USE_JAKARTA_EE, "whether to use Jakarta EE namespace instead of javax"));
cliOptions.add(CliOption.newBoolean(CONTAINER_DEFAULT_TO_NULL, "Set containers (array, set, map) default to null"));
cliOptions.add(CliOption.newBoolean(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, "whether to generate a constructor for all arguments").defaultValue(Boolean.FALSE.toString()));
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_GROUP_ID, CodegenConstants.PARENT_GROUP_ID_DESC));
cliOptions.add(CliOption.newString(CodegenConstants.PARENT_ARTIFACT_ID, CodegenConstants.PARENT_ARTIFACT_ID_DESC));
@ -355,6 +358,10 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
additionalProperties.put(ANNOTATION_LIBRARY, AnnotationLibrary.NONE);
}
if (additionalProperties.containsKey(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS)) {
this.setgenerateConstructorWithAllArgs(convertPropertyToBoolean(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS));
}
writePropertyBack(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, generateConstructorWithAllArgs);
if (StringUtils.isEmpty(System.getenv("JAVA_POST_PROCESS_FILE"))) {
LOGGER.info("Environment variable JAVA_POST_PROCESS_FILE not defined so the Java code may not be properly formatted. To define it, try 'export JAVA_POST_PROCESS_FILE=\"/usr/local/bin/clang-format -i\"' (Linux/Mac)");
@ -677,11 +684,26 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
});
}
public void setgenerateConstructorWithAllArgs(boolean aValue) {
this.generateConstructorWithAllArgs = aValue;
}
public boolean isgenerateConstructorWithAllArgs() {
return generateConstructorWithAllArgs;
}
/**
* Analyse and post process all Models.
* @param objs the models map.
* @return the processed models map.
**/
@Override
public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs) {
objs = super.postProcessAllModels(objs);
objs = super.updateAllModels(objs);
Map<String, CodegenModel> allModels = getAllModels(objs);
if (!additionalModelTypeAnnotations.isEmpty()) {
for (String modelName : objs.keySet()) {
Map<String, Object> models = objs.get(modelName);
@ -703,9 +725,101 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
}
}
/*
Add parentVars and parentRequiredVars to every Model which has a parent.
Add isInherited to every model which has children.
This allows
the generation of fluent setter methods for inherited properties
the generation of all arg constructors
ps: This code was specific to SpringCodeGen and now is available to all java generators.
*/
for (ModelsMap modelsAttrs : objs.values()) {
for (ModelMap mo : modelsAttrs.getModels()) {
CodegenModel codegenModel = mo.getModel();
Set<String> inheritedImports = new HashSet<>();
Map<String, CodegenProperty> propertyHash = new HashMap<>(codegenModel.vars.size());
for (final CodegenProperty property : codegenModel.vars) {
propertyHash.put(property.name, property);
}
List<CodegenModel> parentModelList = getParentModelList(codegenModel);
for (CodegenModel parentCodegenModel: parentModelList) {
for (final CodegenProperty property : parentCodegenModel.vars) {
// helper list of parentVars simplifies templating
if (!propertyHash.containsKey(property.name)) {
propertyHash.put(property.name, property);
final CodegenProperty parentVar = property.clone();
parentVar.isInherited = true;
LOGGER.info("adding parent variable {} to {}", property.name, codegenModel.name);
codegenModel.parentVars.add(parentVar);
Set<String> imports = parentVar.getImports(true, this.importBaseType, generatorMetadata.getFeatureSet()).stream().filter(Objects::nonNull).collect(Collectors.toSet());
for (String imp : imports) {
// Avoid dupes
if (!codegenModel.getImports().contains(imp)) {
inheritedImports.add(imp);
codegenModel.getImports().add(imp);
}
}
}
}
}
if (codegenModel.getParentModel() != null) {
codegenModel.parentRequiredVars = new ArrayList<>(codegenModel.getParentModel().requiredVars);
}
// There must be a better way ...
for (String imp: inheritedImports) {
String qimp = importMapping().get(imp);
if (qimp != null) {
Map<String,String> toAdd = new HashMap<>();
toAdd.put("import", qimp);
modelsAttrs.getImports().add(toAdd);
}
}
}
}
if (isgenerateConstructorWithAllArgs()) {
// conditionally force the generation of all args constructor.
for (CodegenModel cm : allModels.values()) {
if (isConstructorWithAllArgsAllowed(cm)) {
cm.vendorExtensions.put("x-java-all-args-constructor", true);
List<Object> constructorArgs = new ArrayList<>();
// vendorExtensions.x-java-all-args-constructor-vars should be equivalent to allVars
// but it is not reliable when openapiNormalizer.REFACTOR_ALLOF_WITH_PROPERTIES_ONLY is disabled
cm.vendorExtensions.put("x-java-all-args-constructor-vars", constructorArgs);
if (cm.vars.size() + cm.parentVars.size() != cm.allVars.size()) {
once(LOGGER).warn("Unexpected allVars for {} expecting:{} vars. actual:{} vars", cm.name, cm.vars.size() + cm.parentVars.size(), cm.allVars.size());
}
constructorArgs.addAll(cm.vars);
constructorArgs.addAll(cm.parentVars);
}
}
}
return objs;
}
private List<CodegenModel> getParentModelList(CodegenModel codegenModel) {
CodegenModel parentCodegenModel = codegenModel.parentModel;
List<CodegenModel> parentModelList = new ArrayList<>();
while (parentCodegenModel != null) {
parentModelList.add(parentCodegenModel);
parentCodegenModel = parentCodegenModel.parentModel;
}
return parentModelList;
}
/**
* trigger the generation of all arguments constructor or not.
* It avoids generating the same constructor twice.
*
* @return true if an allArgConstructor must be generated
*/
protected boolean isConstructorWithAllArgsAllowed(CodegenModel codegenModel) {
// implementation detail: allVars is not reliable if openapiNormalizer.REFACTOR_ALLOF_WITH_PROPERTIES_ONLY is disabled
return (this.generateConstructorWithAllArgs &&
(!codegenModel.vars.isEmpty() || codegenModel.parentVars.isEmpty()));
}
private void sanitizeConfig() {
// Sanitize any config options here. We also have to update the additionalProperties because
// the whole additionalProperties object is injected into the main object passed to the mustache layer

View File

@ -39,7 +39,6 @@ import org.slf4j.LoggerFactory;
import java.io.File;
import java.util.*;
import java.util.function.Predicate;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@ -1146,6 +1145,15 @@ public class JavaClientCodegen extends AbstractJavaCodegen
return objs;
}
@Override
protected boolean isConstructorWithAllArgsAllowed(CodegenModel codegenModel) {
// implementation detail: allVars is not reliable if openapiNormalizer.REFACTOR_ALLOF_WITH_PROPERTIES_ONLY is disabled
if (codegenModel.readOnlyVars.size() != codegenModel.vars.size() + codegenModel.parentVars.size()) {
return super.isConstructorWithAllArgsAllowed(codegenModel);
}
return false;
}
public void setUseOneOfDiscriminatorLookup(boolean useOneOfDiscriminatorLookup) {
this.useOneOfDiscriminatorLookup = useOneOfDiscriminatorLookup;
}

View File

@ -1168,66 +1168,19 @@ public class SpringCodegen extends AbstractJavaCodegen
return codegenModel;
}
/**
* Analyse and post process all Models.
* Add parentVars to every Model which has a parent. This allows to generate
* fluent setter methods for inherited properties.
* @param objs the models map.
* @return the processed models map.
*/
@Override
public Map<String, ModelsMap> postProcessAllModels(Map<String, ModelsMap> objs) {
objs = super.postProcessAllModels(objs);
objs = super.updateAllModels(objs);
for (ModelsMap modelsAttrs : objs.values()) {
for (ModelMap mo : modelsAttrs.getModels()) {
CodegenModel codegenModel = mo.getModel();
Set<String> inheritedImports = new HashSet<>();
Map<String, CodegenProperty> propertyHash = new HashMap<>(codegenModel.vars.size());
for (final CodegenProperty property : codegenModel.vars) {
propertyHash.put(property.name, property);
}
CodegenModel parentCodegenModel = codegenModel.parentModel;
while (parentCodegenModel != null) {
for (final CodegenProperty property : parentCodegenModel.vars) {
// helper list of parentVars simplifies templating
if (!propertyHash.containsKey(property.name)) {
propertyHash.put(property.name, property);
final CodegenProperty parentVar = property.clone();
parentVar.isInherited = true;
LOGGER.info("adding parent variable {}", property.name);
codegenModel.parentVars.add(parentVar);
Set<String> imports = parentVar.getImports(true, this.importBaseType, generatorMetadata.getFeatureSet()).stream().filter(Objects::nonNull).collect(Collectors.toSet());
for (String imp: imports) {
// Avoid dupes
if (!codegenModel.getImports().contains(imp)) {
inheritedImports.add(imp);
codegenModel.getImports().add(imp);
}
}
}
}
parentCodegenModel = parentCodegenModel.getParentModel();
}
if (codegenModel.getParentModel() != null) {
codegenModel.parentRequiredVars = new ArrayList<>(codegenModel.getParentModel().requiredVars);
}
// There must be a better way ...
for (String imp: inheritedImports) {
String qimp = importMapping().get(imp);
if (qimp != null) {
Map<String,String> toAdd = new HashMap<>();
toAdd.put("import", qimp);
modelsAttrs.getImports().add(toAdd);
}
}
}
protected boolean isConstructorWithAllArgsAllowed(CodegenModel codegenModel) {
if (lombokAnnotations != null && lombokAnnotations.containsKey("allArgsConstructor")) {
// constructor generated by lombok
return false;
}
return objs;
if ((!generatedConstructorWithRequiredArgs && !codegenModel.vars.isEmpty() )
|| !codegenModel.optionalVars.isEmpty()) {
return super.isConstructorWithAllArgsAllowed(codegenModel);
}
return false;
}
/*
* Add dynamic imports based on the parameters and vendor extensions of an operation.
* The imports are expanded by the mustache {{import}} tag available to model and api

View File

@ -83,18 +83,18 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();
{{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();
{{/isContainer}}
{{^isContainer}}
private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
{{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{^isContainer}}
{{#isDiscriminator}}protected{{/isDiscriminator}}{{^isDiscriminator}}private{{/isDiscriminator}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{#hasChildren}}protected{{/hasChildren}}{{^hasChildren}}private{{/hasChildren}} {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
@ -114,7 +114,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
{{#vendorExtensions.x-has-readonly-properties}}
{{^withXml}}
/**
* Constructor with only readonly parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}}
*/
{{#jsonb}}@JsonbCreator{{/jsonb}}{{#jackson}}@JsonCreator{{/jackson}}
public {{classname}}(
{{#readOnlyVars}}
@ -128,8 +130,22 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
{{/withXml}}
{{/vendorExtensions.x-has-readonly-properties}}
{{#vars}}
{{#vendorExtensions.x-java-all-args-constructor}}
/**
* Constructor with all args parameters
*/
public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{#jsonb}}@JsonbProperty(value = "{{baseName}}"{{^required}}, nullable = true{{/required}}){{/jsonb}}{{#jackson}}@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}}){{/jackson}} {{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) {
{{#parent}}
super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}});
{{/parent}}
{{#vars}}
this.{{name}} = {{#vendorExtensions.x-is-jackson-optional-nullable}}{{name}} == null ? JsonNullable.<{{{datatypeWithEnum}}}>undefined() : JsonNullable.of({{name}}){{/vendorExtensions.x-is-jackson-optional-nullable}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{name}}{{/vendorExtensions.x-is-jackson-optional-nullable}};
{{/vars}}
}
{{/vendorExtensions.x-java-all-args-constructor}}
{{#vars}}
{{^isReadOnly}}
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
{{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}}
@ -279,7 +295,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/vars}}
{{#parent}}
{{#allVars}}
{{#readWriteVars}}
{{#isOverridden}}
@Override
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
@ -293,7 +309,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
}
{{/isOverridden}}
{{/allVars}}
{{/readWriteVars}}
{{/parent}}
@Override
public boolean equals(Object o) {

View File

@ -105,7 +105,7 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{/lombok.NoArgsConstructor}}
/**
* Constructor with only required parameters
* Constructor with only required parameters{{#generateConstructorWithAllArgs}}{{^vendorExtensions.x-java-all-args-constructor}} and all parameters{{/vendorExtensions.x-java-all-args-constructor}}{{/generateConstructorWithAllArgs}}
*/
public {{classname}}({{#requiredVars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/requiredVars}}) {
{{#parent}}
@ -125,6 +125,25 @@ public class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}{{^parent}}
{{/hasRequired}}
{{/generatedConstructorWithRequiredArgs}}
{{/lombok.RequiredArgsConstructor}}
{{#vendorExtensions.x-java-all-args-constructor}}
/**
* Constructor with all args parameters
*/
public {{classname}}({{#vendorExtensions.x-java-all-args-constructor-vars}}{{{datatypeWithEnum}}} {{name}}{{^-last}}, {{/-last}}{{/vendorExtensions.x-java-all-args-constructor-vars}}) {
{{#parent}}
super({{#parentVars}}{{name}}{{^-last}}, {{/-last}}{{/parentVars}});
{{/parent}}
{{#vars}}
{{#openApiNullable}}
this.{{name}} = {{#isNullable}}JsonNullable.of({{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}Optional.ofNullable({{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}}{{name}}{{#isNullable}}){{/isNullable}}{{#useOptional}}{{^required}}{{^isNullable}}{{^isContainer}}){{/isContainer}}{{/isNullable}}{{/required}}{{/useOptional}};
{{/openApiNullable}}
{{^openApiNullable}}
this.{{name}} = {{name}};
{{/openApiNullable}}
{{/vars}}
}
{{/vendorExtensions.x-java-all-args-constructor}}
{{/lombok.Data}}
{{#vars}}
{{^lombok.Data}}

View File

@ -40,6 +40,7 @@ import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.parser.core.models.ParseOptions;
import org.openapitools.codegen.config.CodegenConfigurator;
import org.openapitools.codegen.config.GlobalSettings;
import org.openapitools.codegen.languages.SpringCodegen;
import org.openapitools.codegen.model.ModelMap;
import org.openapitools.codegen.model.ModelsMap;
import org.openapitools.codegen.templating.mustache.*;
@ -4913,4 +4914,35 @@ public class DefaultCodegenTest {
Assert.assertEquals(co.operationId, "newPetGet");
}
@Test
public void testAllVars_issue_18340() {
final OpenAPI openAPI = TestUtils.parseFlattenSpec("src/test/resources/3_0/spring/issue_18340.yaml");
new OpenAPINormalizer(openAPI, Map.of("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", " true"))
.normalize();
Schema catModel = ModelUtils.getSchema(openAPI, "Cat");
Schema cat2Model = ModelUtils.getSchema(openAPI, "Cat2");
DefaultCodegen defaultCodegen = new DefaultCodegen();
defaultCodegen.setOpenAPI(openAPI);
CodegenModel defaultCat = defaultCodegen.fromModel("Cat", catModel);
assertThat(getNames(defaultCat.allVars)).isEqualTo(List.of("name", "petType"));
// same model gives an invalid var when using SpringCodegen. name is missing
SpringCodegen springCodegen = new SpringCodegen();
springCodegen.setOpenAPI(openAPI);
CodegenModel springCat = springCodegen.fromModel("Cat", catModel);
assertThat(getNames(springCat.allVars)).isEqualTo(List.of("petType")); // should be name,petType
CodegenModel springCat2 = springCodegen.fromModel("Cat2", cat2Model);
assertThat(getNames(springCat2.allVars)).isEqualTo(List.of("petType", "name"));
// Prove that supportsInheritance is the culprit
SpringCodegen springCodegenNoSupportInheritance = new SpringCodegen() {
{
this.supportsInheritance = false;
}
};
springCodegenNoSupportInheritance.setOpenAPI(openAPI);
CodegenModel springCatNoSupportInheritance = springCodegenNoSupportInheritance.fromModel("Cat", catModel);
assertThat(getNames(springCatNoSupportInheritance.allVars)).isEqualTo(List.of("name", "petType"));
}
}

View File

@ -59,6 +59,7 @@ import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Optional;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.regex.Matcher;
@ -1899,38 +1900,6 @@ public class JavaClientCodegenTest {
.containsWithNameAndAttributes("JsonbProperty", ImmutableMap.of("value", "\"c\""));
}
@Test
public void testMicroprofileGenerateCorrectJacksonGenerator_issue18336() throws Exception {
Map<String, Object> properties = new HashMap<>();
properties.put(JavaClientCodegen.MICROPROFILE_REST_CLIENT_VERSION, "3.0");
properties.put(CodegenConstants.SERIALIZATION_LIBRARY, JavaClientCodegen.SERIALIZATION_LIBRARY_JACKSON);
File output = Files.createTempDirectory("test").toFile();
output.deleteOnExit();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setAdditionalProperties(properties)
.setGeneratorName("java")
.setLibrary(JavaClientCodegen.MICROPROFILE)
.setInputSpec("src/test/resources/bugs/issue_18336.yaml")
.setOutputDir(output.getAbsolutePath().replace("\\", "/"));
final ClientOptInput clientOptInput = configurator.toClientOptInput();
DefaultGenerator generator = new DefaultGenerator();
Map<String, File> files = generator.opts(clientOptInput).generate().stream()
.collect(Collectors.toMap(File::getName, Function.identity()));
JavaFileAssert.assertThat(files.get("Pet.java"))
.assertConstructor("String")
.assertConstructorAnnotations()
.containsWithName("JsonCreator")
.toConstructor()
.hasParameter("name")
.assertParameterAnnotations()
.containsWithNameAndAttributes("JsonProperty", ImmutableMap.of("value", "JSON_PROPERTY_NAME", "required", "true"));
}
@Test
public void testJavaClientDefaultValues_issueNoNumber() throws Exception {
Map<String, Object> properties = new HashMap<>();
@ -2394,6 +2363,16 @@ public class JavaClientCodegenTest {
final String pathToSpecification,
final String library,
final Map<String, Object> properties
) {
return generateFromContract(pathToSpecification, library, properties, configurator -> {});
}
@SneakyThrows
private static Map<String, File> generateFromContract(
final String pathToSpecification,
final String library,
final Map<String, Object> properties,
final Consumer<CodegenConfigurator> consumer
) {
final File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
@ -2404,7 +2383,7 @@ public class JavaClientCodegenTest {
.setAdditionalProperties(properties)
.setInputSpec(pathToSpecification)
.setOutputDir(output.getAbsolutePath());
consumer.accept(configurator);
final ClientOptInput clientOptInput = configurator.toClientOptInput();
final DefaultGenerator generator = new DefaultGenerator();
return generator.opts(clientOptInput).generate().stream()
@ -3178,4 +3157,65 @@ public class JavaClientCodegenTest {
Path petApi = Paths.get(output + "/src/main/java/xyz/abcdef/api/DepartmentApi.java");
TestUtils.assertFileContains(petApi, "if (filter != null) {");
}
@Test
public void generateAllArgsConstructor() {
Map<String, File> files = generateFromContract("src/test/resources/3_0/java/all_args_constructor.yaml", JavaClientCodegen.RESTTEMPLATE,
Map.of(AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE),
codegenConfigurator -> codegenConfigurator.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "false"));
JavaFileAssert.assertThat(files.get("Pet.java"))
.fileContains("protected String name", "protected String type")
.assertConstructor("String")
.hasParameter("type").toConstructor()
.toFileAssert()
.assertConstructor("LocalDate", "String", "String")
.hasParameter("dateOfBirth").toConstructor()
.hasParameter("name").toConstructor()
.hasParameter("type").toConstructor();
JavaFileAssert.assertThat(files.get("Cat.java"))
.assertConstructor("Integer", "String", "LocalDate", "String", "String");
// test readonly constructor
JavaFileAssert.assertThat(files.get("Page.java"))
.assertConstructor("Integer")
.toFileAssert()
.fileContains("Constructor with only readonly parameters and all parameters");
JavaFileAssert.assertThat(files.get("PageOfPets.java"))
.assertConstructor("Integer")
.hasParameter("count").toConstructor()
.toFileAssert()
.assertConstructor("Integer", "List<Pet>")
.hasParameter("count").toConstructor()
.hasParameter("_list").toConstructor();
}
@Test
public void generateAllArgsConstructor_REFACTOR_ALLOF_WITH_PROPERTIES_ONLY() {
// try the generation with some additional OpenAPINormalizers
Map<String, File> files = generateFromContract("src/test/resources/3_0/java/all_args_constructor.yaml", JavaClientCodegen.RESTTEMPLATE,
Map.of(AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE),
codegenConfigurator -> codegenConfigurator.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true"));
JavaFileAssert.assertThat(files.get("Pet.java"))
.fileContains("protected String name", "protected String type")
.assertConstructor("String")
.hasParameter("type").toConstructor()
.toFileAssert()
.assertConstructor("LocalDate", "String", "String")
.hasParameter("dateOfBirth").toConstructor()
.hasParameter("name").toConstructor()
.hasParameter("type").toConstructor();
JavaFileAssert.assertThat(files.get("PageOfPets.java"))
.assertConstructor("Integer", "List<Pet>")
.hasParameter("count").toConstructor()
.hasParameter("_list").toConstructor()
.toFileAssert()
.assertConstructor("Integer")
.hasParameter("count").toConstructor();
JavaFileAssert.assertThat(files.get("Cat.java"))
.assertConstructor("Integer", "String", "LocalDate", "String", "String");
}
}

View File

@ -21,6 +21,7 @@ import static java.util.stream.Collectors.groupingBy;
import static org.assertj.core.api.Assertions.assertThat;
import static org.openapitools.codegen.TestUtils.assertFileContains;
import static org.openapitools.codegen.TestUtils.assertFileNotContains;
import static org.openapitools.codegen.languages.AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS;
import static org.openapitools.codegen.languages.SpringCodegen.ASYNC;
import static org.openapitools.codegen.languages.SpringCodegen.DELEGATE_PATTERN;
import static org.openapitools.codegen.languages.SpringCodegen.DocumentationProvider;
@ -2753,7 +2754,8 @@ public class SpringCodegenTest {
@Test
public void shouldGenerateConstructorWithOnlyRequiredParameters() throws IOException {
final Map<String, File> output = generateFromContract("src/test/resources/3_0/spring/issue_9789.yml", SPRING_BOOT);
final Map<String, File> output = generateFromContract("src/test/resources/3_0/spring/issue_9789.yml", SPRING_BOOT,
Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, "false"));
JavaFileAssert.assertThat(output.get("ObjectWithNoRequiredParameter.java")).assertNoConstructor("String");
@ -2773,30 +2775,41 @@ public class SpringCodegenTest {
private Map<String, File> generateFromContract(String url, String library) throws IOException {
return generateFromContract(url, library, new HashMap<>());
}
private Map<String, File> generateFromContract(String url, String library, Map<String, Object> additionalProperties) throws IOException {
return generateFromContract(url, library, additionalProperties, codegen -> {});
}
/**
* Generate the contract with additional configuration.
*
* use CodegenConfigurator instead of CodegenConfig for easier configuration like in JavaClientCodeGenTest
*/
private Map<String, File> generateFromContract(String url, String library, Map<String, Object> additionalProperties,
Consumer<CodegenConfigurator> consumer) throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
output.deleteOnExit();
OpenAPI openAPI = new OpenAPIParser()
.readLocation(url, null, new ParseOptions()).getOpenAPI();
SpringCodegen codegen = new SpringCodegen();
final CodegenConfigurator configurator = new CodegenConfigurator()
.setGeneratorName("spring")
.setAdditionalProperties(additionalProperties)
.setValidateSpec(false)
.setInputSpec(url)
.setOutputDir(output.getAbsolutePath());
if (null != library) {
codegen.setLibrary(library);
configurator.setLibrary(library);
}
codegen.setOutputDir(output.getAbsolutePath());
codegen.additionalProperties().putAll(additionalProperties);
ClientOptInput input = new ClientOptInput()
.openAPI(openAPI)
.config(codegen);
consumer.accept(configurator);
ClientOptInput input = configurator.toClientOptInput();
DefaultGenerator generator = new DefaultGenerator();
return generator.opts(input).generate().stream()
.collect(Collectors.toMap(File::getName, Function.identity()));
}
@Test
public void testMappingSubtypesIssue13150() throws IOException {
File output = Files.createTempDirectory("test").toFile().getCanonicalFile();
@ -4518,6 +4531,35 @@ public class SpringCodegenTest {
"@Valid @RequestParam(value = \"additionalMetadata\", required = false) String additionalMetadata");
}
@Test
public void testAllArgsConstructor_16797() throws IOException {
final Map<String, File> output = generateFromContract("src/test/resources/3_0/spring/issue_16797.yaml", SPRING_BOOT,
Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE),
codegen -> codegen.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "false"));
JavaFileAssert.assertThat(output.get("Object4.java"))
.assertConstructor("String", "Type1", "String", "String", "Boolean")
.hasParameter("responseType").toConstructor()
.hasParameter("requestId").toConstructor()
.hasParameter("success").toConstructor()
.hasParameter("pageInfo")
;
}
@Test
public void testAllArgsConstructor_16797_REFACTOR_ALLOF_WITH_PROPERTIES_ONLY() throws IOException {
final Map<String, File> output = generateFromContract("src/test/resources/3_0/spring/issue_16797.yaml", SPRING_BOOT,
Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE),
codegen -> codegen.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", "true"));
JavaFileAssert.assertThat(output.get("Object4.java"))
.assertConstructor("String", "Type1", "String", "String", "Boolean")
.hasParameter("responseType").toConstructor()
.hasParameter("requestId").toConstructor()
.hasParameter("success").toConstructor()
.hasParameter("pageInfo")
;
}
@Test
public void testMultiInheritanceParentRequiredParams_issue16797() throws IOException {
final Map<String, File> output = generateFromContract("src/test/resources/3_0/spring/issue_16797.yaml", SPRING_BOOT);
@ -4548,6 +4590,74 @@ public class SpringCodegenTest {
;
}
@Test
public void testAllArgsConstructor_defaultOrder_15796() throws IOException {
final Map<String, File> output = generateFromContract("src/test/resources/3_0/spring/issue_15796.yaml", SPRING_BOOT,
Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE),
config -> config.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", " true"));
// constructors should as this
//public Poodle(String race, String type) {
// super(race, type);
//}
// and
//public Poodle(String hairType, Integer tails, String race, String name, String type) {
// super(tails, race, name, type);
// this.hairType = hairType;
//}
JavaFileAssert.assertThat(output.get("Poodle.java"))
.assertConstructor("String", "String")
.hasParameter("type").toConstructor()
.hasParameter("race").toConstructor()
.toFileAssert()
.assertConstructor("String", "Integer", "String", "String", "String")
.hasParameter("tails").toConstructor()
.hasParameter("race").toConstructor()
.hasParameter("name").toConstructor()
.hasParameter("type").toConstructor()
.hasParameter("hairType").toConstructor()
;
}
@Test
public void generateAllArgsConstructor() throws IOException {
Map<String, File> files = generateFromContract("src/test/resources/3_0/java/all_args_constructor.yaml", null,
Map.of(AbstractJavaCodegen.GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, Boolean.TRUE),
codegenConfig -> codegenConfig.addOpenapiNormalizer("REFACTOR_ALLOF_WITH_PROPERTIES_ONLY", " true"));
JavaFileAssert.assertThat(files.get("Pet.java"))
.assertConstructor("String")
.hasParameter("type").toConstructor()
.toFileAssert()
.assertConstructor("LocalDate", "String", "String")
.hasParameter("dateOfBirth").toConstructor()
.hasParameter("name").toConstructor()
.hasParameter("type").toConstructor();
JavaFileAssert.assertThat(files.get("Cat.java"))
.assertConstructor("Integer", "String", "LocalDate", "String", "String");
// test required constructor
JavaFileAssert.assertThat(files.get("Page.java"))
.assertConstructor("Integer")
.toFileAssert()
.fileContains("Constructor with only required parameters and all parameters");
JavaFileAssert.assertThat(files.get("PageOfPets.java"))
.assertConstructor("Integer", "List<Pet>")
.hasParameter("count").toConstructor()
.hasParameter("_list").toConstructor()
.toFileAssert()
.assertConstructor("Integer")
.hasParameter("count").toConstructor();
}
@Test
public void allOfDuplicatedProperties() throws IOException {
final Map<String, Object> additionalProperties = new HashMap<>();
Map<String, File> output = generateFromContract("src/test/resources/3_0/allOfDuplicatedProperties.yaml", SPRING_BOOT, Map.of(GENERATE_CONSTRUCTOR_WITH_ALL_ARGS, true));
JavaFileAssert.assertThat(output.get("ModelC.java"))
.assertConstructor("String", "Integer", "Integer", "String", "String");
}
@Test
public void testLombokAnnotations() throws IOException {
final Map<String, Object> additionalProperties = new HashMap<>();

View File

@ -0,0 +1,125 @@
openapi: 3.0.0
info:
title: My service
description: My service
version: 1.0.0
servers:
- url: 'https://localhost'
paths:
/generator/test:
post:
summary: Get test generator models
responses:
200:
description: returns Page of Pets
content:
application/json:
schema:
$ref: '#/components/schemas/PageOfPets'
components:
schemas:
Page:
properties:
count:
# test readonly and required
type: integer
readOnly: true
required:
- count
# test composition
PageOfPets:
allOf:
- $ref: '#/components/schemas/Page'
- type: object
properties:
list:
type: array
items:
$ref: '#/components/schemas/Pet'
# test inheritance
Pet:
type: object
required:
- type
properties:
dateOfBirth:
type: string
format: date
name:
type: string
type:
type: string
readOnly: true
discriminator:
propertyName: type
mapping:
CAT: '#/components/schemas/Cat'
DOG: '#/components/schemas/Dog'
Cat:
type: object
allOf:
- $ref: '#/components/schemas/Pet'
required:
- race
properties:
paws:
type: integer
race:
type: string
discriminator:
propertyName: race
mapping:
PERSIAN: '#/components/schemas/Persian'
MAINE_COON: '#/components/schemas/MaineCoon'
Dog:
type: object
allOf:
- $ref: '#/components/schemas/Pet'
required:
- race
properties:
tails:
type: integer
race:
type: string
discriminator:
propertyName: race
mapping:
POODLE: '#/components/schemas/Poodle'
LABRADOR: '#/components/schemas/Labrador'
Poodle:
type: object
allOf:
- $ref: '#/components/schemas/Dog'
properties:
hairType:
type: string
required:
- race
Labrador:
type: object
allOf:
- $ref: '#/components/schemas/Dog'
properties:
hairColor:
type: string
required:
- race
Persian:
type: object
allOf:
- $ref: '#/components/schemas/Cat'
properties:
hairType:
type: string
required:
- race
MaineCoon:
type: object
allOf:
- $ref: '#/components/schemas/Cat'
properties:
hairColor:
type: string
required:
- race

View File

@ -0,0 +1,35 @@
openapi: 3.0.1
info:
title: OpenAPI definition
version: '1.0'
paths:
/pets:
get:
summary: Get all pets
operationId: getAllPets
responses:
default:
description: ok
components:
schemas:
Pet:
type: object
properties:
petType:
type: string
discriminator:
propertyName: petType
Cat:
allOf:
- $ref: '#/components/schemas/Pet'
type: object
properties:
name:
type: string
Cat2:
allOf:
- $ref: '#/components/schemas/Pet'
- type: object
properties:
name:
type: string

View File

@ -69,7 +69,6 @@ public class Bird {
this.size = size;
}
public Bird color(String color) {
this.color = color;

View File

@ -69,7 +69,6 @@ public class Category {
this.id = id;
}
public Category name(String name) {
this.name = name;

View File

@ -79,7 +79,6 @@ public class DataQuery extends Query {
this.suffix = suffix;
}
public DataQuery text(String text) {
this.text = text;
@ -105,7 +104,6 @@ public class DataQuery extends Query {
this.text = text;
}
public DataQuery date(OffsetDateTime date) {
this.date = date;

View File

@ -146,7 +146,6 @@ public class DefaultValue {
this.arrayStringEnumRefDefault = arrayStringEnumRefDefault;
}
public DefaultValue arrayStringEnumDefault(List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault) {
this.arrayStringEnumDefault = arrayStringEnumDefault;
@ -180,7 +179,6 @@ public class DefaultValue {
this.arrayStringEnumDefault = arrayStringEnumDefault;
}
public DefaultValue arrayStringDefault(List<String> arrayStringDefault) {
this.arrayStringDefault = arrayStringDefault;
@ -214,7 +212,6 @@ public class DefaultValue {
this.arrayStringDefault = arrayStringDefault;
}
public DefaultValue arrayIntegerDefault(List<Integer> arrayIntegerDefault) {
this.arrayIntegerDefault = arrayIntegerDefault;
@ -248,7 +245,6 @@ public class DefaultValue {
this.arrayIntegerDefault = arrayIntegerDefault;
}
public DefaultValue arrayString(List<String> arrayString) {
this.arrayString = arrayString;
@ -282,7 +278,6 @@ public class DefaultValue {
this.arrayString = arrayString;
}
public DefaultValue arrayStringNullable(List<String> arrayStringNullable) {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);
@ -328,7 +323,6 @@ public class DefaultValue {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);
}
public DefaultValue arrayStringExtensionNullable(List<String> arrayStringExtensionNullable) {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);
@ -374,7 +368,6 @@ public class DefaultValue {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);
}
public DefaultValue stringNullable(String stringNullable) {
this.stringNullable = JsonNullable.<String>of(stringNullable);

View File

@ -74,7 +74,6 @@ public class NumberPropertiesOnly {
this.number = number;
}
public NumberPropertiesOnly _float(Float _float) {
this._float = _float;
@ -100,7 +99,6 @@ public class NumberPropertiesOnly {
this._float = _float;
}
public NumberPropertiesOnly _double(Double _double) {
this._double = _double;

View File

@ -127,7 +127,6 @@ public class Pet {
this.id = id;
}
public Pet name(String name) {
this.name = name;
@ -153,7 +152,6 @@ public class Pet {
this.name = name;
}
public Pet category(Category category) {
this.category = category;
@ -179,7 +177,6 @@ public class Pet {
this.category = category;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
@ -213,7 +210,6 @@ public class Pet {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
@ -247,7 +243,6 @@ public class Pet {
this.tags = tags;
}
public Pet status(StatusEnum status) {
this.status = status;

View File

@ -39,7 +39,7 @@ import java.util.StringJoiner;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0-SNAPSHOT")
public class Query {
public static final String JSON_PROPERTY_ID = "id";
private Long id;
protected Long id;
/**
* Gets or Sets outcomes
@ -79,7 +79,7 @@ public class Query {
}
public static final String JSON_PROPERTY_OUTCOMES = "outcomes";
private List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
protected List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
public Query() {
}
@ -109,7 +109,6 @@ public class Query {
this.id = id;
}
public Query outcomes(List<OutcomesEnum> outcomes) {
this.outcomes = outcomes;

View File

@ -69,7 +69,6 @@ public class Tag {
this.id = id;
}
public Tag name(String name) {
this.name = name;

View File

@ -78,7 +78,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.size = size;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) {
this.color = color;
@ -104,7 +103,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.color = color;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) {
this.id = id;
@ -130,7 +128,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.id = id;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) {
this.name = name;

View File

@ -66,7 +66,6 @@ public class Bird {
this.size = size;
}
public Bird color(String color) {
this.color = color;

View File

@ -66,7 +66,6 @@ public class Category {
this.id = id;
}
public Category name(String name) {
this.name = name;

View File

@ -76,7 +76,6 @@ public class DataQuery extends Query {
this.suffix = suffix;
}
public DataQuery text(String text) {
this.text = text;
@ -102,7 +101,6 @@ public class DataQuery extends Query {
this.text = text;
}
public DataQuery date(OffsetDateTime date) {
this.date = date;

View File

@ -143,7 +143,6 @@ public class DefaultValue {
this.arrayStringEnumRefDefault = arrayStringEnumRefDefault;
}
public DefaultValue arrayStringEnumDefault(List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault) {
this.arrayStringEnumDefault = arrayStringEnumDefault;
@ -177,7 +176,6 @@ public class DefaultValue {
this.arrayStringEnumDefault = arrayStringEnumDefault;
}
public DefaultValue arrayStringDefault(List<String> arrayStringDefault) {
this.arrayStringDefault = arrayStringDefault;
@ -211,7 +209,6 @@ public class DefaultValue {
this.arrayStringDefault = arrayStringDefault;
}
public DefaultValue arrayIntegerDefault(List<Integer> arrayIntegerDefault) {
this.arrayIntegerDefault = arrayIntegerDefault;
@ -245,7 +242,6 @@ public class DefaultValue {
this.arrayIntegerDefault = arrayIntegerDefault;
}
public DefaultValue arrayString(List<String> arrayString) {
this.arrayString = arrayString;
@ -279,7 +275,6 @@ public class DefaultValue {
this.arrayString = arrayString;
}
public DefaultValue arrayStringNullable(List<String> arrayStringNullable) {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);
@ -325,7 +320,6 @@ public class DefaultValue {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);
}
public DefaultValue arrayStringExtensionNullable(List<String> arrayStringExtensionNullable) {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);
@ -371,7 +365,6 @@ public class DefaultValue {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);
}
public DefaultValue stringNullable(String stringNullable) {
this.stringNullable = JsonNullable.<String>of(stringNullable);

View File

@ -71,7 +71,6 @@ public class NumberPropertiesOnly {
this.number = number;
}
public NumberPropertiesOnly _float(Float _float) {
this._float = _float;
@ -97,7 +96,6 @@ public class NumberPropertiesOnly {
this._float = _float;
}
public NumberPropertiesOnly _double(Double _double) {
this._double = _double;

View File

@ -124,7 +124,6 @@ public class Pet {
this.id = id;
}
public Pet name(String name) {
this.name = name;
@ -150,7 +149,6 @@ public class Pet {
this.name = name;
}
public Pet category(Category category) {
this.category = category;
@ -176,7 +174,6 @@ public class Pet {
this.category = category;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
@ -210,7 +207,6 @@ public class Pet {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
@ -244,7 +240,6 @@ public class Pet {
this.tags = tags;
}
public Pet status(StatusEnum status) {
this.status = status;

View File

@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0-SNAPSHOT")
public class Query {
public static final String JSON_PROPERTY_ID = "id";
private Long id;
protected Long id;
/**
* Gets or Sets outcomes
@ -76,7 +76,7 @@ public class Query {
}
public static final String JSON_PROPERTY_OUTCOMES = "outcomes";
private List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
protected List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
public Query() {
}
@ -106,7 +106,6 @@ public class Query {
this.id = id;
}
public Query outcomes(List<OutcomesEnum> outcomes) {
this.outcomes = outcomes;

View File

@ -66,7 +66,6 @@ public class Tag {
this.id = id;
}
public Tag name(String name) {
this.name = name;

View File

@ -75,7 +75,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.size = size;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) {
this.color = color;
@ -101,7 +100,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.color = color;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) {
this.id = id;
@ -127,7 +125,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.id = id;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) {
this.name = name;

View File

@ -66,7 +66,6 @@ public class Bird {
this.size = size;
}
public Bird color(String color) {
this.color = color;

View File

@ -66,7 +66,6 @@ public class Category {
this.id = id;
}
public Category name(String name) {
this.name = name;

View File

@ -76,7 +76,6 @@ public class DataQuery extends Query {
this.suffix = suffix;
}
public DataQuery text(String text) {
this.text = text;
@ -102,7 +101,6 @@ public class DataQuery extends Query {
this.text = text;
}
public DataQuery date(OffsetDateTime date) {
this.date = date;

View File

@ -143,7 +143,6 @@ public class DefaultValue {
this.arrayStringEnumRefDefault = arrayStringEnumRefDefault;
}
public DefaultValue arrayStringEnumDefault(List<ArrayStringEnumDefaultEnum> arrayStringEnumDefault) {
this.arrayStringEnumDefault = arrayStringEnumDefault;
@ -177,7 +176,6 @@ public class DefaultValue {
this.arrayStringEnumDefault = arrayStringEnumDefault;
}
public DefaultValue arrayStringDefault(List<String> arrayStringDefault) {
this.arrayStringDefault = arrayStringDefault;
@ -211,7 +209,6 @@ public class DefaultValue {
this.arrayStringDefault = arrayStringDefault;
}
public DefaultValue arrayIntegerDefault(List<Integer> arrayIntegerDefault) {
this.arrayIntegerDefault = arrayIntegerDefault;
@ -245,7 +242,6 @@ public class DefaultValue {
this.arrayIntegerDefault = arrayIntegerDefault;
}
public DefaultValue arrayString(List<String> arrayString) {
this.arrayString = arrayString;
@ -279,7 +275,6 @@ public class DefaultValue {
this.arrayString = arrayString;
}
public DefaultValue arrayStringNullable(List<String> arrayStringNullable) {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);
@ -325,7 +320,6 @@ public class DefaultValue {
this.arrayStringNullable = JsonNullable.<List<String>>of(arrayStringNullable);
}
public DefaultValue arrayStringExtensionNullable(List<String> arrayStringExtensionNullable) {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);
@ -371,7 +365,6 @@ public class DefaultValue {
this.arrayStringExtensionNullable = JsonNullable.<List<String>>of(arrayStringExtensionNullable);
}
public DefaultValue stringNullable(String stringNullable) {
this.stringNullable = JsonNullable.<String>of(stringNullable);

View File

@ -71,7 +71,6 @@ public class NumberPropertiesOnly {
this.number = number;
}
public NumberPropertiesOnly _float(Float _float) {
this._float = _float;
@ -97,7 +96,6 @@ public class NumberPropertiesOnly {
this._float = _float;
}
public NumberPropertiesOnly _double(Double _double) {
this._double = _double;

View File

@ -124,7 +124,6 @@ public class Pet {
this.id = id;
}
public Pet name(String name) {
this.name = name;
@ -150,7 +149,6 @@ public class Pet {
this.name = name;
}
public Pet category(Category category) {
this.category = category;
@ -176,7 +174,6 @@ public class Pet {
this.category = category;
}
public Pet photoUrls(List<String> photoUrls) {
this.photoUrls = photoUrls;
@ -210,7 +207,6 @@ public class Pet {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
@ -244,7 +240,6 @@ public class Pet {
this.tags = tags;
}
public Pet status(StatusEnum status) {
this.status = status;

View File

@ -36,7 +36,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.6.0-SNAPSHOT")
public class Query {
public static final String JSON_PROPERTY_ID = "id";
private Long id;
protected Long id;
/**
* Gets or Sets outcomes
@ -76,7 +76,7 @@ public class Query {
}
public static final String JSON_PROPERTY_OUTCOMES = "outcomes";
private List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
protected List<OutcomesEnum> outcomes = new ArrayList<>(Arrays.asList(OutcomesEnum.SUCCESS, OutcomesEnum.FAILURE));
public Query() {
}
@ -106,7 +106,6 @@ public class Query {
this.id = id;
}
public Query outcomes(List<OutcomesEnum> outcomes) {
this.outcomes = outcomes;

View File

@ -66,7 +66,6 @@ public class Tag {
this.id = id;
}
public Tag name(String name) {
this.name = name;

View File

@ -75,7 +75,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.size = size;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter color(String color) {
this.color = color;
@ -101,7 +100,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.color = color;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter id(Long id) {
this.id = id;
@ -127,7 +125,6 @@ public class TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter
this.id = id;
}
public TestQueryStyleDeepObjectExplodeTrueObjectAllOfQueryObjectParameter name(String name) {
this.name = name;

View File

@ -79,7 +79,6 @@ public class AdditionalPropertiesClass {
this.mapProperty = mapProperty;
}
public AdditionalPropertiesClass mapOfMapProperty(Map<String, Map<String, String>> mapOfMapProperty) {
this.mapOfMapProperty = mapOfMapProperty;

View File

@ -70,7 +70,6 @@ public class AllOfWithSingleRef {
this.username = username;
}
public AllOfWithSingleRef singleRefType(SingleRefType singleRefType) {
this.singleRefType = singleRefType;

View File

@ -52,7 +52,7 @@ public class Animal {
protected String className;
public static final String JSON_PROPERTY_COLOR = "color";
private String color = "red";
protected String color = "red";
public Animal() {
}
@ -82,7 +82,6 @@ public class Animal {
this.className = className;
}
public Animal color(String color) {
this.color = color;

View File

@ -85,7 +85,6 @@ public class ArrayTest {
this.arrayOfString = arrayOfString;
}
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
@ -119,7 +118,6 @@ public class ArrayTest {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;

View File

@ -85,7 +85,6 @@ public class Capitalization {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
@ -111,7 +110,6 @@ public class Capitalization {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
@ -137,7 +135,6 @@ public class Capitalization {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
@ -163,7 +160,6 @@ public class Capitalization {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
@ -189,7 +185,6 @@ public class Capitalization {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;

View File

@ -69,7 +69,6 @@ public class Category {
this.id = id;
}
public Category name(String name) {
this.name = name;

View File

@ -142,7 +142,6 @@ public class EnumArrays {
this.justSymbol = justSymbol;
}
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;

View File

@ -246,7 +246,6 @@ public class EnumTest {
this.enumString = enumString;
}
public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
@ -272,7 +271,6 @@ public class EnumTest {
this.enumStringRequired = enumStringRequired;
}
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
@ -298,7 +296,6 @@ public class EnumTest {
this.enumInteger = enumInteger;
}
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
@ -324,7 +321,6 @@ public class EnumTest {
this.enumNumber = enumNumber;
}
public EnumTest outerEnum(OuterEnum outerEnum) {
this.outerEnum = JsonNullable.<OuterEnum>of(outerEnum);
@ -358,7 +354,6 @@ public class EnumTest {
this.outerEnum = JsonNullable.<OuterEnum>of(outerEnum);
}
public EnumTest outerEnumInteger(OuterEnumInteger outerEnumInteger) {
this.outerEnumInteger = outerEnumInteger;
@ -384,7 +379,6 @@ public class EnumTest {
this.outerEnumInteger = outerEnumInteger;
}
public EnumTest outerEnumDefaultValue(OuterEnumDefaultValue outerEnumDefaultValue) {
this.outerEnumDefaultValue = outerEnumDefaultValue;
@ -410,7 +404,6 @@ public class EnumTest {
this.outerEnumDefaultValue = outerEnumDefaultValue;
}
public EnumTest outerEnumIntegerDefaultValue(OuterEnumIntegerDefaultValue outerEnumIntegerDefaultValue) {
this.outerEnumIntegerDefaultValue = outerEnumIntegerDefaultValue;

View File

@ -73,7 +73,6 @@ public class FakeBigDecimalMap200Response {
this.someId = someId;
}
public FakeBigDecimalMap200Response someMap(Map<String, BigDecimal> someMap) {
this.someMap = someMap;

View File

@ -73,7 +73,6 @@ public class FileSchemaTestClass {
this._file = _file;
}
public FileSchemaTestClass files(List<ModelFile> files) {
this.files = files;

View File

@ -133,7 +133,6 @@ public class FormatTest {
this.integer = integer;
}
public FormatTest int32(Integer int32) {
this.int32 = int32;
@ -161,7 +160,6 @@ public class FormatTest {
this.int32 = int32;
}
public FormatTest int64(Long int64) {
this.int64 = int64;
@ -187,7 +185,6 @@ public class FormatTest {
this.int64 = int64;
}
public FormatTest number(BigDecimal number) {
this.number = number;
@ -215,7 +212,6 @@ public class FormatTest {
this.number = number;
}
public FormatTest _float(Float _float) {
this._float = _float;
@ -243,7 +239,6 @@ public class FormatTest {
this._float = _float;
}
public FormatTest _double(Double _double) {
this._double = _double;
@ -271,7 +266,6 @@ public class FormatTest {
this._double = _double;
}
public FormatTest decimal(BigDecimal decimal) {
this.decimal = decimal;
@ -297,7 +291,6 @@ public class FormatTest {
this.decimal = decimal;
}
public FormatTest string(String string) {
this.string = string;
@ -323,7 +316,6 @@ public class FormatTest {
this.string = string;
}
public FormatTest _byte(byte[] _byte) {
this._byte = _byte;
@ -349,7 +341,6 @@ public class FormatTest {
this._byte = _byte;
}
public FormatTest binary(File binary) {
this.binary = binary;
@ -375,7 +366,6 @@ public class FormatTest {
this.binary = binary;
}
public FormatTest date(LocalDate date) {
this.date = date;
@ -401,7 +391,6 @@ public class FormatTest {
this.date = date;
}
public FormatTest dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
@ -427,7 +416,6 @@ public class FormatTest {
this.dateTime = dateTime;
}
public FormatTest uuid(UUID uuid) {
this.uuid = uuid;
@ -453,7 +441,6 @@ public class FormatTest {
this.uuid = uuid;
}
public FormatTest password(String password) {
this.password = password;
@ -479,7 +466,6 @@ public class FormatTest {
this.password = password;
}
public FormatTest patternWithDigits(String patternWithDigits) {
this.patternWithDigits = patternWithDigits;
@ -505,7 +491,6 @@ public class FormatTest {
this.patternWithDigits = patternWithDigits;
}
public FormatTest patternWithDigitsAndDelimiter(String patternWithDigitsAndDelimiter) {
this.patternWithDigitsAndDelimiter = patternWithDigitsAndDelimiter;

View File

@ -44,7 +44,9 @@ public class HasOnlyReadOnly {
public HasOnlyReadOnly() {
}
/**
* Constructor with only readonly parameters
*/
@JsonCreator
public HasOnlyReadOnly(
@JsonProperty(JSON_PROPERTY_BAR) String bar,
@ -69,7 +71,6 @@ public class HasOnlyReadOnly {
/**
* Get foo
* @return foo

View File

@ -122,7 +122,6 @@ public class MapTest {
this.mapMapOfString = mapMapOfString;
}
public MapTest mapOfEnumString(Map<String, InnerEnum> mapOfEnumString) {
this.mapOfEnumString = mapOfEnumString;
@ -156,7 +155,6 @@ public class MapTest {
this.mapOfEnumString = mapOfEnumString;
}
public MapTest directMap(Map<String, Boolean> directMap) {
this.directMap = directMap;
@ -190,7 +188,6 @@ public class MapTest {
this.directMap = directMap;
}
public MapTest indirectMap(Map<String, Boolean> indirectMap) {
this.indirectMap = indirectMap;

View File

@ -78,7 +78,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.uuid = uuid;
}
public MixedPropertiesAndAdditionalPropertiesClass dateTime(OffsetDateTime dateTime) {
this.dateTime = dateTime;
@ -104,7 +103,6 @@ public class MixedPropertiesAndAdditionalPropertiesClass {
this.dateTime = dateTime;
}
public MixedPropertiesAndAdditionalPropertiesClass map(Map<String, Animal> map) {
this.map = map;

View File

@ -70,7 +70,6 @@ public class Model200Response {
this.name = name;
}
public Model200Response propertyClass(String propertyClass) {
this.propertyClass = propertyClass;

View File

@ -74,7 +74,6 @@ public class ModelApiResponse {
this.code = code;
}
public ModelApiResponse type(String type) {
this.type = type;
@ -100,7 +99,6 @@ public class ModelApiResponse {
this.type = type;
}
public ModelApiResponse message(String message) {
this.message = message;

View File

@ -51,7 +51,9 @@ public class Name {
public Name() {
}
/**
* Constructor with only readonly parameters
*/
@JsonCreator
public Name(
@JsonProperty(JSON_PROPERTY_SNAKE_CASE) Integer snakeCase,
@ -87,7 +89,6 @@ public class Name {
this.name = name;
}
/**
* Get snakeCase
* @return snakeCase
@ -102,7 +103,6 @@ public class Name {
public Name property(String property) {
this.property = property;
@ -128,7 +128,6 @@ public class Name {
this.property = property;
}
/**
* Get _123number
* @return _123number

View File

@ -130,7 +130,6 @@ public class NullableClass extends HashMap<String, Object> {
this.integerProp = JsonNullable.<Integer>of(integerProp);
}
public NullableClass numberProp(BigDecimal numberProp) {
this.numberProp = JsonNullable.<BigDecimal>of(numberProp);
@ -164,7 +163,6 @@ public class NullableClass extends HashMap<String, Object> {
this.numberProp = JsonNullable.<BigDecimal>of(numberProp);
}
public NullableClass booleanProp(Boolean booleanProp) {
this.booleanProp = JsonNullable.<Boolean>of(booleanProp);
@ -198,7 +196,6 @@ public class NullableClass extends HashMap<String, Object> {
this.booleanProp = JsonNullable.<Boolean>of(booleanProp);
}
public NullableClass stringProp(String stringProp) {
this.stringProp = JsonNullable.<String>of(stringProp);
@ -232,7 +229,6 @@ public class NullableClass extends HashMap<String, Object> {
this.stringProp = JsonNullable.<String>of(stringProp);
}
public NullableClass dateProp(LocalDate dateProp) {
this.dateProp = JsonNullable.<LocalDate>of(dateProp);
@ -266,7 +262,6 @@ public class NullableClass extends HashMap<String, Object> {
this.dateProp = JsonNullable.<LocalDate>of(dateProp);
}
public NullableClass datetimeProp(OffsetDateTime datetimeProp) {
this.datetimeProp = JsonNullable.<OffsetDateTime>of(datetimeProp);
@ -300,7 +295,6 @@ public class NullableClass extends HashMap<String, Object> {
this.datetimeProp = JsonNullable.<OffsetDateTime>of(datetimeProp);
}
public NullableClass arrayNullableProp(List<Object> arrayNullableProp) {
this.arrayNullableProp = JsonNullable.<List<Object>>of(arrayNullableProp);
@ -346,7 +340,6 @@ public class NullableClass extends HashMap<String, Object> {
this.arrayNullableProp = JsonNullable.<List<Object>>of(arrayNullableProp);
}
public NullableClass arrayAndItemsNullableProp(List<Object> arrayAndItemsNullableProp) {
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(arrayAndItemsNullableProp);
@ -392,7 +385,6 @@ public class NullableClass extends HashMap<String, Object> {
this.arrayAndItemsNullableProp = JsonNullable.<List<Object>>of(arrayAndItemsNullableProp);
}
public NullableClass arrayItemsNullable(List<Object> arrayItemsNullable) {
this.arrayItemsNullable = arrayItemsNullable;
@ -426,7 +418,6 @@ public class NullableClass extends HashMap<String, Object> {
this.arrayItemsNullable = arrayItemsNullable;
}
public NullableClass objectNullableProp(Map<String, Object> objectNullableProp) {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(objectNullableProp);
@ -472,7 +463,6 @@ public class NullableClass extends HashMap<String, Object> {
this.objectNullableProp = JsonNullable.<Map<String, Object>>of(objectNullableProp);
}
public NullableClass objectAndItemsNullableProp(Map<String, Object> objectAndItemsNullableProp) {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(objectAndItemsNullableProp);
@ -518,7 +508,6 @@ public class NullableClass extends HashMap<String, Object> {
this.objectAndItemsNullableProp = JsonNullable.<Map<String, Object>>of(objectAndItemsNullableProp);
}
public NullableClass objectItemsNullable(Map<String, Object> objectItemsNullable) {
this.objectItemsNullable = objectItemsNullable;

View File

@ -82,7 +82,6 @@ public class ObjectWithDeprecatedFields {
this.uuid = uuid;
}
public ObjectWithDeprecatedFields id(BigDecimal id) {
this.id = id;
@ -110,7 +109,6 @@ public class ObjectWithDeprecatedFields {
this.id = id;
}
public ObjectWithDeprecatedFields deprecatedRef(DeprecatedObject deprecatedRef) {
this.deprecatedRef = deprecatedRef;
@ -138,7 +136,6 @@ public class ObjectWithDeprecatedFields {
this.deprecatedRef = deprecatedRef;
}
public ObjectWithDeprecatedFields bars(List<String> bars) {
this.bars = bars;

View File

@ -123,7 +123,6 @@ public class Order {
this.id = id;
}
public Order petId(Long petId) {
this.petId = petId;
@ -149,7 +148,6 @@ public class Order {
this.petId = petId;
}
public Order quantity(Integer quantity) {
this.quantity = quantity;
@ -175,7 +173,6 @@ public class Order {
this.quantity = quantity;
}
public Order shipDate(OffsetDateTime shipDate) {
this.shipDate = shipDate;
@ -201,7 +198,6 @@ public class Order {
this.shipDate = shipDate;
}
public Order status(StatusEnum status) {
this.status = status;
@ -227,7 +223,6 @@ public class Order {
this.status = status;
}
public Order complete(Boolean complete) {
this.complete = complete;

View File

@ -74,7 +74,6 @@ public class OuterComposite {
this.myNumber = myNumber;
}
public OuterComposite myString(String myString) {
this.myString = myString;
@ -100,7 +99,6 @@ public class OuterComposite {
this.myString = myString;
}
public OuterComposite myBoolean(Boolean myBoolean) {
this.myBoolean = myBoolean;

View File

@ -88,7 +88,7 @@ public class ParentWithNullable {
protected TypeEnum type;
public static final String JSON_PROPERTY_NULLABLE_PROPERTY = "nullableProperty";
private JsonNullable<String> nullableProperty = JsonNullable.<String>undefined();
protected JsonNullable<String> nullableProperty = JsonNullable.<String>undefined();
public ParentWithNullable() {
}
@ -118,7 +118,6 @@ public class ParentWithNullable {
this.type = type;
}
public ParentWithNullable nullableProperty(String nullableProperty) {
this.nullableProperty = JsonNullable.<String>of(nullableProperty);

View File

@ -130,7 +130,6 @@ public class Pet {
this.id = id;
}
public Pet category(Category category) {
this.category = category;
@ -156,7 +155,6 @@ public class Pet {
this.category = category;
}
public Pet name(String name) {
this.name = name;
@ -182,7 +180,6 @@ public class Pet {
this.name = name;
}
public Pet photoUrls(Set<String> photoUrls) {
this.photoUrls = photoUrls;
@ -217,7 +214,6 @@ public class Pet {
this.photoUrls = photoUrls;
}
public Pet tags(List<Tag> tags) {
this.tags = tags;
@ -251,7 +247,6 @@ public class Pet {
this.tags = tags;
}
public Pet status(StatusEnum status) {
this.status = status;

View File

@ -43,7 +43,9 @@ public class ReadOnlyFirst {
public ReadOnlyFirst() {
}
/**
* Constructor with only readonly parameters
*/
@JsonCreator
public ReadOnlyFirst(
@JsonProperty(JSON_PROPERTY_BAR) String bar
@ -66,7 +68,6 @@ public class ReadOnlyFirst {
public ReadOnlyFirst baz(String baz) {
this.baz = baz;

View File

@ -69,7 +69,6 @@ public class Tag {
this.id = id;
}
public Tag name(String name) {
this.name = name;

View File

@ -93,7 +93,6 @@ public class User {
this.id = id;
}
public User username(String username) {
this.username = username;
@ -119,7 +118,6 @@ public class User {
this.username = username;
}
public User firstName(String firstName) {
this.firstName = firstName;
@ -145,7 +143,6 @@ public class User {
this.firstName = firstName;
}
public User lastName(String lastName) {
this.lastName = lastName;
@ -171,7 +168,6 @@ public class User {
this.lastName = lastName;
}
public User email(String email) {
this.email = email;
@ -197,7 +193,6 @@ public class User {
this.email = email;
}
public User password(String password) {
this.password = password;
@ -223,7 +218,6 @@ public class User {
this.password = password;
}
public User phone(String phone) {
this.phone = phone;
@ -249,7 +243,6 @@ public class User {
this.phone = phone;
}
public User userStatus(Integer userStatus) {
this.userStatus = userStatus;

View File

@ -114,7 +114,6 @@ public class AdditionalPropertiesClass {
this.mapString = mapString;
}
public AdditionalPropertiesClass mapNumber(Map<String, BigDecimal> mapNumber) {
this.mapNumber = mapNumber;
@ -148,7 +147,6 @@ public class AdditionalPropertiesClass {
this.mapNumber = mapNumber;
}
public AdditionalPropertiesClass mapInteger(Map<String, Integer> mapInteger) {
this.mapInteger = mapInteger;
@ -182,7 +180,6 @@ public class AdditionalPropertiesClass {
this.mapInteger = mapInteger;
}
public AdditionalPropertiesClass mapBoolean(Map<String, Boolean> mapBoolean) {
this.mapBoolean = mapBoolean;
@ -216,7 +213,6 @@ public class AdditionalPropertiesClass {
this.mapBoolean = mapBoolean;
}
public AdditionalPropertiesClass mapArrayInteger(Map<String, List<Integer>> mapArrayInteger) {
this.mapArrayInteger = mapArrayInteger;
@ -250,7 +246,6 @@ public class AdditionalPropertiesClass {
this.mapArrayInteger = mapArrayInteger;
}
public AdditionalPropertiesClass mapArrayAnytype(Map<String, List<Object>> mapArrayAnytype) {
this.mapArrayAnytype = mapArrayAnytype;
@ -284,7 +279,6 @@ public class AdditionalPropertiesClass {
this.mapArrayAnytype = mapArrayAnytype;
}
public AdditionalPropertiesClass mapMapString(Map<String, Map<String, String>> mapMapString) {
this.mapMapString = mapMapString;
@ -318,7 +312,6 @@ public class AdditionalPropertiesClass {
this.mapMapString = mapMapString;
}
public AdditionalPropertiesClass mapMapAnytype(Map<String, Map<String, Object>> mapMapAnytype) {
this.mapMapAnytype = mapMapAnytype;
@ -352,7 +345,6 @@ public class AdditionalPropertiesClass {
this.mapMapAnytype = mapMapAnytype;
}
public AdditionalPropertiesClass anytype1(Object anytype1) {
this.anytype1 = anytype1;
@ -378,7 +370,6 @@ public class AdditionalPropertiesClass {
this.anytype1 = anytype1;
}
public AdditionalPropertiesClass anytype2(Object anytype2) {
this.anytype2 = anytype2;
@ -404,7 +395,6 @@ public class AdditionalPropertiesClass {
this.anytype2 = anytype2;
}
public AdditionalPropertiesClass anytype3(Object anytype3) {
this.anytype3 = anytype3;

View File

@ -50,7 +50,7 @@ public class Animal {
protected String className;
public static final String JSON_PROPERTY_COLOR = "color";
private String color = "red";
protected String color = "red";
public Animal() {
}
@ -80,7 +80,6 @@ public class Animal {
this.className = className;
}
public Animal color(String color) {
this.color = color;

View File

@ -82,7 +82,6 @@ public class ArrayTest {
this.arrayOfString = arrayOfString;
}
public ArrayTest arrayArrayOfInteger(List<List<Long>> arrayArrayOfInteger) {
this.arrayArrayOfInteger = arrayArrayOfInteger;
@ -116,7 +115,6 @@ public class ArrayTest {
this.arrayArrayOfInteger = arrayArrayOfInteger;
}
public ArrayTest arrayArrayOfModel(List<List<ReadOnlyFirst>> arrayArrayOfModel) {
this.arrayArrayOfModel = arrayArrayOfModel;

View File

@ -82,7 +82,6 @@ public class Capitalization {
this.smallCamel = smallCamel;
}
public Capitalization capitalCamel(String capitalCamel) {
this.capitalCamel = capitalCamel;
@ -108,7 +107,6 @@ public class Capitalization {
this.capitalCamel = capitalCamel;
}
public Capitalization smallSnake(String smallSnake) {
this.smallSnake = smallSnake;
@ -134,7 +132,6 @@ public class Capitalization {
this.smallSnake = smallSnake;
}
public Capitalization capitalSnake(String capitalSnake) {
this.capitalSnake = capitalSnake;
@ -160,7 +157,6 @@ public class Capitalization {
this.capitalSnake = capitalSnake;
}
public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
this.scAETHFlowPoints = scAETHFlowPoints;
@ -186,7 +182,6 @@ public class Capitalization {
this.scAETHFlowPoints = scAETHFlowPoints;
}
public Capitalization ATT_NAME(String ATT_NAME) {
this.ATT_NAME = ATT_NAME;

View File

@ -45,7 +45,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
public class Cat extends Animal {
public static final String JSON_PROPERTY_DECLAWED = "declawed";
private Boolean declawed;
protected Boolean declawed;
public Cat() {

View File

@ -66,7 +66,6 @@ public class Category {
this.id = id;
}
public Category name(String name) {
this.name = name;

View File

@ -139,7 +139,6 @@ public class EnumArrays {
this.justSymbol = justSymbol;
}
public EnumArrays arrayEnum(List<ArrayEnumEnum> arrayEnum) {
this.arrayEnum = arrayEnum;

View File

@ -224,7 +224,6 @@ public class EnumTest {
this.enumString = enumString;
}
public EnumTest enumStringRequired(EnumStringRequiredEnum enumStringRequired) {
this.enumStringRequired = enumStringRequired;
@ -250,7 +249,6 @@ public class EnumTest {
this.enumStringRequired = enumStringRequired;
}
public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
this.enumInteger = enumInteger;
@ -276,7 +274,6 @@ public class EnumTest {
this.enumInteger = enumInteger;
}
public EnumTest enumNumber(EnumNumberEnum enumNumber) {
this.enumNumber = enumNumber;
@ -302,7 +299,6 @@ public class EnumTest {
this.enumNumber = enumNumber;
}
public EnumTest outerEnum(OuterEnum outerEnum) {
this.outerEnum = outerEnum;

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