diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java old mode 100644 new mode 100755 index e9877eefafa..c72d24bc089 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java @@ -49,6 +49,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti public String jsonSchema; public String minimum; public String maximum; + public Number multipleOf; public boolean exclusiveMinimum; public boolean exclusiveMaximum; public boolean hasMore; @@ -513,6 +514,14 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti this.maxProperties = maxProperties; } + public Number getMultipleOf() { + return multipleOf; + } + + public void setMultipleOf(Number multipleOf) { + this.multipleOf = multipleOf; + } + @Override public String toString() { final StringBuilder sb = new StringBuilder("CodegenProperty{"); @@ -591,6 +600,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti sb.append(", maxProperties=").append(maxProperties); sb.append(", minProperties=").append(minProperties); sb.append(", uniqueItems=").append(uniqueItems); + sb.append(", multipleOf=").append(multipleOf); sb.append(", isXmlAttribute=").append(isXmlAttribute); sb.append(", xmlPrefix='").append(xmlPrefix).append('\''); sb.append(", xmlName='").append(xmlName).append('\''); @@ -681,7 +691,8 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti Objects.equals(minItems, that.minItems) && Objects.equals(xmlPrefix, that.xmlPrefix) && Objects.equals(xmlName, that.xmlName) && - Objects.equals(xmlNamespace, that.xmlNamespace); + Objects.equals(xmlNamespace, that.xmlNamespace) && + Objects.equals(multipleOf, that.multipleOf); } @Override diff --git a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java old mode 100644 new mode 100755 index d157cb808e0..326b7104180 --- a/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java +++ b/modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java @@ -2358,6 +2358,9 @@ public class DefaultCodegen implements CodegenConfig { 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