Skip to content

Commit

Permalink
[JAVA] Jersey3 deprecate class attribute (OpenAPITools#17223)
Browse files Browse the repository at this point in the history
* Deprecate attribute

* Generate samples
  • Loading branch information
gcatanese authored Nov 30, 2023
1 parent 77127ec commit 4a1db3f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,22 @@ 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}}
{{#deprecated}}
@Deprecated
{{/deprecated}}
private {{{datatypeWithEnum}}} {{name}}{{#defaultValue}} = {{{.}}}{{/defaultValue}};
{{/vendorExtensions.x-is-jackson-optional-nullable}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,15 @@ public class ObjectWithDeprecatedFields {
private String uuid;

public static final String JSON_PROPERTY_ID = "id";
@Deprecated
private BigDecimal id;

public static final String JSON_PROPERTY_DEPRECATED_REF = "deprecatedRef";
@Deprecated
private DeprecatedObject deprecatedRef;

public static final String JSON_PROPERTY_BARS = "bars";
@Deprecated
private List<String> bars;

public ObjectWithDeprecatedFields() {
Expand Down

0 comments on commit 4a1db3f

Please sign in to comment.