Skip to content

Commit

Permalink
process deprecated flag from json schema
Browse files Browse the repository at this point in the history
  • Loading branch information
maltesmann authored Nov 18, 2024
1 parent 3a7f6de commit 083b686
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ public class {{allName}} {
*/{% endif %}
@JsonProperty("{{propName}}")
{%- if propName | isRequired(schema.required()) %}@NotNull{% endif %}
{%- if prop.deprecated() %}@Deprecated{% endif %}
{%- if prop.minLength() or prop.maxLength() or prop.maxItems() or prop.minItems() %}@Size({% if prop.minLength() or prop.minItems() %}min = {{prop.minLength()}}{{prop.minItems()}}{% endif %}{% if prop.maxLength() or prop.maxItems() %}{% if prop.minLength() or prop.minItems() %},{% endif %}max = {{prop.maxLength()}}{{prop.maxItems()}}{% endif %}){% endif %}
{%- if prop.pattern() %}@Pattern(regexp="{{prop.pattern() | addBackSlashToPattern}}"){% endif %}
{%- if prop.minimum() %}@Min({{prop.minimum()}}){% endif %}{% if prop.exclusiveMinimum() %}@Min({{prop.exclusiveMinimum() + 1}}){% endif %}
Expand All @@ -152,6 +153,7 @@ public class {{allName}} {
return {{varName}};
}

{% if prop.deprecated() -%}@Deprecated{%- endif %}
public void set{{className}}({{propType}} {{varName}}) {
this.{{varName}} = {{varName}};
}
Expand Down Expand Up @@ -199,4 +201,4 @@ private String toIndentedString(Object o) {
}
return o.toString().replace("\n", "\n ");
}
}
}

0 comments on commit 083b686

Please sign in to comment.