Skip to content

Add multipleOf to various codegen classes #5021

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 19, 2020
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 @@ -81,6 +81,7 @@ public class CodegenModel implements IJsonSchemaValidationProperties {
private String minimum;
private String maximum;
private String pattern;
private Number multipleOf;

public String getAdditionalPropertiesType() {
return additionalPropertiesType;
Expand Down Expand Up @@ -414,6 +415,16 @@ public void setMaxProperties(Integer maxProperties) {
this.maxProperties = maxProperties;
}

@Override
public Number getMultipleOf() {
return multipleOf;
}

@Override
public void setMultipleOf(Number multipleOf) {
this.multipleOf = multipleOf;
}

public List<CodegenProperty> getReadOnlyVars() {
return readOnlyVars;
}
Expand Down Expand Up @@ -569,7 +580,9 @@ public boolean equals(Object o) {
Objects.equals(getMinLength(), that.getMinLength()) &&
Objects.equals(getMinimum(), that.getMinimum()) &&
Objects.equals(getMaximum(), that.getMaximum()) &&
Objects.equals(getPattern(), that.getPattern());
Objects.equals(getPattern(), that.getPattern()) &&
Objects.equals(getMultipleOf(), that.getMultipleOf());

}

@Override
Expand All @@ -585,7 +598,7 @@ public int hashCode() {
hasChildren, isMapModel, hasOnlyReadOnly, getExternalDocumentation(), getVendorExtensions(),
getAdditionalPropertiesType(), getMaxProperties(), getMinProperties(), getUniqueItems(), getMaxItems(),
getMinItems(), getMaxLength(), getMinLength(), getExclusiveMinimum(), getExclusiveMaximum(), getMinimum(),
getMaximum(), getPattern());
getMaximum(), getPattern(), getMultipleOf());
}

@Override
Expand Down Expand Up @@ -662,6 +675,7 @@ public String toString() {
sb.append(", minimum='").append(minimum).append('\'');
sb.append(", maximum='").append(maximum).append('\'');
sb.append(", pattern='").append(pattern).append('\'');
sb.append(", multipleOf='").append(multipleOf).append('\'');
sb.append('}');
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -456,5 +456,15 @@ public void setMaxProperties(Integer maxProperties) {
this.maxProperties = maxProperties;
}

@Override
public Number getMultipleOf() {
return multipleOf;
}

@Override
public void setMultipleOf(Number multipleOf) {
this.multipleOf = multipleOf;
}

}

Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,6 @@ public int hashCode() {
isWriteOnly, isNullable, isSelfReference, isCircularReference, _enum, allowableValues, items,
mostInnerItems, vendorExtensions, hasValidation, isInherited, discriminatorValue, nameInCamelCase,
nameInSnakeCase, enumName, maxItems, minItems, isXmlAttribute, xmlPrefix, xmlName, xmlNamespace,
isXmlWrapped);
isXmlWrapped, multipleOf);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public class CodegenResponse implements IJsonSchemaValidationProperties {
private String minimum;
private String maximum;
public String pattern;
public Number multipleOf;

@Override
public int hashCode() {
Expand Down Expand Up @@ -127,7 +128,9 @@ public boolean equals(Object o) {
Objects.equals(exclusiveMaximum, that.exclusiveMaximum) &&
Objects.equals(getMinimum(), that.getMinimum()) &&
Objects.equals(getMaximum(), that.getMaximum()) &&
Objects.equals(getPattern(), that.getPattern());
Objects.equals(getPattern(), that.getPattern()) &&
Objects.equals(getMultipleOf(), that.getMultipleOf());

}

@Override
Expand Down Expand Up @@ -250,6 +253,16 @@ public void setMaxProperties(Integer maxProperties) {
this.maxProperties = maxProperties;
}

@Override
public Number getMultipleOf() {
return multipleOf;
}

@Override
public void setMultipleOf(Number multipleOf) {
this.multipleOf = multipleOf;
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("CodegenResponse{");
Expand Down Expand Up @@ -299,6 +312,7 @@ public String toString() {
sb.append(", minimum='").append(minimum).append('\'');
sb.append(", maximum='").append(maximum).append('\'');
sb.append(", pattern='").append(pattern).append('\'');
sb.append(", multipleOf='").append(multipleOf).append('\'');
sb.append('}');
return sb.toString();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,41 +1,55 @@
package org.openapitools.codegen;

import java.math.BigDecimal;

public interface IJsonSchemaValidationProperties {
String getPattern();

void setPattern(String pattern);

String getMaximum();

void setMaximum(String maximum);

String getMinimum();

void setMinimum(String minimum);

boolean getExclusiveMaximum();

void setExclusiveMaximum(boolean exclusiveMaximum);

boolean getExclusiveMinimum();

void setExclusiveMinimum(boolean exclusiveMinimum);

Integer getMinLength();

void setMinLength(Integer minLength);

Integer getMaxLength();

void setMaxLength(Integer maxLength);

Integer getMinItems();

void setMinItems(Integer minItems);

Integer getMaxItems();

void setMaxItems(Integer maxItems);

boolean getUniqueItems();

void setUniqueItems(boolean uniqueItems);

Integer getMinProperties();

void setMinProperties(Integer minProperties);

Integer getMaxProperties();

void setMaxProperties(Integer maxProperties);

Number getMultipleOf();

void setMultipleOf(Number multipleOf);
}