diff --git a/README.md b/README.md index 4febf93a6..c12c09d03 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ BOAT is still under development and subject to change. ## 0.17.12 * BoatJavaCodeGen, BoatSpringCodeGen - * Fix: [always generate collection initializer when array is required in the schema (even if containerDefaultToNull=true)](https://github.com/Backbase/backbase-openapi-tools/issues/615) + * Fix: Always generate collection initializer when array is required in the schema (even if containerDefaultToNull=true) + * Fix: [validated pojo referenced class causes invalid code to be generated](https://github.com/Backbase/backbase-openapi-tools/issues/615) + * Fix: boat-java pojo template to support `useWithModifier` to generate `withSomething` methods; fixes referencing 'common' classes generated using boat-spring templates. ## 0.17.11 * BoatJavaCodeGen, BoatSpringCodeGen * Fix: always generate collection initializer when array is required in the schema (even if containerDefaultToNull=true) diff --git a/boat-scaffold/src/main/templates/boat-java/pojo.mustache b/boat-scaffold/src/main/templates/boat-java/pojo.mustache index 61f63e966..27013bc68 100644 --- a/boat-scaffold/src/main/templates/boat-java/pojo.mustache +++ b/boat-scaffold/src/main/templates/boat-java/pojo.mustache @@ -126,7 +126,7 @@ public {{classname}}() { {{#vars}} {{^isReadOnly}} - public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + public {{classname}} {{#useWithModifiers}}with{{nameInCamelCase}}{{/useWithModifiers}}{{^useWithModifiers}}{{name}}{{/useWithModifiers}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{name}});{{/vendorExtensions.x-is-jackson-optional-nullable}} {{^vendorExtensions.x-is-jackson-optional-nullable}}this.{{name}} = {{name}};{{/vendorExtensions.x-is-jackson-optional-nullable}} return this; @@ -274,7 +274,7 @@ public {{classname}}() { {{#allVars}} {{#isOverridden}} @Override - public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) { + public {{classname}} {{#useWithModifiers}}with{{nameInCamelCase}}{{/useWithModifiers}}{{^useWithModifiers}}{{name}}{{/useWithModifiers}}({{{datatypeWithEnum}}} {{name}}) { {{#vendorExtensions.x-is-jackson-optional-nullable}} this.{{setter}}(JsonNullable.<{{{datatypeWithEnum}}}>of({{name}})); {{/vendorExtensions.x-is-jackson-optional-nullable}}