diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java index 38c70fcc82e9..ab934075a539 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/CodegenParameter.java @@ -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; @@ -58,3 +114,4 @@ public class CodegenParameter { return output; } } + diff --git a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java index 99ceca6796c6..219c5a5efb30 100644 --- a/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java +++ b/modules/swagger-codegen/src/main/java/io/swagger/codegen/DefaultCodegen.java @@ -1491,6 +1491,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.isExclusiveMaximum(); + p.minimum = qp.getMinimum(); + p.exclusiveMinimum = qp.isExclusiveMinimum(); + p.maxLength = qp.getMaxLength(); + p.minLength = qp.getMinLength(); + p.pattern = qp.getPattern(); + p.maxItems = qp.getMaxItems(); + p.minItems = qp.getMinItems(); + p.uniqueItems = qp.isUniqueItems(); + p.multipleOf = qp.getMultipleOf(); } else { if (!(param instanceof BodyParameter)) { LOGGER.error("Cannot use Parameter " + param + " as Body Parameter"); diff --git a/pom.xml b/pom.xml index ada3dc0dc4a6..43df2b04be05 100644 --- a/pom.xml +++ b/pom.xml @@ -546,7 +546,7 @@ 1.0.12 2.11.1 2.3.4 - 1.5.4 + 1.5.5-SNAPSHOT 2.1.5-SNAPSHOT 2.3 1.2