Skip to content

Commit

Permalink
Jersey3 OpenAPI templates: deprecated attributes (#1189)
Browse files Browse the repository at this point in the history
* Deprecate class attribute

* Deprecate builder method

---------

Co-authored-by: jillingk <[email protected]>
Co-authored-by: Wouter Boereboom <[email protected]>
Co-authored-by: Djoyke Reijans <[email protected]>
  • Loading branch information
4 people authored Feb 22, 2024
1 parent 049af2b commit fbd27d5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions templates/libraries/jersey3/pojo.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,29 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
{{/vendorExtensions.x-field-extra-annotation}}
{{#vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
{{#deprecated}}
@Deprecated
{{/deprecated}}
private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>undefined();
{{/isContainer}}
{{^isContainer}}
{{#deprecated}}
@Deprecated
{{/deprecated}}
private JsonNullable<{{{datatypeWithEnum}}}> {{name}} = JsonNullable.<{{{datatypeWithEnum}}}>{{#defaultValue}}of({{{.}}}){{/defaultValue}}{{^defaultValue}}undefined(){{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
{{^vendorExtensions.x-is-jackson-optional-nullable}}
{{#isContainer}}
{{#deprecated}}
@Deprecated
{{/deprecated}}
private {{{datatypeWithEnum}}} {{name}}{{#required}}{{#defaultValue}} = {{{.}}}{{/defaultValue}}{{/required}}{{^required}} = null{{/required}};
{{/isContainer}}
{{^isContainer}}
{{#deprecated}}
@Deprecated
{{/deprecated}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/isContainer}}
{{/vendorExtensions.x-is-jackson-optional-nullable}}
Expand All @@ -99,6 +111,9 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens
));

{{/vendorExtensions.x-enum-as-string}}
{{#deprecated}}
@Deprecated
{{/deprecated}}
public {{classname}} {{name}}({{{datatypeWithEnum}}} {{name}}) {
{{#vendorExtensions.x-enum-as-string}}
if (!{{{nameInSnakeCase}}}_VALUES.contains({{name}})) {
Expand Down

0 comments on commit fbd27d5

Please sign in to comment.