Skip to content

Commit 8a9121b

Browse files
committed
feat: add optional getters for nullable fields
1 parent 16d08a3 commit 8a9121b

26 files changed

Lines changed: 26 additions & 0 deletions

docs/generators/groovy.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
|licenseUrl|The URL of the license| |http://unlicense.org|
5656
|modelPackage|package for generated models| |org.openapitools.model|
5757
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
58+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
5859
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
5960
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
6061
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

docs/generators/java-camel.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
8383
|modelPackage|package for generated models| |org.openapitools.model|
8484
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
8585
|optionalAcceptNullable|Use `ofNullable` instead of just `of` to accept null values when using Optional.| |true|
86+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
8687
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
8788
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
8889
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

docs/generators/java-dubbo.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
6262
|licenseUrl|The URL of the license| |http://unlicense.org|
6363
|modelPackage|package for generated models| |org.openapitools.model|
6464
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
65+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
6566
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
6667
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
6768
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

docs/generators/java-helidon-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5656
|licenseUrl|The URL of the license| |http://unlicense.org|
5757
|modelPackage|package for generated models| |org.openapitools.client.model|
5858
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
59+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
5960
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
6061
|rootJavaEEPackage|Root package name for Java EE| |Helidon 2.x and earlier: javax; Helidon 3.x and later: jakarta|
6162
|serializableModel|boolean - toggle "implements Serializable" for generated models| |false|

docs/generators/java-helidon-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5656
|licenseUrl|The URL of the license| |http://unlicense.org|
5757
|modelPackage|package for generated models| |org.openapitools.server.model|
5858
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
59+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
5960
|performBeanValidation|Perform BeanValidation| |false|
6061
|prependFormOrBodyParameters|Add form or body parameters to the beginning of the parameter list.| |false|
6162
|rootJavaEEPackage|Root package name for Java EE| |Helidon 2.x and earlier: javax; Helidon 3.x and later: jakarta|

docs/generators/java-inflector.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5757
|licenseUrl|The URL of the license| |http://unlicense.org|
5858
|modelPackage|package for generated models| |org.openapitools.model|
5959
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
60+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
6061
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
6162
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
6263
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

docs/generators/java-micronaut-client.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
6969
|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.4.3|
7070
|modelPackage|package for generated models| |org.openapitools.model|
7171
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
72+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
7273
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
7374
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
7475
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

docs/generators/java-micronaut-server.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
6767
|micronautVersion|Micronaut version, only >=3.0.0 versions are supported| |3.4.3|
6868
|modelPackage|package for generated models| |org.openapitools.model|
6969
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
70+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
7071
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
7172
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
7273
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

docs/generators/java-microprofile.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
7474
|microprofileRestClientVersion|Version of MicroProfile Rest Client API.| |null|
7575
|modelPackage|package for generated models| |org.openapitools.client.model|
7676
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
77+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
7778
|parcelableModel|Whether to generate models for Android that implement Parcelable with the okhttp-gson library.| |false|
7879
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
7980
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

docs/generators/java-msf4j.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
5959
|licenseUrl|The URL of the license| |http://unlicense.org|
6060
|modelPackage|package for generated models| |org.openapitools.model|
6161
|openApiNullable|Enable OpenAPI Jackson Nullable library. Not supported by `microprofile` library.| |true|
62+
|optionalGettersForNullableFieldsOnly|Make getters of nullable / non-required fields return Optional<T> while keeping the field and setter as the raw type. Opt-in, disabled by default.| |false|
6263
|parentArtifactId|parent artifactId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
6364
|parentGroupId|parent groupId in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|
6465
|parentVersion|parent version in generated pom N.B. parentGroupId, parentArtifactId and parentVersion must all be specified for any of them to take effect| |null|

0 commit comments

Comments
 (0)