Skip to content

Commit 642b1a3

Browse files
Philzenchschu
andauthored
[JAVA] [SPRING] [PKMST] [MICRONAUT] XML wireformat: Fix Jackson useWrapping=false, JAXB+Jackson namespaces (#18870)
* Fix XML annotations on model properties (JavaSpring) * generate JAXB annotations for attributes and elements * generate wrapper annotations (JAXB and Jackson) * use XML config from items for annotations of containers * Add test for Jackson XML wrapper correctness * Add additional test cases to cover all xml applications in spec Test now covers all use cases described in - https://web.archive.org/web/20240424203304/https://swagger.io/docs/specification/data-models/representing-xml/ - https://spec.openapis.org/oas/v3.0.0#xml-arrays * Fix basename used instead of xmlName when items.xmlName is unset See last example in spec: https://spec.openapis.org/oas/v3.0.0#xml-arrays * Harmonize spacing between Annotation attribute name and value * Refactor and group JAXB vs. Jackson XML annotations, only generate latter if enabled This is in line with the way the class annotations in `xmlAnnotations.mustache` are rendered – which only renders the `@Jackson`… xml annotations if additionalProperty jackson is true. Also reorder annotation attributes in the following order: - localName/name - namespace (optional) - isAttribute/useWrapping (optional) * Explicitly render `useWrapping = true` to @JacksonXmlElementWrapper This was slightly inspired by @jzrebiec via PR #5371. Wrapping is the default since Jackson 2.1 – so explicitly rendering this will: - make generated model work out-of-the-box in Jackson 2.0 for instance - ensure the models still work if the local `XmlWrapper` was configured with `useXmlWrapper(false)` * Move xml test spec to java resources folder (not spring specific) * Make test class name match class-under-test This makes discovery & cross-navigation in IDE easier. * Add complete xml annotations test for Java generators * Fix Java PKMST generator not generating @JacksonXmlElementWrapper * Fix Java microprofile generator missing @JacksonXmlRootElement * Fix Java microprofile generator not using wrapper annotations and namespaces * Fix Java Micronaut Client creating invalid (unclosed) @XmlAttribute annotations * Fix Micronaut Client using wrong localName for @JacksonXmlElementWrapper * Fix Micronaut client rendering @JacksonXmlProperty annotation twice * Make Java Micronaut render @JacksonXmlElementWrapper(useWrapping=false) for non-wrapped elements * Fix Jackson element using `xml.name` when it should be `items.xml.name` Closes #5989 Closes #3223 Relates to #9371 * Fix JAXB element using `baseName` instead of `xmlName` when items.xmlName is unset * Remove XML generation debug output from templates * Remove redundant newline between XML class annotations and class Brings the SpringCodegen in line with other Java Codegen's * Remove redundant newline between XML setter annotations and setter * Fix multiline JavaDoc block indentation and format * Simplify / condense xml annotation template into single lines May look a bit more complex, but cuts out a lot of repetitiveness. Also reorders annotation attributes in the following order: - localName/name - namespace (optional) - isAttribute/useWrapping (optional) * Harmonize spacing between Annotation attribute name and value * Remove unused jackson_annotations partial Was not referenced anywhere in java-helidon resources folder --------- Co-authored-by: Christian Schuster <[email protected]>
1 parent 13facda commit 642b1a3

File tree

2,726 files changed

+20424
-20024
lines changed

Some content is hidden

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

2,726 files changed

+20424
-20024
lines changed

modules/openapi-generator/src/main/resources/Java/jackson_annotations.mustache

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,9 @@
66
}}
77
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
88
@JsonInclude({{#isMap}}{{#items.isNullable}}content = JsonInclude.Include.ALWAYS, {{/items.isNullable}}{{/isMap}}value = JsonInclude.Include.{{#required}}ALWAYS{{/required}}{{^required}}USE_DEFAULTS{{/required}})
9-
{{#withXml}}
10-
{{^isContainer}}
11-
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
12-
{{/isContainer}}
13-
{{#isContainer}}
14-
{{#xmlName}}
15-
// xmlName={{.}}
16-
{{/xmlName}}
17-
@JacksonXmlProperty({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/xmlName}}")
18-
@JacksonXmlElementWrapper(useWrapping = {{isXmlWrapped}}{{#xmlNamespace}}, namespace="{{.}}"{{/xmlNamespace}}{{#isXmlWrapped}}, localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{/isXmlWrapped}})
19-
{{/isContainer}}
20-
{{/withXml}}
9+
{{#withXml}}
10+
@JacksonXmlProperty(localName = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#isXmlAttribute}}, isAttribute = true{{/isXmlAttribute}}{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
11+
{{#isContainer}}
12+
@JacksonXmlElementWrapper({{#isXmlWrapped}}localName = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}", {{#xmlNamespace}}namespace = "{{.}}", {{/xmlNamespace}}{{/isXmlWrapped}}useWrapping = {{isXmlWrapped}})
13+
{{/isContainer}}
14+
{{/withXml}}

modules/openapi-generator/src/main/resources/Java/libraries/feign/pojo.mustache

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,28 +47,15 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
4747
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
4848
{{/jackson}}
4949
{{#withXml}}
50-
{{#isXmlAttribute}}
51-
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
52-
{{/isXmlAttribute}}
53-
{{^isXmlAttribute}}
54-
{{^isContainer}}
55-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
56-
{{/isContainer}}
57-
{{#isContainer}}
58-
// Is a container wrapped={{isXmlWrapped}}
59-
{{#items}}
60-
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
61-
// items.example={{example}} items.type={{dataType}}
62-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
63-
{{/items}}
64-
{{#isXmlWrapped}}
65-
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
66-
{{/isXmlWrapped}}
67-
{{/isContainer}}
68-
{{#isDateTime}}
50+
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
51+
{{#isXmlWrapped}}
52+
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
53+
{{/isXmlWrapped}}
54+
{{^isXmlAttribute}}
55+
{{#isDateTime}}
6956
@XmlJavaTypeAdapter(OffsetDateTimeXmlAdapter.class)
70-
{{/isDateTime}}
71-
{{/isXmlAttribute}}
57+
{{/isDateTime}}
58+
{{/isXmlAttribute}}
7259
{{/withXml}}
7360
{{#gson}}
7461
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@@ -181,7 +168,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
181168
{{/isMap}}
182169

183170
{{/isReadOnly}}
184-
/**
171+
/**
185172
{{#description}}
186173
* {{.}}
187174
{{/description}}
@@ -198,7 +185,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
198185
{{#deprecated}}
199186
* @deprecated
200187
{{/deprecated}}
201-
**/
188+
*/
202189
{{#deprecated}}
203190
@Deprecated
204191
{{/deprecated}}

modules/openapi-generator/src/main/resources/Java/libraries/jersey2/pojo.mustache

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
5252
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
5353
{{/jackson}}
5454
{{#withXml}}
55-
{{#isXmlAttribute}}
56-
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
57-
{{/isXmlAttribute}}
58-
{{^isXmlAttribute}}
59-
{{^isContainer}}
60-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
61-
{{/isContainer}}
62-
{{#isContainer}}
63-
// Is a container wrapped={{isXmlWrapped}}
64-
{{#items}}
65-
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
66-
// items.example={{example}} items.type={{dataType}}
67-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
68-
{{/items}}
69-
{{#isXmlWrapped}}
70-
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
71-
{{/isXmlWrapped}}
72-
{{/isContainer}}
73-
{{/isXmlAttribute}}
55+
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
56+
{{#isXmlWrapped}}
57+
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
58+
{{/isXmlWrapped}}
7459
{{/withXml}}
7560
{{#gson}}
7661
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@@ -191,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
191176
{{/isMap}}
192177

193178
{{/isReadOnly}}
194-
/**
179+
/**
195180
{{#description}}
196181
* {{.}}
197182
{{/description}}
@@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
208193
{{#deprecated}}
209194
* @deprecated
210195
{{/deprecated}}
211-
**/
196+
*/
212197
{{#deprecated}}
213198
@Deprecated
214199
{{/deprecated}}

modules/openapi-generator/src/main/resources/Java/libraries/jersey3/pojo.mustache

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,25 +52,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
5252
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
5353
{{/jackson}}
5454
{{#withXml}}
55-
{{#isXmlAttribute}}
56-
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
57-
{{/isXmlAttribute}}
58-
{{^isXmlAttribute}}
59-
{{^isContainer}}
60-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
61-
{{/isContainer}}
62-
{{#isContainer}}
63-
// Is a container wrapped={{isXmlWrapped}}
64-
{{#items}}
65-
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
66-
// items.example={{example}} items.type={{dataType}}
67-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
68-
{{/items}}
69-
{{#isXmlWrapped}}
70-
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
71-
{{/isXmlWrapped}}
72-
{{/isContainer}}
73-
{{/isXmlAttribute}}
55+
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
56+
{{#isXmlWrapped}}
57+
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
58+
{{/isXmlWrapped}}
7459
{{/withXml}}
7560
{{#gson}}
7661
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@@ -191,7 +176,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
191176
{{/isMap}}
192177

193178
{{/isReadOnly}}
194-
/**
179+
/**
195180
{{#description}}
196181
* {{.}}
197182
{{/description}}
@@ -208,7 +193,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
208193
{{#deprecated}}
209194
* @deprecated
210195
{{/deprecated}}
211-
**/
196+
*/
212197
{{#deprecated}}
213198
@Deprecated
214199
{{/deprecated}}

modules/openapi-generator/src/main/resources/Java/libraries/microprofile/pojo.mustache

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
{{#withXml}}
2-
@XmlAccessorType(XmlAccessType.FIELD)
3-
{{#hasVars}} @XmlType(name = "{{classname}}", propOrder =
4-
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}}
5-
}){{/hasVars}}
2+
{{#hasVars}}@XmlType(name = "{{classname}}", propOrder =
3+
{ {{#vars}}"{{name}}"{{^-last}}, {{/-last}}{{/vars}} }
4+
){{/hasVars}}
65
{{^hasVars}}@XmlType(name = "{{classname}}"){{/hasVars}}
7-
{{^parent}}@XmlRootElement(name="{{classname}}"){{/parent}}
6+
{{> xmlAnnotation }}
87
{{/withXml}}
98
{{#jackson}}
109
@JsonPropertyOrder({
@@ -21,7 +20,7 @@
2120
{{#description}}
2221
/**
2322
* {{{.}}}
24-
**/
23+
*/
2524
{{/description}}
2625
{{>additionalModelTypeAnnotations}}
2726
{{#vendorExtensions.x-class-extra-annotation}}
@@ -35,12 +34,15 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
3534
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
3635
{{/jackson}}
3736
{{#withXml}}
38-
@XmlElement(name="{{baseName}}"{{#required}}, required = {{required}}{{/required}})
37+
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
38+
{{#isXmlWrapped}}
39+
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
40+
{{/isXmlWrapped}}
3941
{{/withXml}}
4042
{{#description}}
4143
/**
42-
* {{{.}}}
43-
**/
44+
* {{{.}}}
45+
*/
4446
{{/description}}
4547
{{^withXml}}
4648
{{#jsonb}}@JsonbProperty("{{baseName}}"){{/jsonb}}
@@ -71,7 +73,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
7173
}
7274
{{/withXml}}{{/vendorExtensions.x-has-readonly-properties}}
7375
{{#vars}}
74-
/**
76+
/**
7577
{{#description}}
7678
* {{.}}
7779
{{/description}}
@@ -88,7 +90,7 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
8890
{{#deprecated}}
8991
* @deprecated
9092
{{/deprecated}}
91-
**/
93+
**/
9294
{{#deprecated}}
9395
@Deprecated
9496
{{/deprecated}}
@@ -112,8 +114,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
112114

113115
{{^isReadOnly}}
114116
/**
115-
* Set {{name}}
116-
**/
117+
* Set {{name}}
118+
*/
117119
{{#vendorExtensions.x-setter-extra-annotation}} {{{vendorExtensions.x-setter-extra-annotation}}}
118120
{{/vendorExtensions.x-setter-extra-annotation}}{{#jackson}}{{> jackson_annotations}}{{/jackson}} public void {{setter}}({{{datatypeWithEnum}}} {{name}}) {
119121
this.{{name}} = {{name}};
@@ -148,8 +150,8 @@ public class {{classname}} {{#parent}}extends {{{.}}}{{/parent}}{{#vendorExtensi
148150
{{/vars}}
149151

150152
/**
151-
* Create a string representation of this pojo.
152-
**/
153+
* Create a string representation of this pojo.
154+
*/
153155
@Override
154156
public String toString() {
155157
StringBuilder sb = new StringBuilder();

modules/openapi-generator/src/main/resources/Java/libraries/native/pojo.mustache

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,10 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
5555
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
5656
{{/jackson}}
5757
{{#withXml}}
58-
{{#isXmlAttribute}}
59-
@XmlAttribute(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
60-
{{/isXmlAttribute}}
61-
{{^isXmlAttribute}}
62-
{{^isContainer}}
63-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
64-
{{/isContainer}}
65-
{{#isContainer}}
66-
// Is a container wrapped={{isXmlWrapped}}
67-
{{#items}}
68-
// items.name={{name}} items.baseName={{baseName}} items.xmlName={{xmlName}} items.xmlNamespace={{xmlNamespace}}
69-
// items.example={{example}} items.type={{dataType}}
70-
@XmlElement({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
71-
{{/items}}
72-
{{#isXmlWrapped}}
73-
@XmlElementWrapper({{#xmlNamespace}}namespace="{{.}}", {{/xmlNamespace}}name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
74-
{{/isXmlWrapped}}
75-
{{/isContainer}}
76-
{{/isXmlAttribute}}
58+
@Xml{{#isXmlAttribute}}Attribute{{/isXmlAttribute}}{{^isXmlAttribute}}Element{{/isXmlAttribute}}(name = "{{items.xmlName}}{{^items.xmlName}}{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}{{/items.xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
59+
{{#isXmlWrapped}}
60+
@XmlElementWrapper(name = "{{xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}"{{#xmlNamespace}}, namespace = "{{.}}"{{/xmlNamespace}})
61+
{{/isXmlWrapped}}
7762
{{/withXml}}
7863
{{#gson}}
7964
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
@@ -182,7 +167,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
182167
{{/isMap}}
183168

184169
{{/isReadOnly}}
185-
/**
170+
/**
186171
{{#description}}
187172
* {{.}}
188173
{{/description}}
@@ -199,7 +184,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
199184
{{#deprecated}}
200185
* @deprecated
201186
{{/deprecated}}
202-
**/
187+
*/
203188
{{#deprecated}}
204189
@Deprecated
205190
{{/deprecated}}
@@ -230,8 +215,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
230215
{{!unannotated, Jackson would pick this up automatically and add it *in addition* to the _JsonNullable getter field}}
231216
@JsonIgnore
232217
{{/vendorExtensions.x-is-jackson-optional-nullable}}
233-
{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}}
234-
public {{{datatypeWithEnum}}} {{getter}}() {
218+
{{^vendorExtensions.x-is-jackson-optional-nullable}}{{#jackson}}{{> jackson_annotations}}{{/jackson}}{{/vendorExtensions.x-is-jackson-optional-nullable}} public {{{datatypeWithEnum}}} {{getter}}() {
235219
{{#vendorExtensions.x-is-jackson-optional-nullable}}
236220
{{#isReadOnly}}{{! A readonly attribute doesn't have setter => jackson will set null directly if explicitly returned by API, so make sure we have an empty JsonNullable}}
237221
if ({{name}} == null) {

0 commit comments

Comments
 (0)