forked from loafle/openapi-generator-original
fix: codegen does not support spec 2.0 properties for parameters:
maximum ,exclusiveMaximum ,minimum ,exclusiveMinimum ,maxLength ,minLength ,pattern ,maxItems ,minItems ,uniqueItems ,multipleOf
This commit is contained in:
parent
4551076b22
commit
a5fcda9926
1
.gitignore
vendored
1
.gitignore
vendored
@ -55,3 +55,4 @@ samples/client/petstore/python/.projectile
|
||||
samples/client/petstore/python/.venv/
|
||||
|
||||
*/.settings
|
||||
modules/*/.settings/
|
||||
|
@ -23,6 +23,51 @@ public class CodegenParameter {
|
||||
*/
|
||||
public Boolean required;
|
||||
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor17.
|
||||
*/
|
||||
public Number maximum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor17
|
||||
*/
|
||||
public Boolean exclusiveMaximum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor21
|
||||
*/
|
||||
public Number minimum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor21
|
||||
*/
|
||||
public Boolean exclusiveMinimum;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor26
|
||||
*/
|
||||
public Integer maxLength;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor29
|
||||
*/
|
||||
public Integer minLength;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor33
|
||||
*/
|
||||
public String pattern;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor42
|
||||
*/
|
||||
public Integer maxItems;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor45
|
||||
*/
|
||||
public Integer minItems;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor49
|
||||
*/
|
||||
public Boolean uniqueItems;
|
||||
/**
|
||||
* See http://json-schema.org/latest/json-schema-validation.html#anchor14
|
||||
*/
|
||||
public Number multipleOf;
|
||||
|
||||
public CodegenParameter copy() {
|
||||
CodegenParameter output = new CodegenParameter();
|
||||
output.isFile = this.isFile;
|
||||
@ -44,6 +89,17 @@ public class CodegenParameter {
|
||||
output.isCookieParam = this.isCookieParam;
|
||||
output.isBodyParam = this.isBodyParam;
|
||||
output.required = this.required;
|
||||
output.maximum = this.maximum;
|
||||
output.exclusiveMaximum = this.exclusiveMaximum;
|
||||
output.minimum = this.minimum;
|
||||
output.exclusiveMinimum = this.exclusiveMinimum;
|
||||
output.maxLength = this.maxLength;
|
||||
output.minLength = this.minLength;
|
||||
output.pattern = this.pattern;
|
||||
output.maxItems = this.maxItems;
|
||||
output.minItems = this.minItems;
|
||||
output.uniqueItems = this.uniqueItems;
|
||||
output.multipleOf = this.multipleOf;
|
||||
output.jsonSchema = this.jsonSchema;
|
||||
output.defaultValue = this.defaultValue;
|
||||
output.isEnum = this.isEnum;
|
||||
|
@ -1446,6 +1446,21 @@ public class DefaultCodegen {
|
||||
if (model.complexType != null) {
|
||||
imports.add(model.complexType);
|
||||
}
|
||||
p.maxLength = qp.getMaxLength();
|
||||
p.minLength = qp.getMinLength();
|
||||
p.pattern = qp.getPattern();
|
||||
|
||||
p.maximum = qp.getMaximum();
|
||||
p.exclusiveMaximum = qp.getExclusiveMaximum();
|
||||
p.minimum = qp.getMinimum();
|
||||
p.exclusiveMinimum = qp.getExclusiveMinimum();
|
||||
p.maxLength = qp.getMaxLength();
|
||||
p.minLength = qp.getMinLength();
|
||||
p.pattern = qp.getPattern();
|
||||
p.maxItems = qp.getMaxItems();
|
||||
p.minItems = qp.getMinItems();
|
||||
p.uniqueItems = qp.getUniqueItems();
|
||||
p.multipleOf = qp.getMultipleOf();
|
||||
} else {
|
||||
if (!(param instanceof BodyParameter)) {
|
||||
LOGGER.error("Cannot use Parameter " + param + " as Body Parameter");
|
||||
|
2
pom.xml
2
pom.xml
@ -520,7 +520,7 @@
|
||||
<swagger-parser-version>1.0.11</swagger-parser-version>
|
||||
<scala-version>2.11.1</scala-version>
|
||||
<felix-version>2.3.4</felix-version>
|
||||
<swagger-core-version>1.5.4</swagger-core-version>
|
||||
<swagger-core-version>1.5.5-SNAPSHOT</swagger-core-version>
|
||||
<scala-test-version>2.1.5-SNAPSHOT</scala-test-version>
|
||||
<commons-io-version>2.3</commons-io-version>
|
||||
<commons-cli-version>1.2</commons-cli-version>
|
||||
|
Loading…
x
Reference in New Issue
Block a user