Skip to content

Commit 2a1b4f9

Browse files
wing328jpfinne
andauthored
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>
1 parent 98d0261 commit 2a1b4f9

565 files changed

Lines changed: 1714 additions & 1868 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

bin/configs/java-resttemplate-jakarta.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ additionalProperties:
88
hideGenerationTimestamp: "true"
99
java8: true
1010
useJakartaEe: true
11+
generateConstructorWithAllArgs: true

bin/configs/java-resttemplate.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ additionalProperties:
88
hideGenerationTimestamp: "true"
99
java8: true
1010
containerDefaultToNull: true
11+
generateConstructorWithAllArgs: true

bin/configs/spring-boot-3.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ additionalProperties:
1111
useBeanValidation: true
1212
withXml: true
1313
hideGenerationTimestamp: "true"
14+
generateConstructorWithAllArgs: true

bin/configs/spring-boot-delegate.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ additionalProperties:
88
hideGenerationTimestamp: "true"
99
java8: true
1010
delegatePattern: "true"
11+
generateConstructorWithAllArgs: true

bin/configs/spring-boot-lombok-data.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ additionalProperties:
77
artifactId: springboot-lombok-data
88
hideGenerationTimestamp: "true"
99
additionalModelTypeAnnotations: "@lombok.Data;@lombok.Builder;@lombok.NoArgsConstructor;@lombok.AllArgsConstructor"
10+
generateConstructorWithAllArgs: true

docs/generators/groovy.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3939
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
4040
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
4141
|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|
42+
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
4243
|groupId|groupId in generated pom.xml| |org.openapitools|
4344
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
4445
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

docs/generators/java-camel.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5555
|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|
5656
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
5757
|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|
58+
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
5859
|generatedConstructorWithRequiredArgs|Whether to generate constructors with required args for models| |true|
5960
|groupId|groupId in generated pom.xml| |org.openapitools|
6061
|hateoas|Use Spring HATEOAS library to allow adding HATEOAS links| |false|

docs/generators/java-helidon-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3838
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
3939
|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|
4040
|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.| ||
41+
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
4142
|groupId|groupId in generated pom.xml| |org.openapitools|
4243
|helidonVersion|Helidon version for generated code| |3.0.1|
4344
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|

docs/generators/java-helidon-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
3737
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
3838
|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|
3939
|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.| ||
40+
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
4041
|gradleProject|Whether to generate gradle project instead of maven.| |false|
4142
|groupId|groupId in generated pom.xml| |org.openapitools|
4243
|helidonVersion|Helidon version for generated code| |3.0.1|

docs/generators/java-inflector.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
4141
|discriminatorCaseSensitive|Whether the discriminator value lookup should be case-sensitive or not. This option only works for Java API client| |true|
4242
|ensureUniqueParams|Whether to ensure parameter names are unique in an operation (rename parameters that are not).| |true|
4343
|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|
44+
|generateConstructorWithAllArgs|whether to generate a constructor for all arguments| |false|
4445
|groupId|groupId in generated pom.xml| |org.openapitools|
4546
|hideGenerationTimestamp|Hides the generation timestamp when files are generated.| |false|
4647
|ignoreAnyOfInEnum|Ignore anyOf keyword in enum| |false|

0 commit comments

Comments
 (0)