diff --git a/.gitignore b/.gitignore index c904ba4a5fe..76ede9e0e7a 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ samples/client/petstore/python/.projectile samples/client/petstore/python/.venv/ */.settings +modules/*/.settings/ 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 38c70fcc82e..663e48ea616 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; 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 eb77efa3456..1107c4f0c88 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 @@ -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"); diff --git a/pom.xml b/pom.xml index 466b8f300b8..86986c96060 100644 --- a/pom.xml +++ b/pom.xml @@ -520,7 +520,7 @@ 1.0.11 2.11.1 2.3.4 - 1.5.4 + 1.5.5-SNAPSHOT 2.1.5-SNAPSHOT 2.3 1.2