forked from loafle/openapi-generator-original
added enum class support
This commit is contained in:
@@ -13,11 +13,12 @@ public class CodegenModel {
|
||||
public String unescapedDescription;
|
||||
public String defaultValue;
|
||||
public List<CodegenProperty> vars = new ArrayList<CodegenProperty>();
|
||||
|
||||
public List<String> allowableValues;
|
||||
|
||||
// list of all required parameters
|
||||
public Set<String> mandatory = new HashSet<String>();
|
||||
|
||||
public Set<String> imports = new HashSet<String>();
|
||||
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums;
|
||||
public Boolean hasVars, emptyVars, hasMoreModels, hasEnums, isEnum;
|
||||
public ExternalDocs externalDocs;
|
||||
}
|
||||
|
||||
@@ -837,6 +837,10 @@ public class DefaultCodegen {
|
||||
addVars(m, properties, required);
|
||||
} else {
|
||||
ModelImpl impl = (ModelImpl) model;
|
||||
if(impl.getEnum() != null && impl.getEnum().size() > 0) {
|
||||
m.isEnum = true;
|
||||
m.allowableValues = impl.getEnum();
|
||||
}
|
||||
if (impl.getAdditionalProperties() != null) {
|
||||
MapProperty mapProperty = new MapProperty(impl.getAdditionalProperties());
|
||||
addParentContainer(m, name, mapProperty);
|
||||
|
||||
Reference in New Issue
Block a user