Skip to content

Commit a6f9e98

Browse files
authored
Merge pull request #8245 from stianlik/additionalPropertiesModelFix
Fix getter methods for Java model with additionalProperties
2 parents e8f6df9 + 13c34c1 commit a6f9e98

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/swagger-codegen/src/main/resources/Java/pojo.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,12 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
140140
{{{vendorExtensions.extraAnnotation}}}
141141
{{/vendorExtensions.extraAnnotation}}
142142
public {{{datatypeWithEnum}}} {{#isBoolean}}is{{/isBoolean}}{{getter}}() {
143+
{{#parent}}
144+
return {{name}} == null ? ({{{datatypeWithEnum}}}) this.get("{{name}}") : {{name}};
145+
{{/parent}}
146+
{{^parent}}
143147
return {{name}};
148+
{{/parent}}
144149
}
145150
{{^isReadOnly}}
146151

0 commit comments

Comments
 (0)