add hasValidation to codegenParameter

This commit is contained in:
wing328 2016-04-25 22:45:10 +08:00
parent 0792ddc9b4
commit 89703d86b7
2 changed files with 7 additions and 0 deletions

View File

@ -20,6 +20,7 @@ public class CodegenParameter {
public Map<String, Object> allowableValues;
public CodegenProperty items;
public Map<String, Object> vendorExtensions;
public Boolean hasValidation;
/**
* Determines whether this parameter is mandatory. If the parameter is in "path",

View File

@ -1833,6 +1833,12 @@ public class DefaultCodegen {
p.minItems = qp.getMinItems();
p.uniqueItems = qp.isUniqueItems();
p.multipleOf = qp.getMultipleOf();
if (p.maximum != null || p.exclusiveMaximum != null ||
p.minimum != null || p.exclusiveMinimum != null ||
p.maxLength != null || p.minLength != null ||
p.maxItems != null || p.minItems != null ||
p.pattern != null ||
} else {
if (!(param instanceof BodyParameter)) {
LOGGER.error("Cannot use Parameter " + param + " as Body Parameter");