more enum support

This commit is contained in:
Tony Tam
2015-12-18 10:58:30 -08:00
parent 24ed12f448
commit 968c943c44
2 changed files with 3 additions and 1 deletions

View File

@@ -9,7 +9,7 @@ import java.util.Set;
public class CodegenModel {
public String parent;
public String name, classname, description, classVarName, modelJson;
public String name, classname, description, classVarName, modelJson, dataType;
public String unescapedDescription;
public String defaultValue;
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();

View File

@@ -841,6 +841,8 @@ public class DefaultCodegen {
if(impl.getEnum() != null && impl.getEnum().size() > 0) {
m.isEnum = true;
m.allowableValues = impl.getEnum();
Property p = PropertyBuilder.build(impl.getType(), impl.getFormat(), null);
m.dataType = getSwaggerType(p);
}
if (impl.getAdditionalProperties() != null) {
MapProperty mapProperty = new MapProperty(impl.getAdditionalProperties());