forked from loafle/openapi-generator-original
add methods to validate the ruby object
This commit is contained in:
@@ -42,7 +42,7 @@ public class CodegenProperty {
|
||||
public Map<String, Object> allowableValues;
|
||||
public CodegenProperty items;
|
||||
public Map<String, Object> vendorExtensions;
|
||||
public Boolean needValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
|
||||
public Boolean hasValidation; // true if pattern, maximum, etc are set (only used in the mustache template)
|
||||
|
||||
@Override
|
||||
public int hashCode()
|
||||
|
||||
@@ -1106,7 +1106,7 @@ public class DefaultCodegen {
|
||||
|
||||
// check if any validation rule defined
|
||||
if (property.minimum != null || property.maximum != null || property.exclusiveMinimum != null || property.exclusiveMaximum != null)
|
||||
property.needValidation = true;
|
||||
property.hasValidation = true;
|
||||
|
||||
// legacy support
|
||||
Map<String, Object> allowableValues = new HashMap<String, Object>();
|
||||
@@ -1129,7 +1129,7 @@ public class DefaultCodegen {
|
||||
|
||||
// check if any validation rule defined
|
||||
if (property.pattern != null || property.minLength != null || property.maxLength != null)
|
||||
property.needValidation = true;
|
||||
property.hasValidation = true;
|
||||
|
||||
property.isString = true;
|
||||
if (sp.getEnum() != null) {
|
||||
|
||||
Reference in New Issue
Block a user