Commit fb74567
committed
fix: add @nullable annotation to fluent setter parameters when useJspecify is enabled
The Spring generator was missing @nullable annotations on fluent setter
parameters when useJspecify is enabled, while regular setters and getters
had them correctly applied. This created an inconsistent nullness contract
that caused static analysis tools to flag passing null to fluent setters as
errors, even though the underlying field is nullable.
Changes:
- Updated JavaSpring/pojo.mustache to use {{>nullableDataType}} instead of
{{{datatypeWithEnum}}} for fluent setter parameters
- Applied the same fix to inherited property fluent setters
- Updated java-camel-server/pojo.mustache with the same fix (extends SpringCodegen)
This ensures consistent nullness annotations across:
- Fields: private @nullable String firstName;
- Getters: public @nullable String getFirstName()
- Regular setters: public void setFirstName(@nullable String firstName)
- Fluent setters: public UserBase firstName(@nullable String firstName)1 parent eb2767c commit fb74567
200 files changed
Lines changed: 451 additions & 451 deletions
File tree
- modules/openapi-generator/src/main/resources
- JavaSpring
- java-camel-server
- samples
- client/petstore
- spring-cloud-deprecated/src/main/java/org/openapitools/model
- spring-http-interface-noResponseEntity/src/main/java/org/openapitools/model
- spring-http-interface-reactive-noResponseEntity/src/main/java/org/openapitools/model
- spring-http-interface-reactive/src/main/java/org/openapitools/model
- spring-http-interface-springboot-4/src/main/java/org/openapitools/model
- spring-http-interface-useHttpServiceProxyFactoryInterfacesConfigurator/src/main/java/org/openapitools/model
- spring-http-interface/src/main/java/org/openapitools/model
- openapi3
- client/petstore
- spring-cloud-3-with-optional/src/main/java/org/openapitools/model
- spring-cloud-oas3-fakeapi/src/main/java/org/openapitools/model
- server/petstore
- spring-boot-oneof-interface/src/main/java/org/openapitools/model
- spring-boot-oneof-sealed/src/main/java/org/openapitools/model
- spring-boot-oneof/src/main/java/org/openapitools/model
- springboot-4-jspecify/src/main/java/org/openapitools/model
- springboot-delegate/src/main/java/org/openapitools/model
- springboot-implicitHeaders/src/main/java/org/openapitools/model
- server/petstore
- spring-boot-defaultInterface-unhandledExcp/src/main/java/org/openapitools/model
- spring-boot-nullable-set/src/main/java/org/openapitools/model
- springboot-beanvalidation-no-nullable/src/main/java/org/openapitools/model
- springboot-beanvalidation/src/main/java/org/openapitools/model
- springboot-builtin-validation/src/main/java/org/openapitools/model
- springboot-delegate-j8/src/main/java/org/openapitools/model
- springboot-delegate/src/main/java/org/openapitools/model
- springboot-implicitHeaders/src/main/java/org/openapitools/model
- springboot-include-http-request-context/src/main/java/org/openapitools/model
- springboot-reactive-noResponseEntity/src/main/java/org/openapitools/model
- springboot-reactive/src/main/java/org/openapitools/model
- springboot-useoptional/src/main/java/org/openapitools/model
- springboot-virtualan/src/main/java/org/openapitools/virtualan/model
- springboot-x-implements-skip/src/main/java/org/openapitools/model
- springboot/src/main/java/org/openapitools/model
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
| 147 | + | |
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
263 | | - | |
| 263 | + | |
264 | 264 | | |
265 | 265 | | |
266 | 266 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
| 138 | + | |
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
303 | 303 | | |
304 | 304 | | |
305 | 305 | | |
306 | | - | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
| 61 | + | |
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
301 | 301 | | |
302 | 302 | | |
303 | 303 | | |
304 | | - | |
| 304 | + | |
305 | 305 | | |
306 | 306 | | |
307 | 307 | | |
| |||
0 commit comments