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 Map<String, Object> allowableValues;
public CodegenProperty items; public CodegenProperty items;
public Map<String, Object> vendorExtensions; public Map<String, Object> vendorExtensions;
public Boolean hasValidation;
/** /**
* Determines whether this parameter is mandatory. If the parameter is in "path", * 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.minItems = qp.getMinItems();
p.uniqueItems = qp.isUniqueItems(); p.uniqueItems = qp.isUniqueItems();
p.multipleOf = qp.getMultipleOf(); 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 { } else {
if (!(param instanceof BodyParameter)) { if (!(param instanceof BodyParameter)) {
LOGGER.error("Cannot use Parameter " + param + " as Body Parameter"); LOGGER.error("Cannot use Parameter " + param + " as Body Parameter");