File tree Expand file tree Collapse file tree
modules/openapi-generator/src/main/resources/JavaJaxRS/spec Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -174,7 +174,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
174174 { {#isArray} }
175175 public { {classname} } add{ {nameInPascalCase} }Item({ {{items.datatypeWithEnum} }} { {name} }Item) {
176176 {{#vendorExtensions.x-is-jackson-optional-nullable} }
177- if (this.{ {name} } == null || !this.{ {name} }.isPresent()) {
177+ if (this.{ {name} } == null || !this.{ {name} }.isPresent() || this. { {name } }.get() == null ) {
178178 this.{{name} } = JsonNullable.<{ {{datatypeWithEnum} }}>of({ {{defaultValue} }}{ {^defaultValue} }new { {#uniqueItems} }LinkedHashSet{ {/uniqueItems} }{ {^uniqueItems} }ArrayList{ {/uniqueItems} }<> (){ {/defaultValue} });
179179 }
180180 try {
@@ -216,7 +216,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}} {{#vendorExtens
216216 { {#isMap} }
217217 public { {classname} } put{ {nameInPascalCase} }Item(String key, { {{items.datatypeWithEnum} }} { {name} }Item) {
218218 {{#vendorExtensions.x-is-jackson-optional-nullable} }
219- if (this.{ {name} } == null || !this.{ {name} }.isPresent()) {
219+ if (this.{ {name} } == null || !this.{ {name} }.isPresent() || this. { {name } }.get() == null ) {
220220 this.{{name} } = JsonNullable.<{ {{datatypeWithEnum} }}>of({ {{defaultValue} }}{ {^defaultValue} }new HashMap<> (){ {/defaultValue} });
221221 }
222222 try {
You can’t perform that action at this time.
0 commit comments