You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1282db0
Browse filesBrowse the repository at this point in the historyBrowse files
Add support for JSpecify annotations in SpringCodegen
- Introduced `useJSpecify` flag to enable the use of JSpecify's `@Nullable` annotations.
- Modified POJO templates to correctly place JSpecify annotations for `TYPE_USE` compatibility.
- Updated importMappings to handle hardcoded JSpecify annotations when enabled.
- Added a test case for verifying correct annotation placement and behavior (`issue_23206.yaml` and corresponding Java test).
Copy file name to clipboardExpand all lines: docs/generators/java-camel.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,6 +109,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
109
109
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison||false|
110
110
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.||true|
111
111
|useFeignClientUrl|Whether to generate Feign client with url parameter.||true|
112
+
|useJSpecify|Use JSpecify's @Nullable (org.jspecify.annotations.Nullable) instead of Spring's @Nullable. Overrides any user-supplied importMapping for 'Nullable'.||false|
112
113
|useJackson3|Set it in order to use jackson 3 dependencies (only allowed when `useSpringBoot4` is set and incompatible with `openApiNullable`).||false|
113
114
|useJakartaEe|whether to use Jakarta EE namespace instead of javax||false|
114
115
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface||true|
Copy file name to clipboardExpand all lines: docs/generators/spring.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -102,6 +102,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
102
102
|useEnumCaseInsensitive|Use `equalsIgnoreCase` when String for enum comparison||false|
103
103
|useFeignClientContextId|Whether to generate Feign client with contextId parameter.||true|
104
104
|useFeignClientUrl|Whether to generate Feign client with url parameter.||true|
105
+
|useJSpecify|Use JSpecify's @Nullable (org.jspecify.annotations.Nullable) instead of Spring's @Nullable. Overrides any user-supplied importMapping for 'Nullable'.||false|
105
106
|useJackson3|Set it in order to use jackson 3 dependencies (only allowed when `useSpringBoot4` is set and incompatible with `openApiNullable`).||false|
106
107
|useJakartaEe|whether to use Jakarta EE namespace instead of javax||false|
107
108
|useOneOfInterfaces|whether to use a java interface to describe a set of oneOf options, where each option is a class that implements the interface||true|
@@ -144,7 +144,7 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}
144
144
{{^lombok.Data}}
145
145
146
146
{{! begin feature: fluent setter methods }}
147
-
public {{classname}} {{name}}({{>nullableAnnotation}}{{{datatypeWithEnum}}} {{name}}) {
147
+
public {{classname}} {{name}}({{#vendorExtensions.x-jspecify-annotated-type}}{{{vendorExtensions.x-jspecify-annotated-type}}}{{/vendorExtensions.x-jspecify-annotated-type}}{{^vendorExtensions.x-jspecify-annotated-type}}{{>nullableAnnotation}}{{{datatypeWithEnum}}}{{/vendorExtensions.x-jspecify-annotated-type}} {{name}}) {
@@ -229,7 +229,7 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}
229
229
{{#deprecated}}
230
230
@Deprecated
231
231
{{/deprecated}}
232
-
{{#jackson}}{{>jackson_annotations}}{{/jackson}}{{#withXml}}{{>xmlAccessorAnnotation}}{{/withXml}} public {{>nullableAnnotation}}{{>nullableDataTypeBeanValidation}} {{getter}}() {
232
+
{{#jackson}}{{>jackson_annotations}}{{/jackson}}{{#withXml}}{{>xmlAccessorAnnotation}}{{/withXml}} public {{#vendorExtensions.x-jspecify-annotated-type}}{{{vendorExtensions.x-jspecify-annotated-type}}}{{/vendorExtensions.x-jspecify-annotated-type}}{{^vendorExtensions.x-jspecify-annotated-type}}{{>nullableAnnotation}}{{>nullableDataTypeBeanValidation}}{{/vendorExtensions.x-jspecify-annotated-type}} {{getter}}() {
233
233
return {{name}};
234
234
}
235
235
{{/lombok.Getter}}
@@ -246,7 +246,7 @@ public {{>sealed}}class {{classname}}{{#parent}} extends {{{parent}}}{{/parent}}
246
246
{{#deprecated}}
247
247
@Deprecated
248
248
{{/deprecated}}
249
-
{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{>jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{>nullableAnnotation}}{{>nullableDataType}} {{name}}) {
249
+
{{#jackson}}{{^vendorExtensions.x-is-jackson-optional-nullable}}{{>jackson_annotations}}{{/vendorExtensions.x-is-jackson-optional-nullable}}{{/jackson}} public void {{setter}}({{#vendorExtensions.x-jspecify-annotated-type}}{{{vendorExtensions.x-jspecify-annotated-type}}}{{/vendorExtensions.x-jspecify-annotated-type}}{{^vendorExtensions.x-jspecify-annotated-type}}{{>nullableAnnotation}}{{>nullableDataType}}{{/vendorExtensions.x-jspecify-annotated-type}} {{name}}) {
0 commit comments