Add "decimal" support (#7808)

* rename BigDecimal to decimal

* add isDecimal

* fix tests

* minor fixes

* fix mapping, update doc

* update test spec

* update c# samples
This commit is contained in:
William Cheng
2020-11-02 21:31:32 +08:00
committed by GitHub
parent ca6fcaf92a
commit 9377dbca56
68 changed files with 391 additions and 65 deletions

View File

@@ -43,6 +43,7 @@ import org.openapitools.client.JSON;
FormatTest.JSON_PROPERTY_NUMBER,
FormatTest.JSON_PROPERTY_FLOAT,
FormatTest.JSON_PROPERTY_DOUBLE,
FormatTest.JSON_PROPERTY_DECIMAL,
FormatTest.JSON_PROPERTY_STRING,
FormatTest.JSON_PROPERTY_BYTE,
FormatTest.JSON_PROPERTY_BINARY,
@@ -73,6 +74,9 @@ public class FormatTest {
public static final String JSON_PROPERTY_DOUBLE = "double";
private Double _double;
public static final String JSON_PROPERTY_DECIMAL = "decimal";
private BigDecimal decimal;
public static final String JSON_PROPERTY_STRING = "string";
private String string;
@@ -254,6 +258,30 @@ public class FormatTest {
}
public FormatTest decimal(BigDecimal decimal) {
this.decimal = decimal;
return this;
}
/**
* Get decimal
* @return decimal
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_DECIMAL)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public BigDecimal getDecimal() {
return decimal;
}
public void setDecimal(BigDecimal decimal) {
this.decimal = decimal;
}
public FormatTest string(String string) {
this.string = string;
return this;
@@ -485,6 +513,7 @@ public class FormatTest {
Objects.equals(this.number, formatTest.number) &&
Objects.equals(this._float, formatTest._float) &&
Objects.equals(this._double, formatTest._double) &&
Objects.equals(this.decimal, formatTest.decimal) &&
Objects.equals(this.string, formatTest.string) &&
Arrays.equals(this._byte, formatTest._byte) &&
Objects.equals(this.binary, formatTest.binary) &&
@@ -498,7 +527,7 @@ public class FormatTest {
@Override
public int hashCode() {
return Objects.hash(integer, int32, int64, number, _float, _double, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter);
return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, Arrays.hashCode(_byte), binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter);
}
@@ -512,6 +541,7 @@ public class FormatTest {
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" _float: ").append(toIndentedString(_float)).append("\n");
sb.append(" _double: ").append(toIndentedString(_double)).append("\n");
sb.append(" decimal: ").append(toIndentedString(decimal)).append("\n");
sb.append(" string: ").append(toIndentedString(string)).append("\n");
sb.append(" _byte: ").append(toIndentedString(_byte)).append("\n");
sb.append(" binary: ").append(toIndentedString(binary)).append("\n");