Skip to content

Commit b94fe7a

Browse files
yasammezwing328
authored andcommitted
add multipleOf to CodegenProperty (#2192) (#5009)
1 parent 3218587 commit b94fe7a

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

modules/openapi-generator/src/main/java/org/openapitools/codegen/CodegenProperty.java

100644100755
Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public class CodegenProperty implements Cloneable, IJsonSchemaValidationProperti
4949
public String jsonSchema;
5050
public String minimum;
5151
public String maximum;
52+
public Number multipleOf;
5253
public boolean exclusiveMinimum;
5354
public boolean exclusiveMaximum;
5455
public boolean hasMore;
@@ -513,6 +514,14 @@ public void setMaxProperties(Integer maxProperties) {
513514
this.maxProperties = maxProperties;
514515
}
515516

517+
public Number getMultipleOf() {
518+
return multipleOf;
519+
}
520+
521+
public void setMultipleOf(Number multipleOf) {
522+
this.multipleOf = multipleOf;
523+
}
524+
516525
@Override
517526
public String toString() {
518527
final StringBuilder sb = new StringBuilder("CodegenProperty{");
@@ -591,6 +600,7 @@ public String toString() {
591600
sb.append(", maxProperties=").append(maxProperties);
592601
sb.append(", minProperties=").append(minProperties);
593602
sb.append(", uniqueItems=").append(uniqueItems);
603+
sb.append(", multipleOf=").append(multipleOf);
594604
sb.append(", isXmlAttribute=").append(isXmlAttribute);
595605
sb.append(", xmlPrefix='").append(xmlPrefix).append('\'');
596606
sb.append(", xmlName='").append(xmlName).append('\'');
@@ -681,7 +691,8 @@ public boolean equals(Object o) {
681691
Objects.equals(minItems, that.minItems) &&
682692
Objects.equals(xmlPrefix, that.xmlPrefix) &&
683693
Objects.equals(xmlName, that.xmlName) &&
684-
Objects.equals(xmlNamespace, that.xmlNamespace);
694+
Objects.equals(xmlNamespace, that.xmlNamespace) &&
695+
Objects.equals(multipleOf, that.multipleOf);
685696
}
686697

687698
@Override

modules/openapi-generator/src/main/java/org/openapitools/codegen/DefaultCodegen.java

100644100755
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2358,6 +2358,9 @@ public CodegenProperty fromProperty(String name, Schema p) {
23582358
if (p.getExclusiveMaximum() != null) {
23592359
property.exclusiveMaximum = p.getExclusiveMaximum();
23602360
}
2361+
if (p.getMultipleOf() != null) {
2362+
property.multipleOf = p.getMultipleOf();
2363+
}
23612364

23622365
// check if any validation rule defined
23632366
// exclusive* are noop without corresponding min/max

0 commit comments

Comments
 (0)