Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1481,7 +1481,10 @@ public CodegenProperty fromProperty(String name, Property p) {
property.title = p.getTitle();
property.getter = "get" + getterAndSetterCapitalize(name);
property.setter = "set" + getterAndSetterCapitalize(name);
property.example = toExampleValue(p);
String example = toExampleValue(p);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of change the logic in this function (which may affect things elsewhere) just don't set a property value if the example is the string null.

if(!"null".equals(example)) {
property.example = example;
}
property.defaultValue = toDefaultValue(p);
property.defaultValueWithParam = toDefaultValueWithParam(name, p);
property.jsonSchema = Json.pretty(p);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public AdditionalPropertiesClass putMapPropertyItem(String key, String mapProper
* Get mapProperty
* @return mapProperty
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Map<String, String> getMapProperty() {
return mapProperty;
}
Expand All @@ -70,7 +70,7 @@ public AdditionalPropertiesClass putMapOfMapPropertyItem(String key, Map<String,
* Get mapOfMapProperty
* @return mapOfMapProperty
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Map<String, Map<String, String>> getMapOfMapProperty() {
return mapOfMapProperty;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public Animal className(String className) {
* Get className
* @return className
**/
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
public String getClassName() {
return className;
}
Expand All @@ -64,7 +64,7 @@ public Animal color(String color) {
* Get color
* @return color
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getColor() {
return color;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ArrayOfArrayOfNumberOnly addArrayArrayNumberItem(List<BigDecimal> arrayAr
* Get arrayArrayNumber
* @return arrayArrayNumber
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public List<List<BigDecimal>> getArrayArrayNumber() {
return arrayArrayNumber;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public ArrayOfNumberOnly addArrayNumberItem(BigDecimal arrayNumberItem) {
* Get arrayNumber
* @return arrayNumber
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public List<BigDecimal> getArrayNumber() {
return arrayNumber;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ArrayTest addArrayOfStringItem(String arrayOfStringItem) {
* Get arrayOfString
* @return arrayOfString
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public List<String> getArrayOfString() {
return arrayOfString;
}
Expand All @@ -73,7 +73,7 @@ public ArrayTest addArrayArrayOfIntegerItem(List<Long> arrayArrayOfIntegerItem)
* Get arrayArrayOfInteger
* @return arrayArrayOfInteger
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public List<List<Long>> getArrayArrayOfInteger() {
return arrayArrayOfInteger;
}
Expand All @@ -96,7 +96,7 @@ public ArrayTest addArrayArrayOfModelItem(List<ReadOnlyFirst> arrayArrayOfModelI
* Get arrayArrayOfModel
* @return arrayArrayOfModel
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public List<List<ReadOnlyFirst>> getArrayArrayOfModel() {
return arrayArrayOfModel;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public Capitalization smallCamel(String smallCamel) {
* Get smallCamel
* @return smallCamel
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getSmallCamel() {
return smallCamel;
}
Expand All @@ -69,7 +69,7 @@ public Capitalization capitalCamel(String capitalCamel) {
* Get capitalCamel
* @return capitalCamel
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getCapitalCamel() {
return capitalCamel;
}
Expand All @@ -87,7 +87,7 @@ public Capitalization smallSnake(String smallSnake) {
* Get smallSnake
* @return smallSnake
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getSmallSnake() {
return smallSnake;
}
Expand All @@ -105,7 +105,7 @@ public Capitalization capitalSnake(String capitalSnake) {
* Get capitalSnake
* @return capitalSnake
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getCapitalSnake() {
return capitalSnake;
}
Expand All @@ -123,7 +123,7 @@ public Capitalization scAETHFlowPoints(String scAETHFlowPoints) {
* Get scAETHFlowPoints
* @return scAETHFlowPoints
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getScAETHFlowPoints() {
return scAETHFlowPoints;
}
Expand All @@ -141,7 +141,7 @@ public Capitalization ATT_NAME(String ATT_NAME) {
* Name of the pet
* @return ATT_NAME
**/
@ApiModelProperty(example = "null", value = "Name of the pet ")
@ApiModelProperty(value = "Name of the pet ")
public String getATTNAME() {
return ATT_NAME;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Cat declawed(Boolean declawed) {
* Get declawed
* @return declawed
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Boolean getDeclawed() {
return declawed;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public Category id(Long id) {
* Get id
* @return id
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Long getId() {
return id;
}
Expand All @@ -57,7 +57,7 @@ public Category name(String name) {
* Get name
* @return name
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getName() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public ClassModel propertyClass(String propertyClass) {
* Get propertyClass
* @return propertyClass
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getPropertyClass() {
return propertyClass;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public Client client(String client) {
* Get client
* @return client
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getClient() {
return client;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public Dog breed(String breed) {
* Get breed
* @return breed
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getBreed() {
return breed;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public EnumArrays justSymbol(JustSymbolEnum justSymbol) {
* Get justSymbol
* @return justSymbol
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public JustSymbolEnum getJustSymbol() {
return justSymbol;
}
Expand All @@ -124,7 +124,7 @@ public EnumArrays addArrayEnumItem(ArrayEnumEnum arrayEnumItem) {
* Get arrayEnum
* @return arrayEnum
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public List<ArrayEnumEnum> getArrayEnum() {
return arrayEnum;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ public EnumTest enumString(EnumStringEnum enumString) {
* Get enumString
* @return enumString
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public EnumStringEnum getEnumString() {
return enumString;
}
Expand All @@ -156,7 +156,7 @@ public EnumTest enumInteger(EnumIntegerEnum enumInteger) {
* Get enumInteger
* @return enumInteger
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public EnumIntegerEnum getEnumInteger() {
return enumInteger;
}
Expand All @@ -174,7 +174,7 @@ public EnumTest enumNumber(EnumNumberEnum enumNumber) {
* Get enumNumber
* @return enumNumber
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public EnumNumberEnum getEnumNumber() {
return enumNumber;
}
Expand All @@ -192,7 +192,7 @@ public EnumTest outerEnum(OuterEnum outerEnum) {
* Get outerEnum
* @return outerEnum
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public OuterEnum getOuterEnum() {
return outerEnum;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public FormatTest integer(Integer integer) {
* maximum: 100
* @return integer
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Integer getInteger() {
return integer;
}
Expand All @@ -98,7 +98,7 @@ public FormatTest int32(Integer int32) {
* maximum: 200
* @return int32
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Integer getInt32() {
return int32;
}
Expand All @@ -116,7 +116,7 @@ public FormatTest int64(Long int64) {
* Get int64
* @return int64
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Long getInt64() {
return int64;
}
Expand All @@ -136,7 +136,7 @@ public FormatTest number(BigDecimal number) {
* maximum: 543.2
* @return number
**/
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
public BigDecimal getNumber() {
return number;
}
Expand All @@ -156,7 +156,7 @@ public FormatTest _float(Float _float) {
* maximum: 987.6
* @return _float
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Float getFloat() {
return _float;
}
Expand All @@ -176,7 +176,7 @@ public FormatTest _double(Double _double) {
* maximum: 123.4
* @return _double
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public Double getDouble() {
return _double;
}
Expand All @@ -194,7 +194,7 @@ public FormatTest string(String string) {
* Get string
* @return string
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getString() {
return string;
}
Expand All @@ -212,7 +212,7 @@ public FormatTest _byte(byte[] _byte) {
* Get _byte
* @return _byte
**/
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
public byte[] getByte() {
return _byte;
}
Expand All @@ -230,7 +230,7 @@ public FormatTest binary(byte[] binary) {
* Get binary
* @return binary
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public byte[] getBinary() {
return binary;
}
Expand All @@ -248,7 +248,7 @@ public FormatTest date(LocalDate date) {
* Get date
* @return date
**/
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
public LocalDate getDate() {
return date;
}
Expand All @@ -266,7 +266,7 @@ public FormatTest dateTime(DateTime dateTime) {
* Get dateTime
* @return dateTime
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public DateTime getDateTime() {
return dateTime;
}
Expand All @@ -284,7 +284,7 @@ public FormatTest uuid(UUID uuid) {
* Get uuid
* @return uuid
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public UUID getUuid() {
return uuid;
}
Expand All @@ -302,7 +302,7 @@ public FormatTest password(String password) {
* Get password
* @return password
**/
@ApiModelProperty(example = "null", required = true, value = "")
@ApiModelProperty(required = true, value = "")
public String getPassword() {
return password;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class HasOnlyReadOnly {
* Get bar
* @return bar
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getBar() {
return bar;
}
Expand All @@ -43,7 +43,7 @@ public String getBar() {
* Get foo
* @return foo
**/
@ApiModelProperty(example = "null", value = "")
@ApiModelProperty(value = "")
public String getFoo() {
return foo;
}
Expand Down
Loading