merged from #271

This commit is contained in:
Tony Tam 2014-09-26 09:39:39 -07:00
parent 2dd73872a4
commit eb6c09bfce
2 changed files with 11 additions and 3 deletions

View File

@ -1,13 +1,18 @@
package com.wordnik.swagger.codegen;
import com.wordnik.swagger.models.*;
import com.wordnik.swagger.models.properties.*;
import java.util.*;
public class CodegenProperty {
public String baseName, complexType, getter, setter, description, datatype,
name, min, max, defaultValue, baseType, containerType;
/** maxLength validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.1 */
public Integer maxLength;
/** minLength validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.2 */
public Integer minLength;
/** pattern validation for strings, see http://json-schema.org/latest/json-schema-validation.html#rfc.section.5.2.3 */
public String pattern;
public Double minimum, maximum, exclusiveMinimum, exclusiveMaximum;
public Boolean hasMore = null, required = null, secondaryParam = null;
public Boolean isPrimitiveType, isContainer, isNotContainer;

View File

@ -412,6 +412,9 @@ public class DefaultCodegen {
if(p instanceof StringProperty) {
StringProperty sp = (StringProperty) p;
property.maxLength = sp.getMaxLength();
property.minLength = sp.getMinLength();
property.pattern = sp.getPattern();
if(sp.getEnum() != null) {
List<String> _enum = sp.getEnum();
property._enum = _enum;