Skip to content

Commit

Permalink
[java][client][jax-rs] Add a constant for Jackson @JsonProperty (#3560)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmini authored and wing328 committed Aug 9, 2019
1 parent 65c7c1b commit 1ab7b9c
Show file tree
Hide file tree
Showing 926 changed files with 6,496 additions and 3,248 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ public class {{classname}} {{#parent}}extends {{{parent}}} {{/parent}}{{#parcela
{{/isContainer}}
{{/isEnum}}
{{#jackson}}
@JsonProperty("{{baseName}}")
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
{{#withXml}}
{{^isContainer}}
@JacksonXmlProperty({{#isXmlAttribute}}isAttribute = true, {{/isXmlAttribute}}{{#xmlNamespace}}namespace="{{xmlNamespace}}", {{/xmlNamespace}}localName = "{{#xmlName}}{{xmlName}}{{/xmlName}}{{^xmlName}}{{baseName}}{{/xmlName}}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ public class {{classname}} {{#parent}}extends {{{parent}}}{{/parent}} {{#seriali
{{/isContainer}}
{{/isEnum}}
{{#jackson}}
@JsonProperty("{{baseName}}")
public static final String JSON_PROPERTY_{{nameInSnakeCase}} = "{{baseName}}";
@JsonProperty(JSON_PROPERTY_{{nameInSnakeCase}})
{{/jackson}}
{{#gson}}
@SerializedName("{{baseName}}")
public static final String SERIALIZED_NAME_{{nameInSnakeCase}} = "{{baseName}}";
@SerializedName(SERIALIZED_NAME_{{nameInSnakeCase}})
{{/gson}}
{{#isContainer}}
private {{{datatypeWithEnum}}} {{name}}{{#required}} = {{{defaultValue}}}{{/required}}{{^required}} = null{{/required}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
*/

public class AdditionalPropertiesAnyType extends HashMap<String, Object> {
@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name;

public AdditionalPropertiesAnyType name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
*/

public class AdditionalPropertiesArray extends HashMap<String, List> {
@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name;

public AdditionalPropertiesArray name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
*/

public class AdditionalPropertiesBoolean extends HashMap<String, Boolean> {
@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name;

public AdditionalPropertiesBoolean name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,37 +30,48 @@
*/

public class AdditionalPropertiesClass {
@JsonProperty("map_string")
public static final String JSON_PROPERTY_MAP_STRING = "map_string";
@JsonProperty(JSON_PROPERTY_MAP_STRING)
private Map<String, String> mapString = new HashMap<String, String>();

@JsonProperty("map_number")
public static final String JSON_PROPERTY_MAP_NUMBER = "map_number";
@JsonProperty(JSON_PROPERTY_MAP_NUMBER)
private Map<String, BigDecimal> mapNumber = new HashMap<String, BigDecimal>();

@JsonProperty("map_integer")
public static final String JSON_PROPERTY_MAP_INTEGER = "map_integer";
@JsonProperty(JSON_PROPERTY_MAP_INTEGER)
private Map<String, Integer> mapInteger = new HashMap<String, Integer>();

@JsonProperty("map_boolean")
public static final String JSON_PROPERTY_MAP_BOOLEAN = "map_boolean";
@JsonProperty(JSON_PROPERTY_MAP_BOOLEAN)
private Map<String, Boolean> mapBoolean = new HashMap<String, Boolean>();

@JsonProperty("map_array_integer")
public static final String JSON_PROPERTY_MAP_ARRAY_INTEGER = "map_array_integer";
@JsonProperty(JSON_PROPERTY_MAP_ARRAY_INTEGER)
private Map<String, List<Integer>> mapArrayInteger = new HashMap<String, List<Integer>>();

@JsonProperty("map_array_anytype")
public static final String JSON_PROPERTY_MAP_ARRAY_ANYTYPE = "map_array_anytype";
@JsonProperty(JSON_PROPERTY_MAP_ARRAY_ANYTYPE)
private Map<String, List<Object>> mapArrayAnytype = new HashMap<String, List<Object>>();

@JsonProperty("map_map_string")
public static final String JSON_PROPERTY_MAP_MAP_STRING = "map_map_string";
@JsonProperty(JSON_PROPERTY_MAP_MAP_STRING)
private Map<String, Map<String, String>> mapMapString = new HashMap<String, Map<String, String>>();

@JsonProperty("map_map_anytype")
public static final String JSON_PROPERTY_MAP_MAP_ANYTYPE = "map_map_anytype";
@JsonProperty(JSON_PROPERTY_MAP_MAP_ANYTYPE)
private Map<String, Map<String, Object>> mapMapAnytype = new HashMap<String, Map<String, Object>>();

@JsonProperty("anytype_1")
public static final String JSON_PROPERTY_ANYTYPE1 = "anytype_1";
@JsonProperty(JSON_PROPERTY_ANYTYPE1)
private Object anytype1 = null;

@JsonProperty("anytype_2")
public static final String JSON_PROPERTY_ANYTYPE2 = "anytype_2";
@JsonProperty(JSON_PROPERTY_ANYTYPE2)
private Object anytype2 = null;

@JsonProperty("anytype_3")
public static final String JSON_PROPERTY_ANYTYPE3 = "anytype_3";
@JsonProperty(JSON_PROPERTY_ANYTYPE3)
private Object anytype3 = null;

public AdditionalPropertiesClass mapString(Map<String, String> mapString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
*/

public class AdditionalPropertiesInteger extends HashMap<String, Integer> {
@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name;

public AdditionalPropertiesInteger name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
*/

public class AdditionalPropertiesNumber extends HashMap<String, BigDecimal> {
@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name;

public AdditionalPropertiesNumber name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
*/

public class AdditionalPropertiesObject extends HashMap<String, Map> {
@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name;

public AdditionalPropertiesObject name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
*/

public class AdditionalPropertiesString extends HashMap<String, String> {
@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name;

public AdditionalPropertiesString name(String name) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@
})

public class Animal {
@JsonProperty("className")
public static final String JSON_PROPERTY_CLASS_NAME = "className";
@JsonProperty(JSON_PROPERTY_CLASS_NAME)
private String className;

@JsonProperty("color")
public static final String JSON_PROPERTY_COLOR = "color";
@JsonProperty(JSON_PROPERTY_COLOR)
private String color = "red";

public Animal className(String className) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
*/

public class ArrayOfArrayOfNumberOnly {
@JsonProperty("ArrayArrayNumber")
public static final String JSON_PROPERTY_ARRAY_ARRAY_NUMBER = "ArrayArrayNumber";
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_NUMBER)
private List<List<BigDecimal>> arrayArrayNumber = new ArrayList<List<BigDecimal>>();

public ArrayOfArrayOfNumberOnly arrayArrayNumber(List<List<BigDecimal>> arrayArrayNumber) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
*/

public class ArrayOfNumberOnly {
@JsonProperty("ArrayNumber")
public static final String JSON_PROPERTY_ARRAY_NUMBER = "ArrayNumber";
@JsonProperty(JSON_PROPERTY_ARRAY_NUMBER)
private List<BigDecimal> arrayNumber = new ArrayList<BigDecimal>();

public ArrayOfNumberOnly arrayNumber(List<BigDecimal> arrayNumber) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,16 @@
*/

public class ArrayTest {
@JsonProperty("array_of_string")
public static final String JSON_PROPERTY_ARRAY_OF_STRING = "array_of_string";
@JsonProperty(JSON_PROPERTY_ARRAY_OF_STRING)
private List<String> arrayOfString = new ArrayList<String>();

@JsonProperty("array_array_of_integer")
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER = "array_array_of_integer";
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_INTEGER)
private List<List<Long>> arrayArrayOfInteger = new ArrayList<List<Long>>();

@JsonProperty("array_array_of_model")
public static final String JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL = "array_array_of_model";
@JsonProperty(JSON_PROPERTY_ARRAY_ARRAY_OF_MODEL)
private List<List<ReadOnlyFirst>> arrayArrayOfModel = new ArrayList<List<ReadOnlyFirst>>();

public ArrayTest arrayOfString(List<String> arrayOfString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,28 @@
*/

public class Capitalization {
@JsonProperty("smallCamel")
public static final String JSON_PROPERTY_SMALL_CAMEL = "smallCamel";
@JsonProperty(JSON_PROPERTY_SMALL_CAMEL)
private String smallCamel;

@JsonProperty("CapitalCamel")
public static final String JSON_PROPERTY_CAPITAL_CAMEL = "CapitalCamel";
@JsonProperty(JSON_PROPERTY_CAPITAL_CAMEL)
private String capitalCamel;

@JsonProperty("small_Snake")
public static final String JSON_PROPERTY_SMALL_SNAKE = "small_Snake";
@JsonProperty(JSON_PROPERTY_SMALL_SNAKE)
private String smallSnake;

@JsonProperty("Capital_Snake")
public static final String JSON_PROPERTY_CAPITAL_SNAKE = "Capital_Snake";
@JsonProperty(JSON_PROPERTY_CAPITAL_SNAKE)
private String capitalSnake;

@JsonProperty("SCA_ETH_Flow_Points")
public static final String JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS = "SCA_ETH_Flow_Points";
@JsonProperty(JSON_PROPERTY_SC_A_E_T_H_FLOW_POINTS)
private String scAETHFlowPoints;

@JsonProperty("ATT_NAME")
public static final String JSON_PROPERTY_A_T_T_N_A_M_E = "ATT_NAME";
@JsonProperty(JSON_PROPERTY_A_T_T_N_A_M_E)
private String ATT_NAME;

public Capitalization smallCamel(String smallCamel) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
*/

public class Cat extends Animal {
@JsonProperty("declawed")
public static final String JSON_PROPERTY_DECLAWED = "declawed";
@JsonProperty(JSON_PROPERTY_DECLAWED)
private Boolean declawed;

public Cat declawed(Boolean declawed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
*/

public class CatAllOf {
@JsonProperty("declawed")
public static final String JSON_PROPERTY_DECLAWED = "declawed";
@JsonProperty(JSON_PROPERTY_DECLAWED)
private Boolean declawed;

public CatAllOf declawed(Boolean declawed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@
*/

public class Category {
@JsonProperty("id")
public static final String JSON_PROPERTY_ID = "id";
@JsonProperty(JSON_PROPERTY_ID)
private Long id;

@JsonProperty("name")
public static final String JSON_PROPERTY_NAME = "name";
@JsonProperty(JSON_PROPERTY_NAME)
private String name = "default-name";

public Category id(Long id) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
@ApiModel(description = "Model for testing model with \"_class\" property")

public class ClassModel {
@JsonProperty("_class")
public static final String JSON_PROPERTY_PROPERTY_CLASS = "_class";
@JsonProperty(JSON_PROPERTY_PROPERTY_CLASS)
private String propertyClass;

public ClassModel propertyClass(String propertyClass) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
*/

public class Client {
@JsonProperty("client")
public static final String JSON_PROPERTY_CLIENT = "client";
@JsonProperty(JSON_PROPERTY_CLIENT)
private String client;

public Client client(String client) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
*/

public class Dog extends Animal {
@JsonProperty("breed")
public static final String JSON_PROPERTY_BREED = "breed";
@JsonProperty(JSON_PROPERTY_BREED)
private String breed;

public Dog breed(String breed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
*/

public class DogAllOf {
@JsonProperty("breed")
public static final String JSON_PROPERTY_BREED = "breed";
@JsonProperty(JSON_PROPERTY_BREED)
private String breed;

public DogAllOf breed(String breed) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ public static JustSymbolEnum fromValue(String value) {
}
}

@JsonProperty("just_symbol")
public static final String JSON_PROPERTY_JUST_SYMBOL = "just_symbol";
@JsonProperty(JSON_PROPERTY_JUST_SYMBOL)
private JustSymbolEnum justSymbol;

/**
Expand Down Expand Up @@ -101,7 +102,8 @@ public static ArrayEnumEnum fromValue(String value) {
}
}

@JsonProperty("array_enum")
public static final String JSON_PROPERTY_ARRAY_ENUM = "array_enum";
@JsonProperty(JSON_PROPERTY_ARRAY_ENUM)
private List<ArrayEnumEnum> arrayEnum = new ArrayList<ArrayEnumEnum>();

public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ public static EnumStringEnum fromValue(String value) {
}
}

@JsonProperty("enum_string")
public static final String JSON_PROPERTY_ENUM_STRING = "enum_string";
@JsonProperty(JSON_PROPERTY_ENUM_STRING)
private EnumStringEnum enumString;

/**
Expand Down Expand Up @@ -104,7 +105,8 @@ public static EnumStringRequiredEnum fromValue(String value) {
}
}

@JsonProperty("enum_string_required")
public static final String JSON_PROPERTY_ENUM_STRING_REQUIRED = "enum_string_required";
@JsonProperty(JSON_PROPERTY_ENUM_STRING_REQUIRED)
private EnumStringRequiredEnum enumStringRequired;

/**
Expand Down Expand Up @@ -142,7 +144,8 @@ public static EnumIntegerEnum fromValue(Integer value) {
}
}

@JsonProperty("enum_integer")
public static final String JSON_PROPERTY_ENUM_INTEGER = "enum_integer";
@JsonProperty(JSON_PROPERTY_ENUM_INTEGER)
private EnumIntegerEnum enumInteger;

/**
Expand Down Expand Up @@ -180,10 +183,12 @@ public static EnumNumberEnum fromValue(Double value) {
}
}

@JsonProperty("enum_number")
public static final String JSON_PROPERTY_ENUM_NUMBER = "enum_number";
@JsonProperty(JSON_PROPERTY_ENUM_NUMBER)
private EnumNumberEnum enumNumber;

@JsonProperty("outerEnum")
public static final String JSON_PROPERTY_OUTER_ENUM = "outerEnum";
@JsonProperty(JSON_PROPERTY_OUTER_ENUM)
private OuterEnum outerEnum;

public EnumTest enumString(EnumStringEnum enumString) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
*/

public class FileSchemaTestClass {
@JsonProperty("file")
public static final String JSON_PROPERTY_FILE = "file";
@JsonProperty(JSON_PROPERTY_FILE)
private java.io.File file = null;

@JsonProperty("files")
public static final String JSON_PROPERTY_FILES = "files";
@JsonProperty(JSON_PROPERTY_FILES)
private List<java.io.File> files = new ArrayList<java.io.File>();

public FileSchemaTestClass file(java.io.File file) {
Expand Down
Loading

0 comments on commit 1ab7b9c

Please sign in to comment.