forked from loafle/openapi-generator-original
[Java] Support Deprecation of Generated enum-classes (#22312)
* [Java] Annotate Deprecated `enum`-classes with `@Deprecated` * Update Generated 'samples'-files Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> * Update `modelEnum.mustache` According to Review Comment Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> * Update Generated 'sample'-files Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> * Update Java Native `modelEnum.mustache` File Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> * Update Java JaxRS `modelEnum.mustache` File Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> * Update Java Okhttp-gson `modelEnum.mustache` File Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> * Update Java Micronaut `modelEnum.mustache` File Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> * Update Java Helidon `modelEnum.mustache` File Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com> --------- Signed-off-by: Chrimle <28791817+Chrimle@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
2ab5365fb2
commit
ec8ca20dec
@@ -17,6 +17,9 @@ import java.util.Locale;
|
||||
/**
|
||||
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
{{#gson}}
|
||||
@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class)
|
||||
{{/gson}}
|
||||
|
||||
@@ -12,6 +12,9 @@ import com.google.gson.stream.JsonWriter;
|
||||
/**
|
||||
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class)
|
||||
{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}{{#vendorExtensions.x-implements}}{{#-first}} implements {{{.}}}{{/-first}}{{^-first}}, {{{.}}}{{/-first}}{{/vendorExtensions.x-implements}} {
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
|
||||
@@ -17,6 +17,9 @@ import java.util.Locale;
|
||||
/**
|
||||
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
{{#gson}}
|
||||
@JsonAdapter({{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}}.Adapter.class)
|
||||
{{/gson}}
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
/**
|
||||
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
{{>additionalEnumTypeAnnotations}}public enum {{{datatypeWithEnum}}}{{^datatypeWithEnum}}{{{classname}}}{{/datatypeWithEnum}} {
|
||||
{{#gson}}
|
||||
{{#allowableValues}}{{#enumVars}}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
/**
|
||||
* {{description}}{{^description}}Gets or Sets {{{name}}}{{/description}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
{{#jsonb}}
|
||||
@JsonbTypeSerializer({{datatypeWithEnum}}.Serializer.class)
|
||||
@JsonbTypeDeserializer({{datatypeWithEnum}}.Deserializer.class)
|
||||
|
||||
@@ -6,6 +6,9 @@ import com.fasterxml.jackson.annotation.JsonValue;
|
||||
/**
|
||||
* {{^description}}Gets or Sets {{{name}}}{{/description}}{{#description}}{{description}}{{/description}}
|
||||
*/
|
||||
{{#isDeprecated}}
|
||||
@Deprecated
|
||||
{{/isDeprecated}}
|
||||
{{#additionalEnumTypeAnnotations}}
|
||||
{{{.}}}
|
||||
{{/additionalEnumTypeAnnotations}}{{#useBeanValidation}}@Introspected
|
||||
|
||||
Reference in New Issue
Block a user