mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-09 10:46:09 +00:00
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:
@@ -63,6 +63,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
<li>DateTimeOffset?</li>
|
||||
<li>Decimal</li>
|
||||
<li>Dictionary</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
|
||||
@@ -35,6 +35,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
<li>DateTimeOffset?</li>
|
||||
<li>Decimal</li>
|
||||
<li>Dictionary</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
|
||||
@@ -46,6 +46,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
<li>DateTimeOffset?</li>
|
||||
<li>Decimal</li>
|
||||
<li>Dictionary</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
|
||||
@@ -58,6 +58,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
<li>DateTimeOffset?</li>
|
||||
<li>Decimal</li>
|
||||
<li>Dictionary</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
|
||||
@@ -55,6 +55,7 @@ These options may be applied as additional-properties (cli) or configOptions (pl
|
||||
<li>DateTime?</li>
|
||||
<li>DateTimeOffset</li>
|
||||
<li>DateTimeOffset?</li>
|
||||
<li>Decimal</li>
|
||||
<li>Dictionary</li>
|
||||
<li>Double</li>
|
||||
<li>Float</li>
|
||||
|
||||
@@ -34,7 +34,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
public String nameInLowerCase; // property name in lower case
|
||||
public String example; // example value (x-example)
|
||||
public String jsonSchema;
|
||||
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary,
|
||||
public boolean isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary,
|
||||
isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType;
|
||||
public boolean isArray, isMap;
|
||||
public boolean isFile;
|
||||
@@ -172,6 +172,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
output.isInteger = this.isInteger;
|
||||
output.isLong = this.isLong;
|
||||
output.isDouble = this.isDouble;
|
||||
output.isDecimal = this.isDecimal;
|
||||
output.isFloat = this.isFloat;
|
||||
output.isNumber = this.isNumber;
|
||||
output.isBoolean = this.isBoolean;
|
||||
@@ -193,7 +194,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore, isContainer, secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf);
|
||||
return Objects.hash(isFormParam, isQueryParam, isPathParam, isHeaderParam, isCookieParam, isBodyParam, hasMore, isContainer, secondaryParam, isCollectionFormatMulti, isPrimitiveType, isModel, isExplode, baseName, paramName, dataType, datatypeWithEnum, dataFormat, collectionFormat, description, unescapedDescription, baseType, defaultValue, enumName, style, example, jsonSchema, isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject, isAnyType, isArray, isMap, isFile, isEnum, _enum, allowableValues, items, mostInnerItems, additionalProperties, vendorExtensions, hasValidation, getMaxProperties(), getMinProperties(), isNullable, required, getMaximum(), getExclusiveMaximum(), getMinimum(), getExclusiveMinimum(), getMaxLength(), getMinLength(), getPattern(), getMaxItems(), getMinItems(), getUniqueItems(), contentType, multipleOf);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -221,6 +222,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
isNumber == that.isNumber &&
|
||||
isFloat == that.isFloat &&
|
||||
isDouble == that.isDouble &&
|
||||
isDecimal == that.isDecimal &&
|
||||
isByteArray == that.isByteArray &&
|
||||
isBinary == that.isBinary &&
|
||||
isBoolean == that.isBoolean &&
|
||||
@@ -311,6 +313,7 @@ public class CodegenParameter implements IJsonSchemaValidationProperties {
|
||||
sb.append(", isNumber=").append(isNumber);
|
||||
sb.append(", isFloat=").append(isFloat);
|
||||
sb.append(", isDouble=").append(isDouble);
|
||||
sb.append(", isDecimal=").append(isDecimal);
|
||||
sb.append(", isByteArray=").append(isByteArray);
|
||||
sb.append(", isBinary=").append(isBinary);
|
||||
sb.append(", isBoolean=").append(isBoolean);
|
||||
|
||||
@@ -124,6 +124,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
public boolean isNumber;
|
||||
public boolean isFloat;
|
||||
public boolean isDouble;
|
||||
public boolean isDecimal;
|
||||
public boolean isByteArray;
|
||||
public boolean isBinary;
|
||||
public boolean isFile;
|
||||
@@ -702,6 +703,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
sb.append(", isNumber=").append(isNumber);
|
||||
sb.append(", isFloat=").append(isFloat);
|
||||
sb.append(", isDouble=").append(isDouble);
|
||||
sb.append(", isDecimal=").append(isDecimal);
|
||||
sb.append(", isByteArray=").append(isByteArray);
|
||||
sb.append(", isBinary=").append(isBinary);
|
||||
sb.append(", isFile=").append(isFile);
|
||||
@@ -770,6 +772,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
isNumber == that.isNumber &&
|
||||
isFloat == that.isFloat &&
|
||||
isDouble == that.isDouble &&
|
||||
isDecimal == that.isDecimal &&
|
||||
isByteArray == that.isByteArray &&
|
||||
isBinary == that.isBinary &&
|
||||
isFile == that.isFile &&
|
||||
@@ -845,7 +848,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
|
||||
maxLength, minLength, pattern, example, jsonSchema, minimum, maximum,
|
||||
exclusiveMinimum, exclusiveMaximum, hasMore, required, deprecated, secondaryParam,
|
||||
hasMoreNonReadOnly, isPrimitiveType, isModel, isContainer, isString, isNumeric,
|
||||
isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBinary, isFile,
|
||||
isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBinary, isFile,
|
||||
isBoolean, isDate, isDateTime, isUuid, isUri, isEmail, isFreeFormObject,
|
||||
isArray, isMap, isEnum, isReadOnly, isWriteOnly, isNullable,
|
||||
isSelfReference, isCircularReference, isDiscriminator, _enum, allowableValues,
|
||||
|
||||
@@ -41,6 +41,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
public boolean isNumber;
|
||||
public boolean isFloat;
|
||||
public boolean isDouble;
|
||||
public boolean isDecimal;
|
||||
public boolean isByteArray;
|
||||
public boolean isBoolean;
|
||||
public boolean isDate;
|
||||
@@ -79,7 +80,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(headers, code, message, hasMore, examples, dataType, baseType, containerType, hasHeaders,
|
||||
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isByteArray, isBoolean, isDate,
|
||||
isString, isNumeric, isInteger, isLong, isNumber, isFloat, isDouble, isDecimal, isByteArray, isBoolean, isDate,
|
||||
isDateTime, isUuid, isEmail, isModel, isFreeFormObject, isAnyType, isDefault, simpleType, primitiveType,
|
||||
isMap, isArray, isBinary, isFile, schema, jsonSchema, vendorExtensions, items, additionalProperties,
|
||||
getMaxProperties(), getMinProperties(), uniqueItems, getMaxItems(), getMinItems(), getMaxLength(),
|
||||
@@ -100,6 +101,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
isNumber == that.isNumber &&
|
||||
isFloat == that.isFloat &&
|
||||
isDouble == that.isDouble &&
|
||||
isDecimal == that.isDecimal &&
|
||||
isByteArray == that.isByteArray &&
|
||||
isBoolean == that.isBoolean &&
|
||||
isDate == that.isDate &&
|
||||
@@ -351,6 +353,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
|
||||
sb.append(", isNumber=").append(isNumber);
|
||||
sb.append(", isFloat=").append(isFloat);
|
||||
sb.append(", isDouble=").append(isDouble);
|
||||
sb.append(", isDecimal=").append(isDecimal);
|
||||
sb.append(", isByteArray=").append(isByteArray);
|
||||
sb.append(", isBoolean=").append(isBoolean);
|
||||
sb.append(", isDate=").append(isDate);
|
||||
|
||||
@@ -1451,12 +1451,13 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("string", "String");
|
||||
typeMapping.put("int", "Integer");
|
||||
typeMapping.put("float", "Float");
|
||||
typeMapping.put("double", "Double");
|
||||
typeMapping.put("number", "BigDecimal");
|
||||
typeMapping.put("decimal", "BigDecimal");
|
||||
typeMapping.put("DateTime", "Date");
|
||||
typeMapping.put("long", "Long");
|
||||
typeMapping.put("short", "Short");
|
||||
typeMapping.put("char", "String");
|
||||
typeMapping.put("double", "Double");
|
||||
typeMapping.put("object", "Object");
|
||||
typeMapping.put("integer", "Integer");
|
||||
typeMapping.put("ByteArray", "byte[]");
|
||||
@@ -1464,7 +1465,6 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("file", "File");
|
||||
typeMapping.put("UUID", "UUID");
|
||||
typeMapping.put("URI", "URI");
|
||||
typeMapping.put("BigDecimal", "BigDecimal");
|
||||
typeMapping.put("AnyType", "oas_any_type_not_mapped");
|
||||
|
||||
instantiationTypes = new HashMap<String, String>();
|
||||
@@ -2016,9 +2016,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
// The 'null' type is allowed in OAS 3.1 and above. It is not supported by OAS 3.0.x,
|
||||
// though this tooling supports it.
|
||||
return "null";
|
||||
} else if (ModelUtils.isStringSchema(schema) && "number".equals(schema.getFormat())) {
|
||||
} else if (ModelUtils.isDecimalSchema(schema)) {
|
||||
// special handle of type: string, format: number
|
||||
return "BigDecimal";
|
||||
return "decimal";
|
||||
} else if (ModelUtils.isByteArraySchema(schema)) {
|
||||
return "ByteArray";
|
||||
} else if (ModelUtils.isFileSchema(schema)) {
|
||||
@@ -3156,7 +3156,29 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else if (ModelUtils.isDateTimeSchema(p)) { // date-time format
|
||||
property.isString = false; // for backward compatibility with 2.x
|
||||
property.isDateTime = true;
|
||||
} else if (ModelUtils.isDecimalSchema(p)) { // type: string, format: number
|
||||
property.isDecimal = true;
|
||||
if (p.getMinimum() != null) {
|
||||
property.minimum = String.valueOf(p.getMinimum());
|
||||
}
|
||||
if (p.getMaximum() != null) {
|
||||
property.maximum = String.valueOf(p.getMaximum());
|
||||
}
|
||||
if (p.getExclusiveMinimum() != null) {
|
||||
property.exclusiveMinimum = p.getExclusiveMinimum();
|
||||
}
|
||||
if (p.getExclusiveMaximum() != null) {
|
||||
property.exclusiveMaximum = p.getExclusiveMaximum();
|
||||
}
|
||||
if (p.getMultipleOf() != null) {
|
||||
property.multipleOf = p.getMultipleOf();
|
||||
}
|
||||
|
||||
// check if any validation rule defined
|
||||
// exclusive* are noop without corresponding min/max
|
||||
if (property.minimum != null || property.maximum != null || p.getMultipleOf() != null) {
|
||||
property.hasValidation = true;
|
||||
}
|
||||
} else if (ModelUtils.isStringSchema(p)) {
|
||||
if (ModelUtils.isByteArraySchema(p)) {
|
||||
property.isByteArray = true;
|
||||
@@ -4065,6 +4087,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else if (Boolean.TRUE.equals(cp.isFloat)) {
|
||||
r.isFloat = true;
|
||||
r.isNumeric = true;
|
||||
} else if (Boolean.TRUE.equals(cp.isDecimal)) {
|
||||
r.isDecimal = true;
|
||||
r.isNumeric = true;
|
||||
} else if (Boolean.TRUE.equals(cp.isBinary)) {
|
||||
r.isFile = true; // file = binary in OAS3
|
||||
r.isBinary = true;
|
||||
@@ -5406,6 +5431,9 @@ public class DefaultCodegen implements CodegenConfig {
|
||||
} else if (Boolean.TRUE.equals(property.isFloat)) {
|
||||
parameter.isFloat = true;
|
||||
parameter.isPrimitiveType = true;
|
||||
} else if (Boolean.TRUE.equals(property.isDecimal)) {
|
||||
parameter.isDecimal = true;
|
||||
parameter.isPrimitiveType = true;
|
||||
} else if (Boolean.TRUE.equals(property.isNumber)) {
|
||||
parameter.isNumber = true;
|
||||
parameter.isPrimitiveType = true;
|
||||
|
||||
@@ -160,6 +160,7 @@ public abstract class AbstractCSharpCodegen extends DefaultCodegen implements Co
|
||||
"DateTimeOffset",
|
||||
"Boolean",
|
||||
"Double",
|
||||
"Decimal",
|
||||
"Int32",
|
||||
"Int64",
|
||||
"Float",
|
||||
|
||||
@@ -107,7 +107,7 @@ public abstract class AbstractGoCodegen extends DefaultCodegen implements Codege
|
||||
typeMapping.put("number", "float32");
|
||||
typeMapping.put("float", "float32");
|
||||
typeMapping.put("double", "float64");
|
||||
typeMapping.put("BigDecimal", "float64");
|
||||
typeMapping.put("decimal", "float64");
|
||||
typeMapping.put("boolean", "bool");
|
||||
typeMapping.put("string", "string");
|
||||
typeMapping.put("UUID", "string");
|
||||
|
||||
@@ -1078,7 +1078,7 @@ public abstract class AbstractJavaCodegen extends DefaultCodegen implements Code
|
||||
@Override
|
||||
public void postProcessModelProperty(CodegenModel model, CodegenProperty property) {
|
||||
if (serializeBigDecimalAsString) {
|
||||
if (property.baseType.equals("BigDecimal")) {
|
||||
if ("decimal".equals(property.baseType)) {
|
||||
// we serialize BigDecimal as `string` to avoid precision loss
|
||||
property.vendorExtensions.put("x-extra-annotation", "@JsonSerialize(using = ToStringSerializer.class)");
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ public abstract class AbstractKotlinCodegen extends DefaultCodegen implements Co
|
||||
typeMapping.put("double", "kotlin.Double");
|
||||
typeMapping.put("ByteArray", "kotlin.ByteArray");
|
||||
typeMapping.put("number", "java.math.BigDecimal");
|
||||
typeMapping.put("decimal", "java.math.BigDecimal");
|
||||
typeMapping.put("date-time", "java.time.LocalDateTime");
|
||||
typeMapping.put("date", "java.time.LocalDate");
|
||||
typeMapping.put("file", "java.io.File");
|
||||
|
||||
@@ -384,14 +384,20 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
} else if (ModelUtils.isByteArraySchema(schema)) {
|
||||
example = "YQ==";
|
||||
} else if (ModelUtils.isStringSchema(schema)) {
|
||||
// a BigDecimal:
|
||||
if ("Number".equalsIgnoreCase(schema.getFormat())) {return "1";}
|
||||
if (StringUtils.isNotBlank(schema.getPattern())) return "\"a\""; // I cheat here, since it would be too complicated to generate a string from a regexp
|
||||
// decimal (type: string, format: decimal)
|
||||
if ("number".equalsIgnoreCase(schema.getFormat())) {
|
||||
return "1";
|
||||
}
|
||||
if (StringUtils.isNotBlank(schema.getPattern()))
|
||||
return "\"a\""; // I cheat here, since it would be too complicated to generate a string from a regexp
|
||||
int len = 0;
|
||||
if (null != schema.getMinLength()) len = schema.getMinLength().intValue();
|
||||
if (len < 1) len = 1;
|
||||
if (null != schema.getMinLength())
|
||||
len = schema.getMinLength().intValue();
|
||||
if (len < 1)
|
||||
len = 1;
|
||||
example = "";
|
||||
for (int i=0;i<len;i++) example += i;
|
||||
for (int i = 0; i < len; i++)
|
||||
example += i;
|
||||
} else if (ModelUtils.isIntegerSchema(schema)) {
|
||||
if (schema.getMinimum() != null)
|
||||
example = schema.getMinimum().toString();
|
||||
@@ -466,7 +472,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
if (isReservedWord(name) || name.matches("^\\d.*")) {
|
||||
name = escapeReservedWord(name);
|
||||
}
|
||||
name = name.replaceAll("-","_");
|
||||
name = name.replaceAll("-", "_");
|
||||
return name;
|
||||
}
|
||||
|
||||
@@ -545,7 +551,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
|
||||
@Override
|
||||
public String toEnumValue(String value, String datatype) {
|
||||
value = value.replaceAll("-","_");
|
||||
value = value.replaceAll("-", "_");
|
||||
if (isReservedWord(value)) {
|
||||
value = escapeReservedWord(value);
|
||||
}
|
||||
@@ -640,9 +646,9 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
@Override
|
||||
public String toModelImport(String name) {
|
||||
if (importMapping.containsKey(name)) {
|
||||
return "#include \"" +"../model/" + importMapping.get(name) + ".h\"";
|
||||
return "#include \"" + "../model/" + importMapping.get(name) + ".h\"";
|
||||
} else
|
||||
return "#include \"" +"../model/" + name + ".h\"";
|
||||
return "#include \"" + "../model/" + name + ".h\"";
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -737,7 +743,7 @@ public class CLibcurlClientCodegen extends DefaultCodegen implements CodegenConf
|
||||
|
||||
@Override
|
||||
public CodegenProperty fromProperty(String name, Schema p) {
|
||||
CodegenProperty cm = super.fromProperty(name,p);
|
||||
CodegenProperty cm = super.fromProperty(name, p);
|
||||
Schema ref = ModelUtils.getReferencedSchema(openAPI, p);
|
||||
if (ref != null) {
|
||||
if (ref.getEnum() != null) {
|
||||
|
||||
@@ -126,7 +126,7 @@ public class CSharpClientCodegen extends AbstractCSharpCodegen {
|
||||
typeMapping.put("long", "long");
|
||||
typeMapping.put("double", "double");
|
||||
typeMapping.put("number", "decimal");
|
||||
typeMapping.put("BigDecimal", "decimal");
|
||||
typeMapping.put("decimal", "decimal");
|
||||
typeMapping.put("DateTime", "DateTime");
|
||||
typeMapping.put("date", "DateTime");
|
||||
typeMapping.put("UUID", "Guid");
|
||||
|
||||
@@ -131,7 +131,7 @@ public class CSharpNetCoreClientCodegen extends AbstractCSharpCodegen {
|
||||
typeMapping.put("long", "long");
|
||||
typeMapping.put("double", "double");
|
||||
typeMapping.put("number", "decimal");
|
||||
typeMapping.put("BigDecimal", "decimal");
|
||||
typeMapping.put("decimal", "decimal");
|
||||
typeMapping.put("DateTime", "DateTime");
|
||||
typeMapping.put("date", "DateTime");
|
||||
typeMapping.put("file", "System.IO.Stream");
|
||||
|
||||
@@ -110,7 +110,7 @@ public class ErlangClientCodegen extends DefaultCodegen implements CodegenConfig
|
||||
typeMapping.put("array", "list()");
|
||||
typeMapping.put("map", "maps:map()");
|
||||
typeMapping.put("number", "integer()");
|
||||
typeMapping.put("bigdecimal", "float()");
|
||||
typeMapping.put("decimal", "float()");
|
||||
typeMapping.put("List", "list()");
|
||||
typeMapping.put("object", "maps:map()");
|
||||
typeMapping.put("file", "binary()");
|
||||
|
||||
@@ -256,7 +256,7 @@ public class HaskellHttpClientCodegen extends DefaultCodegen implements CodegenC
|
||||
typeMapping.put("float", "Float");
|
||||
typeMapping.put("double", "Double");
|
||||
typeMapping.put("number", "Double");
|
||||
typeMapping.put("BigDecimal", "Double");
|
||||
typeMapping.put("decimal", "Double");
|
||||
typeMapping.put("integer", "Int");
|
||||
typeMapping.put("file", "FilePath");
|
||||
// lib
|
||||
|
||||
@@ -154,7 +154,7 @@ public class JavascriptClientCodegen extends DefaultCodegen implements CodegenCo
|
||||
typeMapping.put("int", "Number");
|
||||
typeMapping.put("float", "Number");
|
||||
typeMapping.put("number", "Number");
|
||||
typeMapping.put("BigDecimal", "Number");
|
||||
typeMapping.put("decimal", "Number");
|
||||
typeMapping.put("DateTime", "Date");
|
||||
typeMapping.put("date", "Date");
|
||||
typeMapping.put("long", "Number");
|
||||
|
||||
@@ -231,7 +231,7 @@ public class Swift4Codegen extends DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("ByteArray", "Data");
|
||||
typeMapping.put("UUID", "UUID");
|
||||
typeMapping.put("URI", "String");
|
||||
typeMapping.put("BigDecimal", "Decimal");
|
||||
typeMapping.put("decimal", "Decimal");
|
||||
typeMapping.put("object", "Any");
|
||||
typeMapping.put("AnyType", "Any");
|
||||
|
||||
|
||||
@@ -689,6 +689,14 @@ public class ModelUtils {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean isDecimalSchema(Schema schema) {
|
||||
if (SchemaTypeUtil.STRING_TYPE.equals(schema.getType()) // type: string
|
||||
&& "number".equals(schema.getFormat())) { // format: number
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check to see if the schema is a model
|
||||
*
|
||||
|
||||
@@ -726,10 +726,13 @@ public class JavaModelTest {
|
||||
|
||||
@Test(description = "types used by inner properties should be imported")
|
||||
public void mapWithAnListOfBigDecimalTest() {
|
||||
Schema decimal = new StringSchema();
|
||||
decimal.setFormat("number");
|
||||
|
||||
Schema schema1 = new Schema()
|
||||
.description("model with Map<String, List<BigDecimal>>")
|
||||
.addProperties("map", new MapSchema()
|
||||
.additionalProperties(new ArraySchema().items(new NumberSchema())));
|
||||
.additionalProperties(new ArraySchema().items(decimal)));
|
||||
OpenAPI openAPI1 = TestUtils.createOpenAPIWithOneSchema("sample", schema1);
|
||||
JavaClientCodegen codegen1 = new JavaClientCodegen();
|
||||
codegen1.setOpenAPI(openAPI1);
|
||||
@@ -741,7 +744,7 @@ public class JavaModelTest {
|
||||
.description("model with Map<String, Map<String, List<BigDecimal>>>")
|
||||
.addProperties("map", new MapSchema()
|
||||
.additionalProperties(new MapSchema()
|
||||
.additionalProperties(new ArraySchema().items(new NumberSchema()))));
|
||||
.additionalProperties(new ArraySchema().items(decimal))));
|
||||
OpenAPI openAPI2 = TestUtils.createOpenAPIWithOneSchema("sample", schema2);
|
||||
JavaClientCodegen codegen2 = new JavaClientCodegen();
|
||||
codegen2.setOpenAPI(openAPI2);
|
||||
|
||||
@@ -1472,6 +1472,9 @@ components:
|
||||
format: double
|
||||
maximum: 123.4
|
||||
minimum: 67.8
|
||||
decimal:
|
||||
type: string
|
||||
format: number
|
||||
string:
|
||||
type: string
|
||||
pattern: '/[a-z]/i'
|
||||
|
||||
@@ -1437,6 +1437,9 @@ components:
|
||||
format: double
|
||||
maximum: 123.4
|
||||
minimum: 67.8
|
||||
decimal:
|
||||
type: string
|
||||
format: number
|
||||
string:
|
||||
type: string
|
||||
pattern: '/[a-z]/i'
|
||||
|
||||
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
||||
**Number** | **decimal** | |
|
||||
**Float** | **float** | | [optional]
|
||||
**Double** | **double** | | [optional]
|
||||
**Decimal** | **decimal** | | [optional]
|
||||
**String** | **string** | | [optional]
|
||||
**Byte** | **byte[]** | |
|
||||
**Binary** | **System.IO.Stream** | | [optional]
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="number">number (required).</param>
|
||||
/// <param name="_float">_float.</param>
|
||||
/// <param name="_double">_double.</param>
|
||||
/// <param name="_decimal">_decimal.</param>
|
||||
/// <param name="_string">_string.</param>
|
||||
/// <param name="_byte">_byte (required).</param>
|
||||
/// <param name="binary">binary.</param>
|
||||
@@ -58,7 +59,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="password">password (required).</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01..</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
{
|
||||
this.Number = number;
|
||||
// to ensure "_byte" is required (not null)
|
||||
@@ -71,6 +72,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.Int64 = int64;
|
||||
this.Float = _float;
|
||||
this.Double = _double;
|
||||
this.Decimal = _decimal;
|
||||
this.String = _string;
|
||||
this.Binary = binary;
|
||||
this.DateTime = dateTime;
|
||||
@@ -116,6 +118,12 @@ namespace Org.OpenAPITools.Model
|
||||
[DataMember(Name = "double", EmitDefaultValue = false)]
|
||||
public double Double { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Decimal
|
||||
/// </summary>
|
||||
[DataMember(Name = "decimal", EmitDefaultValue = false)]
|
||||
public decimal Decimal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// </summary>
|
||||
@@ -193,6 +201,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||
sb.Append(" Float: ").Append(Float).Append("\n");
|
||||
sb.Append(" Double: ").Append(Double).Append("\n");
|
||||
sb.Append(" Decimal: ").Append(Decimal).Append("\n");
|
||||
sb.Append(" String: ").Append(String).Append("\n");
|
||||
sb.Append(" Byte: ").Append(Byte).Append("\n");
|
||||
sb.Append(" Binary: ").Append(Binary).Append("\n");
|
||||
@@ -251,6 +260,7 @@ namespace Org.OpenAPITools.Model
|
||||
hashCode = hashCode * 59 + this.Number.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Float.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Double.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Decimal.GetHashCode();
|
||||
if (this.String != null)
|
||||
hashCode = hashCode * 59 + this.String.GetHashCode();
|
||||
if (this.Byte != null)
|
||||
|
||||
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
||||
**Number** | **decimal** | |
|
||||
**Float** | **float** | | [optional]
|
||||
**Double** | **double** | | [optional]
|
||||
**Decimal** | **decimal** | | [optional]
|
||||
**String** | **string** | | [optional]
|
||||
**Byte** | **byte[]** | |
|
||||
**Binary** | **System.IO.Stream** | | [optional]
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="number">number (required).</param>
|
||||
/// <param name="_float">_float.</param>
|
||||
/// <param name="_double">_double.</param>
|
||||
/// <param name="_decimal">_decimal.</param>
|
||||
/// <param name="_string">_string.</param>
|
||||
/// <param name="_byte">_byte (required).</param>
|
||||
/// <param name="binary">binary.</param>
|
||||
@@ -58,7 +59,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="password">password (required).</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01..</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
{
|
||||
this.Number = number;
|
||||
// to ensure "_byte" is required (not null)
|
||||
@@ -71,6 +72,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.Int64 = int64;
|
||||
this.Float = _float;
|
||||
this.Double = _double;
|
||||
this.Decimal = _decimal;
|
||||
this.String = _string;
|
||||
this.Binary = binary;
|
||||
this.DateTime = dateTime;
|
||||
@@ -116,6 +118,12 @@ namespace Org.OpenAPITools.Model
|
||||
[DataMember(Name = "double", EmitDefaultValue = false)]
|
||||
public double Double { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Decimal
|
||||
/// </summary>
|
||||
[DataMember(Name = "decimal", EmitDefaultValue = false)]
|
||||
public decimal Decimal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// </summary>
|
||||
@@ -193,6 +201,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||
sb.Append(" Float: ").Append(Float).Append("\n");
|
||||
sb.Append(" Double: ").Append(Double).Append("\n");
|
||||
sb.Append(" Decimal: ").Append(Decimal).Append("\n");
|
||||
sb.Append(" String: ").Append(String).Append("\n");
|
||||
sb.Append(" Byte: ").Append(Byte).Append("\n");
|
||||
sb.Append(" Binary: ").Append(Binary).Append("\n");
|
||||
@@ -251,6 +260,7 @@ namespace Org.OpenAPITools.Model
|
||||
hashCode = hashCode * 59 + this.Number.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Float.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Double.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Decimal.GetHashCode();
|
||||
if (this.String != null)
|
||||
hashCode = hashCode * 59 + this.String.GetHashCode();
|
||||
if (this.Byte != null)
|
||||
|
||||
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
||||
**Number** | **decimal** | |
|
||||
**Float** | **float** | | [optional]
|
||||
**Double** | **double** | | [optional]
|
||||
**Decimal** | **decimal** | | [optional]
|
||||
**String** | **string** | | [optional]
|
||||
**Byte** | **byte[]** | |
|
||||
**Binary** | **System.IO.Stream** | | [optional]
|
||||
|
||||
@@ -46,6 +46,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="number">number (required).</param>
|
||||
/// <param name="_float">_float.</param>
|
||||
/// <param name="_double">_double.</param>
|
||||
/// <param name="_decimal">_decimal.</param>
|
||||
/// <param name="_string">_string.</param>
|
||||
/// <param name="_byte">_byte (required).</param>
|
||||
/// <param name="binary">binary.</param>
|
||||
@@ -55,7 +56,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="password">password (required).</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01..</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
{
|
||||
this.Number = number;
|
||||
// to ensure "_byte" is required (not null)
|
||||
@@ -68,6 +69,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.Int64 = int64;
|
||||
this.Float = _float;
|
||||
this.Double = _double;
|
||||
this.Decimal = _decimal;
|
||||
this.String = _string;
|
||||
this.Binary = binary;
|
||||
this.DateTime = dateTime;
|
||||
@@ -112,6 +114,12 @@ namespace Org.OpenAPITools.Model
|
||||
[DataMember(Name = "double", EmitDefaultValue = false)]
|
||||
public double Double { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Decimal
|
||||
/// </summary>
|
||||
[DataMember(Name = "decimal", EmitDefaultValue = false)]
|
||||
public decimal Decimal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// </summary>
|
||||
@@ -183,6 +191,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||
sb.Append(" Float: ").Append(Float).Append("\n");
|
||||
sb.Append(" Double: ").Append(Double).Append("\n");
|
||||
sb.Append(" Decimal: ").Append(Decimal).Append("\n");
|
||||
sb.Append(" String: ").Append(String).Append("\n");
|
||||
sb.Append(" Byte: ").Append(Byte).Append("\n");
|
||||
sb.Append(" Binary: ").Append(Binary).Append("\n");
|
||||
@@ -240,6 +249,7 @@ namespace Org.OpenAPITools.Model
|
||||
hashCode = hashCode * 59 + this.Number.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Float.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Double.GetHashCode();
|
||||
hashCode = hashCode * 59 + this.Decimal.GetHashCode();
|
||||
if (this.String != null)
|
||||
hashCode = hashCode * 59 + this.String.GetHashCode();
|
||||
if (this.Byte != null)
|
||||
|
||||
@@ -11,6 +11,7 @@ Name | Type | Description | Notes
|
||||
**Number** | **decimal** | |
|
||||
**Float** | **float** | | [optional]
|
||||
**Double** | **double** | | [optional]
|
||||
**Decimal** | **decimal** | | [optional]
|
||||
**String** | **string** | | [optional]
|
||||
**Byte** | **byte[]** | |
|
||||
**Binary** | **System.IO.Stream** | | [optional]
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="number">number (required).</param>
|
||||
/// <param name="_float">_float.</param>
|
||||
/// <param name="_double">_double.</param>
|
||||
/// <param name="_decimal">_decimal.</param>
|
||||
/// <param name="_string">_string.</param>
|
||||
/// <param name="_byte">_byte (required).</param>
|
||||
/// <param name="binary">binary.</param>
|
||||
@@ -53,7 +54,7 @@ namespace Org.OpenAPITools.Model
|
||||
/// <param name="password">password (required).</param>
|
||||
/// <param name="patternWithDigits">A string that is a 10 digit number. Can have leading zeros..</param>
|
||||
/// <param name="patternWithDigitsAndDelimiter">A string starting with 'image_' (case insensitive) and one to three digits following i.e. Image_01..</param>
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
public FormatTest(int integer = default(int), int int32 = default(int), long int64 = default(long), decimal number = default(decimal), float _float = default(float), double _double = default(double), decimal _decimal = default(decimal), string _string = default(string), byte[] _byte = default(byte[]), System.IO.Stream binary = default(System.IO.Stream), DateTime date = default(DateTime), DateTime dateTime = default(DateTime), Guid uuid = default(Guid), string password = default(string), string patternWithDigits = default(string), string patternWithDigitsAndDelimiter = default(string))
|
||||
{
|
||||
// to ensure "number" is required (not null)
|
||||
if (number == null)
|
||||
@@ -100,6 +101,7 @@ namespace Org.OpenAPITools.Model
|
||||
this.Int64 = int64;
|
||||
this.Float = _float;
|
||||
this.Double = _double;
|
||||
this.Decimal = _decimal;
|
||||
this.String = _string;
|
||||
this.Binary = binary;
|
||||
this.DateTime = dateTime;
|
||||
@@ -144,6 +146,12 @@ namespace Org.OpenAPITools.Model
|
||||
[DataMember(Name="double", EmitDefaultValue=false)]
|
||||
public double Double { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets Decimal
|
||||
/// </summary>
|
||||
[DataMember(Name="decimal", EmitDefaultValue=false)]
|
||||
public decimal Decimal { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or Sets String
|
||||
/// </summary>
|
||||
@@ -215,6 +223,7 @@ namespace Org.OpenAPITools.Model
|
||||
sb.Append(" Number: ").Append(Number).Append("\n");
|
||||
sb.Append(" Float: ").Append(Float).Append("\n");
|
||||
sb.Append(" Double: ").Append(Double).Append("\n");
|
||||
sb.Append(" Decimal: ").Append(Decimal).Append("\n");
|
||||
sb.Append(" String: ").Append(String).Append("\n");
|
||||
sb.Append(" Byte: ").Append(Byte).Append("\n");
|
||||
sb.Append(" Binary: ").Append(Binary).Append("\n");
|
||||
@@ -288,6 +297,11 @@ namespace Org.OpenAPITools.Model
|
||||
(this.Double != null &&
|
||||
this.Double.Equals(input.Double))
|
||||
) &&
|
||||
(
|
||||
this.Decimal == input.Decimal ||
|
||||
(this.Decimal != null &&
|
||||
this.Decimal.Equals(input.Decimal))
|
||||
) &&
|
||||
(
|
||||
this.String == input.String ||
|
||||
(this.String != null &&
|
||||
@@ -356,6 +370,8 @@ namespace Org.OpenAPITools.Model
|
||||
hashCode = hashCode * 59 + this.Float.GetHashCode();
|
||||
if (this.Double != null)
|
||||
hashCode = hashCode * 59 + this.Double.GetHashCode();
|
||||
if (this.Decimal != null)
|
||||
hashCode = hashCode * 59 + this.Decimal.GetHashCode();
|
||||
if (this.String != null)
|
||||
hashCode = hashCode * 59 + this.String.GetHashCode();
|
||||
if (this.Byte != null)
|
||||
|
||||
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
||||
**_number** | **Number** | |
|
||||
**_float** | **Number** | | [optional]
|
||||
**_double** | **Number** | | [optional]
|
||||
**decimal** | **Number** | | [optional]
|
||||
**_string** | **String** | | [optional]
|
||||
**_byte** | **Blob** | |
|
||||
**binary** | **File** | | [optional]
|
||||
|
||||
@@ -73,6 +73,9 @@ class FormatTest {
|
||||
if (data.hasOwnProperty('double')) {
|
||||
obj['double'] = ApiClient.convertToType(data['double'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('decimal')) {
|
||||
obj['decimal'] = ApiClient.convertToType(data['decimal'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('string')) {
|
||||
obj['string'] = ApiClient.convertToType(data['string'], 'String');
|
||||
}
|
||||
@@ -137,6 +140,11 @@ FormatTest.prototype['float'] = undefined;
|
||||
*/
|
||||
FormatTest.prototype['double'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} decimal
|
||||
*/
|
||||
FormatTest.prototype['decimal'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {String} string
|
||||
*/
|
||||
|
||||
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
||||
**_number** | **Number** | |
|
||||
**_float** | **Number** | | [optional]
|
||||
**_double** | **Number** | | [optional]
|
||||
**decimal** | **Number** | | [optional]
|
||||
**_string** | **String** | | [optional]
|
||||
**_byte** | **Blob** | |
|
||||
**binary** | **File** | | [optional]
|
||||
|
||||
@@ -73,6 +73,9 @@ class FormatTest {
|
||||
if (data.hasOwnProperty('double')) {
|
||||
obj['double'] = ApiClient.convertToType(data['double'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('decimal')) {
|
||||
obj['decimal'] = ApiClient.convertToType(data['decimal'], 'Number');
|
||||
}
|
||||
if (data.hasOwnProperty('string')) {
|
||||
obj['string'] = ApiClient.convertToType(data['string'], 'String');
|
||||
}
|
||||
@@ -137,6 +140,11 @@ FormatTest.prototype['float'] = undefined;
|
||||
*/
|
||||
FormatTest.prototype['double'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {Number} decimal
|
||||
*/
|
||||
FormatTest.prototype['decimal'] = undefined;
|
||||
|
||||
/**
|
||||
* @member {String} string
|
||||
*/
|
||||
|
||||
@@ -14,6 +14,7 @@ Name | Type | Description | Notes
|
||||
**number** | **double** | |
|
||||
**float** | **double** | | [optional]
|
||||
**double** | **double** | | [optional]
|
||||
**decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
**string** | **string** | | [optional]
|
||||
**byte** | **string** | |
|
||||
**binary** | **string** | | [optional]
|
||||
|
||||
@@ -30,6 +30,7 @@ use Log::Any qw($log);
|
||||
use Date::Parse;
|
||||
use DateTime;
|
||||
|
||||
use WWW::OpenAPIClient::Object::Decimal;
|
||||
|
||||
use base ("Class::Accessor", "Class::Data::Inheritable");
|
||||
|
||||
@@ -203,6 +204,13 @@ __PACKAGE__->method_documentation({
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
'decimal' => {
|
||||
datatype => 'Decimal',
|
||||
base_name => 'decimal',
|
||||
description => '',
|
||||
format => '',
|
||||
read_only => '',
|
||||
},
|
||||
'string' => {
|
||||
datatype => 'string',
|
||||
base_name => 'string',
|
||||
@@ -275,6 +283,7 @@ __PACKAGE__->openapi_types( {
|
||||
'number' => 'double',
|
||||
'float' => 'double',
|
||||
'double' => 'double',
|
||||
'decimal' => 'Decimal',
|
||||
'string' => 'string',
|
||||
'byte' => 'string',
|
||||
'binary' => 'string',
|
||||
@@ -293,6 +302,7 @@ __PACKAGE__->attribute_map( {
|
||||
'number' => 'number',
|
||||
'float' => 'float',
|
||||
'double' => 'double',
|
||||
'decimal' => 'decimal',
|
||||
'string' => 'string',
|
||||
'byte' => 'byte',
|
||||
'binary' => 'binary',
|
||||
|
||||
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
||||
**number** | **float** | |
|
||||
**float** | **float** | | [optional]
|
||||
**double** | **double** | | [optional]
|
||||
**decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
**string** | **string** | | [optional]
|
||||
**byte** | **string** | |
|
||||
**binary** | [**\SplFileObject**](\SplFileObject.md) | | [optional]
|
||||
|
||||
@@ -66,6 +66,7 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
'number' => 'float',
|
||||
'float' => 'float',
|
||||
'double' => 'double',
|
||||
'decimal' => 'Decimal',
|
||||
'string' => 'string',
|
||||
'byte' => 'string',
|
||||
'binary' => '\SplFileObject',
|
||||
@@ -91,6 +92,7 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
'number' => null,
|
||||
'float' => 'float',
|
||||
'double' => 'double',
|
||||
'decimal' => 'number',
|
||||
'string' => null,
|
||||
'byte' => 'byte',
|
||||
'binary' => 'binary',
|
||||
@@ -135,6 +137,7 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
'number' => 'number',
|
||||
'float' => 'float',
|
||||
'double' => 'double',
|
||||
'decimal' => 'decimal',
|
||||
'string' => 'string',
|
||||
'byte' => 'byte',
|
||||
'binary' => 'binary',
|
||||
@@ -158,6 +161,7 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
'number' => 'setNumber',
|
||||
'float' => 'setFloat',
|
||||
'double' => 'setDouble',
|
||||
'decimal' => 'setDecimal',
|
||||
'string' => 'setString',
|
||||
'byte' => 'setByte',
|
||||
'binary' => 'setBinary',
|
||||
@@ -181,6 +185,7 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
'number' => 'getNumber',
|
||||
'float' => 'getFloat',
|
||||
'double' => 'getDouble',
|
||||
'decimal' => 'getDecimal',
|
||||
'string' => 'getString',
|
||||
'byte' => 'getByte',
|
||||
'binary' => 'getBinary',
|
||||
@@ -258,6 +263,7 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
$this->container['number'] = $data['number'] ?? null;
|
||||
$this->container['float'] = $data['float'] ?? null;
|
||||
$this->container['double'] = $data['double'] ?? null;
|
||||
$this->container['decimal'] = $data['decimal'] ?? null;
|
||||
$this->container['string'] = $data['string'] ?? null;
|
||||
$this->container['byte'] = $data['byte'] ?? null;
|
||||
$this->container['binary'] = $data['binary'] ?? null;
|
||||
@@ -549,6 +555,30 @@ class FormatTest implements ModelInterface, ArrayAccess, \JsonSerializable
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets decimal
|
||||
*
|
||||
* @return Decimal|null
|
||||
*/
|
||||
public function getDecimal()
|
||||
{
|
||||
return $this->container['decimal'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets decimal
|
||||
*
|
||||
* @param Decimal|null $decimal decimal
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setDecimal($decimal)
|
||||
{
|
||||
$this->container['decimal'] = $decimal;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets string
|
||||
*
|
||||
|
||||
@@ -16,7 +16,7 @@ Name | Type | Description | Notes
|
||||
**date_time** | **datetime** | | [optional]
|
||||
**uuid** | **str** | | [optional]
|
||||
**password** | **str** | |
|
||||
**big_decimal** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
**big_decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class FormatTest(object):
|
||||
'date_time': 'datetime',
|
||||
'uuid': 'str',
|
||||
'password': 'str',
|
||||
'big_decimal': 'BigDecimal'
|
||||
'big_decimal': 'Decimal'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
@@ -442,7 +442,7 @@ class FormatTest(object):
|
||||
|
||||
|
||||
:return: The big_decimal of this FormatTest. # noqa: E501
|
||||
:rtype: BigDecimal
|
||||
:rtype: Decimal
|
||||
"""
|
||||
return self._big_decimal
|
||||
|
||||
@@ -452,7 +452,7 @@ class FormatTest(object):
|
||||
|
||||
|
||||
:param big_decimal: The big_decimal of this FormatTest. # noqa: E501
|
||||
:type big_decimal: BigDecimal
|
||||
:type big_decimal: Decimal
|
||||
"""
|
||||
|
||||
self._big_decimal = big_decimal
|
||||
|
||||
@@ -16,7 +16,7 @@ Name | Type | Description | Notes
|
||||
**date_time** | **datetime** | | [optional]
|
||||
**uuid** | **str** | | [optional]
|
||||
**password** | **str** | |
|
||||
**big_decimal** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
**big_decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class FormatTest(object):
|
||||
'date_time': 'datetime',
|
||||
'uuid': 'str',
|
||||
'password': 'str',
|
||||
'big_decimal': 'BigDecimal'
|
||||
'big_decimal': 'Decimal'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
@@ -442,7 +442,7 @@ class FormatTest(object):
|
||||
|
||||
|
||||
:return: The big_decimal of this FormatTest. # noqa: E501
|
||||
:rtype: BigDecimal
|
||||
:rtype: Decimal
|
||||
"""
|
||||
return self._big_decimal
|
||||
|
||||
@@ -452,7 +452,7 @@ class FormatTest(object):
|
||||
|
||||
|
||||
:param big_decimal: The big_decimal of this FormatTest. # noqa: E501
|
||||
:type big_decimal: BigDecimal
|
||||
:type big_decimal: Decimal
|
||||
"""
|
||||
|
||||
self._big_decimal = big_decimal
|
||||
|
||||
@@ -16,7 +16,7 @@ Name | Type | Description | Notes
|
||||
**date_time** | **datetime** | | [optional]
|
||||
**uuid** | **str** | | [optional]
|
||||
**password** | **str** | |
|
||||
**big_decimal** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
**big_decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class FormatTest(object):
|
||||
'date_time': 'datetime',
|
||||
'uuid': 'str',
|
||||
'password': 'str',
|
||||
'big_decimal': 'BigDecimal'
|
||||
'big_decimal': 'Decimal'
|
||||
}
|
||||
|
||||
attribute_map = {
|
||||
@@ -442,7 +442,7 @@ class FormatTest(object):
|
||||
|
||||
|
||||
:return: The big_decimal of this FormatTest. # noqa: E501
|
||||
:rtype: BigDecimal
|
||||
:rtype: Decimal
|
||||
"""
|
||||
return self._big_decimal
|
||||
|
||||
@@ -452,7 +452,7 @@ class FormatTest(object):
|
||||
|
||||
|
||||
:param big_decimal: The big_decimal of this FormatTest. # noqa: E501
|
||||
:type big_decimal: BigDecimal
|
||||
:type big_decimal: Decimal
|
||||
"""
|
||||
|
||||
self._big_decimal = big_decimal
|
||||
|
||||
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
||||
**number** | **Float** | |
|
||||
**float** | **Float** | | [optional]
|
||||
**double** | **Float** | | [optional]
|
||||
**decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
**string** | **String** | | [optional]
|
||||
**byte** | **String** | |
|
||||
**binary** | **File** | | [optional]
|
||||
@@ -31,6 +32,7 @@ instance = Petstore::FormatTest.new(integer: null,
|
||||
number: null,
|
||||
float: null,
|
||||
double: null,
|
||||
decimal: null,
|
||||
string: null,
|
||||
byte: null,
|
||||
binary: null,
|
||||
|
||||
@@ -27,6 +27,8 @@ module Petstore
|
||||
|
||||
attr_accessor :double
|
||||
|
||||
attr_accessor :decimal
|
||||
|
||||
attr_accessor :string
|
||||
|
||||
attr_accessor :byte
|
||||
@@ -56,6 +58,7 @@ module Petstore
|
||||
:'number' => :'number',
|
||||
:'float' => :'float',
|
||||
:'double' => :'double',
|
||||
:'decimal' => :'decimal',
|
||||
:'string' => :'string',
|
||||
:'byte' => :'byte',
|
||||
:'binary' => :'binary',
|
||||
@@ -77,6 +80,7 @@ module Petstore
|
||||
:'number' => :'Float',
|
||||
:'float' => :'Float',
|
||||
:'double' => :'Float',
|
||||
:'decimal' => :'Decimal',
|
||||
:'string' => :'String',
|
||||
:'byte' => :'String',
|
||||
:'binary' => :'File',
|
||||
@@ -134,6 +138,10 @@ module Petstore
|
||||
self.double = attributes[:'double']
|
||||
end
|
||||
|
||||
if attributes.key?(:'decimal')
|
||||
self.decimal = attributes[:'decimal']
|
||||
end
|
||||
|
||||
if attributes.key?(:'string')
|
||||
self.string = attributes[:'string']
|
||||
end
|
||||
@@ -418,6 +426,7 @@ module Petstore
|
||||
number == o.number &&
|
||||
float == o.float &&
|
||||
double == o.double &&
|
||||
decimal == o.decimal &&
|
||||
string == o.string &&
|
||||
byte == o.byte &&
|
||||
binary == o.binary &&
|
||||
@@ -438,7 +447,7 @@ module Petstore
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash
|
||||
[integer, int32, int64, number, float, double, decimal, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
|
||||
@@ -10,6 +10,7 @@ Name | Type | Description | Notes
|
||||
**number** | **Float** | |
|
||||
**float** | **Float** | | [optional]
|
||||
**double** | **Float** | | [optional]
|
||||
**decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
**string** | **String** | | [optional]
|
||||
**byte** | **String** | |
|
||||
**binary** | **File** | | [optional]
|
||||
@@ -31,6 +32,7 @@ instance = Petstore::FormatTest.new(integer: null,
|
||||
number: null,
|
||||
float: null,
|
||||
double: null,
|
||||
decimal: null,
|
||||
string: null,
|
||||
byte: null,
|
||||
binary: null,
|
||||
|
||||
@@ -27,6 +27,8 @@ module Petstore
|
||||
|
||||
attr_accessor :double
|
||||
|
||||
attr_accessor :decimal
|
||||
|
||||
attr_accessor :string
|
||||
|
||||
attr_accessor :byte
|
||||
@@ -56,6 +58,7 @@ module Petstore
|
||||
:'number' => :'number',
|
||||
:'float' => :'float',
|
||||
:'double' => :'double',
|
||||
:'decimal' => :'decimal',
|
||||
:'string' => :'string',
|
||||
:'byte' => :'byte',
|
||||
:'binary' => :'binary',
|
||||
@@ -77,6 +80,7 @@ module Petstore
|
||||
:'number' => :'Float',
|
||||
:'float' => :'Float',
|
||||
:'double' => :'Float',
|
||||
:'decimal' => :'Decimal',
|
||||
:'string' => :'String',
|
||||
:'byte' => :'String',
|
||||
:'binary' => :'File',
|
||||
@@ -134,6 +138,10 @@ module Petstore
|
||||
self.double = attributes[:'double']
|
||||
end
|
||||
|
||||
if attributes.key?(:'decimal')
|
||||
self.decimal = attributes[:'decimal']
|
||||
end
|
||||
|
||||
if attributes.key?(:'string')
|
||||
self.string = attributes[:'string']
|
||||
end
|
||||
@@ -418,6 +426,7 @@ module Petstore
|
||||
number == o.number &&
|
||||
float == o.float &&
|
||||
double == o.double &&
|
||||
decimal == o.decimal &&
|
||||
string == o.string &&
|
||||
byte == o.byte &&
|
||||
binary == o.binary &&
|
||||
@@ -438,7 +447,7 @@ module Petstore
|
||||
# Calculates hash code according to all attributes.
|
||||
# @return [Integer] Hash code
|
||||
def hash
|
||||
[integer, int32, int64, number, float, double, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash
|
||||
[integer, int32, int64, number, float, double, decimal, string, byte, binary, date, date_time, uuid, password, pattern_with_digits, pattern_with_digits_and_delimiter].hash
|
||||
end
|
||||
|
||||
# Builds the object from hash
|
||||
|
||||
@@ -1611,6 +1611,9 @@ components:
|
||||
maximum: 123.4
|
||||
minimum: 67.8
|
||||
type: number
|
||||
decimal:
|
||||
format: number
|
||||
type: string
|
||||
string:
|
||||
pattern: /[a-z]/i
|
||||
type: string
|
||||
|
||||
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
|
||||
**number** | [**BigDecimal**](BigDecimal.md) | |
|
||||
**_float** | **Float** | | [optional]
|
||||
**_double** | **Double** | | [optional]
|
||||
**decimal** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
**string** | **String** | | [optional]
|
||||
**_byte** | **byte[]** | |
|
||||
**binary** | [**File**](File.md) | | [optional]
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -1611,6 +1611,9 @@ components:
|
||||
maximum: 123.4
|
||||
minimum: 67.8
|
||||
type: number
|
||||
decimal:
|
||||
format: number
|
||||
type: string
|
||||
string:
|
||||
pattern: /[a-z]/i
|
||||
type: string
|
||||
|
||||
@@ -12,6 +12,7 @@ Name | Type | Description | Notes
|
||||
**number** | [**BigDecimal**](BigDecimal.md) | |
|
||||
**_float** | **Float** | | [optional]
|
||||
**_double** | **Double** | | [optional]
|
||||
**decimal** | [**BigDecimal**](BigDecimal.md) | | [optional]
|
||||
**string** | **String** | | [optional]
|
||||
**_byte** | **byte[]** | |
|
||||
**binary** | [**File**](File.md) | | [optional]
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -511,6 +540,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");
|
||||
|
||||
@@ -9,6 +9,7 @@ Name | Type | Description | Notes
|
||||
**number** | **float** | |
|
||||
**float** | **float** | | [optional]
|
||||
**double** | **float** | | [optional]
|
||||
**decimal** | [**Decimal**](Decimal.md) | | [optional]
|
||||
**string** | **str** | | [optional]
|
||||
**byte** | **str** | |
|
||||
**binary** | **file** | | [optional]
|
||||
|
||||
@@ -39,6 +39,7 @@ class FormatTest(object):
|
||||
'number': 'float',
|
||||
'float': 'float',
|
||||
'double': 'float',
|
||||
'decimal': 'Decimal',
|
||||
'string': 'str',
|
||||
'byte': 'str',
|
||||
'binary': 'file',
|
||||
@@ -57,6 +58,7 @@ class FormatTest(object):
|
||||
'number': 'number',
|
||||
'float': 'float',
|
||||
'double': 'double',
|
||||
'decimal': 'decimal',
|
||||
'string': 'string',
|
||||
'byte': 'byte',
|
||||
'binary': 'binary',
|
||||
@@ -68,7 +70,7 @@ class FormatTest(object):
|
||||
'pattern_with_digits_and_delimiter': 'pattern_with_digits_and_delimiter'
|
||||
}
|
||||
|
||||
def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, pattern_with_digits=None, pattern_with_digits_and_delimiter=None, local_vars_configuration=None): # noqa: E501
|
||||
def __init__(self, integer=None, int32=None, int64=None, number=None, float=None, double=None, decimal=None, string=None, byte=None, binary=None, date=None, date_time=None, uuid=None, password=None, pattern_with_digits=None, pattern_with_digits_and_delimiter=None, local_vars_configuration=None): # noqa: E501
|
||||
"""FormatTest - a model defined in OpenAPI""" # noqa: E501
|
||||
if local_vars_configuration is None:
|
||||
local_vars_configuration = Configuration()
|
||||
@@ -80,6 +82,7 @@ class FormatTest(object):
|
||||
self._number = None
|
||||
self._float = None
|
||||
self._double = None
|
||||
self._decimal = None
|
||||
self._string = None
|
||||
self._byte = None
|
||||
self._binary = None
|
||||
@@ -102,6 +105,8 @@ class FormatTest(object):
|
||||
self.float = float
|
||||
if double is not None:
|
||||
self.double = double
|
||||
if decimal is not None:
|
||||
self.decimal = decimal
|
||||
if string is not None:
|
||||
self.string = string
|
||||
self.byte = byte
|
||||
@@ -276,6 +281,27 @@ class FormatTest(object):
|
||||
|
||||
self._double = double
|
||||
|
||||
@property
|
||||
def decimal(self):
|
||||
"""Gets the decimal of this FormatTest. # noqa: E501
|
||||
|
||||
|
||||
:return: The decimal of this FormatTest. # noqa: E501
|
||||
:rtype: Decimal
|
||||
"""
|
||||
return self._decimal
|
||||
|
||||
@decimal.setter
|
||||
def decimal(self, decimal):
|
||||
"""Sets the decimal of this FormatTest.
|
||||
|
||||
|
||||
:param decimal: The decimal of this FormatTest. # noqa: E501
|
||||
:type decimal: Decimal
|
||||
"""
|
||||
|
||||
self._decimal = decimal
|
||||
|
||||
@property
|
||||
def string(self):
|
||||
"""Gets the string of this FormatTest. # noqa: E501
|
||||
|
||||
@@ -7,17 +7,17 @@
|
||||
--
|
||||
-- SELECT template for table `format_test`
|
||||
--
|
||||
SELECT `integer`, `int32`, `int64`, `number`, `float`, `double`, `string`, `byte`, `binary`, `date`, `dateTime`, `uuid`, `password`, `pattern_with_digits`, `pattern_with_digits_and_delimiter` FROM `format_test` WHERE 1;
|
||||
SELECT `integer`, `int32`, `int64`, `number`, `float`, `double`, `decimal`, `string`, `byte`, `binary`, `date`, `dateTime`, `uuid`, `password`, `pattern_with_digits`, `pattern_with_digits_and_delimiter` FROM `format_test` WHERE 1;
|
||||
|
||||
--
|
||||
-- INSERT template for table `format_test`
|
||||
--
|
||||
INSERT INTO `format_test`(`integer`, `int32`, `int64`, `number`, `float`, `double`, `string`, `byte`, `binary`, `date`, `dateTime`, `uuid`, `password`, `pattern_with_digits`, `pattern_with_digits_and_delimiter`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
|
||||
INSERT INTO `format_test`(`integer`, `int32`, `int64`, `number`, `float`, `double`, `decimal`, `string`, `byte`, `binary`, `date`, `dateTime`, `uuid`, `password`, `pattern_with_digits`, `pattern_with_digits_and_delimiter`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?);
|
||||
|
||||
--
|
||||
-- UPDATE template for table `format_test`
|
||||
--
|
||||
UPDATE `format_test` SET `integer` = ?, `int32` = ?, `int64` = ?, `number` = ?, `float` = ?, `double` = ?, `string` = ?, `byte` = ?, `binary` = ?, `date` = ?, `dateTime` = ?, `uuid` = ?, `password` = ?, `pattern_with_digits` = ?, `pattern_with_digits_and_delimiter` = ? WHERE 1;
|
||||
UPDATE `format_test` SET `integer` = ?, `int32` = ?, `int64` = ?, `number` = ?, `float` = ?, `double` = ?, `decimal` = ?, `string` = ?, `byte` = ?, `binary` = ?, `date` = ?, `dateTime` = ?, `uuid` = ?, `password` = ?, `pattern_with_digits` = ?, `pattern_with_digits_and_delimiter` = ? WHERE 1;
|
||||
|
||||
--
|
||||
-- DELETE template for table `format_test`
|
||||
|
||||
@@ -205,6 +205,7 @@ CREATE TABLE IF NOT EXISTS `format_test` (
|
||||
`number` DECIMAL(20, 9) UNSIGNED NOT NULL,
|
||||
`float` DECIMAL(20, 9) UNSIGNED DEFAULT NULL,
|
||||
`double` DECIMAL(20, 9) UNSIGNED DEFAULT NULL,
|
||||
`decimal` TEXT DEFAULT NULL,
|
||||
`string` TEXT DEFAULT NULL,
|
||||
`byte` MEDIUMBLOB NOT NULL,
|
||||
`binary` MEDIUMBLOB DEFAULT NULL,
|
||||
|
||||
@@ -61,6 +61,7 @@ public class FormatTest {
|
||||
private String password;
|
||||
|
||||
@ApiModelProperty(value = "")
|
||||
@Valid
|
||||
private BigDecimal bigDecimal;
|
||||
/**
|
||||
* Get integer
|
||||
|
||||
@@ -386,7 +386,7 @@ public class FormatTest implements Serializable {
|
||||
**/
|
||||
@JsonProperty("BigDecimal")
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public BigDecimal getBigDecimal() {
|
||||
return bigDecimal;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import javax.validation.Valid;
|
||||
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,
|
||||
@@ -72,6 +73,10 @@ public class FormatTest {
|
||||
@JsonProperty(JSON_PROPERTY_DOUBLE)
|
||||
private Double _double;
|
||||
|
||||
public static final String JSON_PROPERTY_DECIMAL = "decimal";
|
||||
@JsonProperty(JSON_PROPERTY_DECIMAL)
|
||||
private BigDecimal decimal;
|
||||
|
||||
public static final String JSON_PROPERTY_STRING = "string";
|
||||
@JsonProperty(JSON_PROPERTY_STRING)
|
||||
private String string;
|
||||
@@ -238,6 +243,26 @@ public class FormatTest {
|
||||
this._double = _double;
|
||||
}
|
||||
|
||||
public FormatTest decimal(BigDecimal decimal) {
|
||||
this.decimal = decimal;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get decimal
|
||||
* @return decimal
|
||||
**/
|
||||
@JsonProperty("decimal")
|
||||
@ApiModelProperty(value = "")
|
||||
@Valid
|
||||
public BigDecimal getDecimal() {
|
||||
return decimal;
|
||||
}
|
||||
|
||||
public void setDecimal(BigDecimal decimal) {
|
||||
this.decimal = decimal;
|
||||
}
|
||||
|
||||
public FormatTest string(String string) {
|
||||
this.string = string;
|
||||
return this;
|
||||
@@ -434,6 +459,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) &&
|
||||
Objects.equals(this._byte, formatTest._byte) &&
|
||||
Objects.equals(this.binary, formatTest.binary) &&
|
||||
@@ -447,7 +473,7 @@ public class FormatTest {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(integer, int32, int64, number, _float, _double, string, _byte, binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter);
|
||||
return Objects.hash(integer, int32, int64, number, _float, _double, decimal, string, _byte, binary, date, dateTime, uuid, password, patternWithDigits, patternWithDigitsAndDelimiter);
|
||||
}
|
||||
|
||||
|
||||
@@ -462,6 +488,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");
|
||||
|
||||
@@ -384,7 +384,7 @@ public class FormatTest {
|
||||
**/
|
||||
@JsonProperty("BigDecimal")
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public BigDecimal getBigDecimal() {
|
||||
return bigDecimal;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ public class FormatTest {
|
||||
**/
|
||||
@JsonProperty("BigDecimal")
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public BigDecimal getBigDecimal() {
|
||||
return bigDecimal;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ public class FormatTest {
|
||||
**/
|
||||
@JsonProperty("BigDecimal")
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public BigDecimal getBigDecimal() {
|
||||
return bigDecimal;
|
||||
}
|
||||
|
||||
@@ -384,7 +384,7 @@ public class FormatTest {
|
||||
**/
|
||||
@JsonProperty("BigDecimal")
|
||||
@ApiModelProperty(value = "")
|
||||
|
||||
@Valid
|
||||
public BigDecimal getBigDecimal() {
|
||||
return bigDecimal;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ class FormatTest {
|
||||
/** @var double $double */
|
||||
private $double;
|
||||
|
||||
/** @var Decimal $decimal */
|
||||
private $decimal;
|
||||
|
||||
/** @var string $string */
|
||||
private $string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user