Expose readOnly attribute on model properties to templates, can now use isReadOnly property in model templates

This commit is contained in:
Evan Fossier 2015-09-21 17:34:23 -07:00
parent 9e5de7da5e
commit a6df340cdc
2 changed files with 2 additions and 0 deletions

View File

@ -32,6 +32,7 @@ public class CodegenProperty {
public Boolean hasMore = null, required = null, secondaryParam = null;
public Boolean isPrimitiveType, isContainer, isNotContainer;
public boolean isEnum;
public Boolean isReadOnly = false;
public List<String> _enum;
public Map<String, Object> allowableValues;
public CodegenProperty items;

View File

@ -628,6 +628,7 @@ public class DefaultCodegen {
property.example = p.getExample();
property.defaultValue = toDefaultValue(p);
property.jsonSchema = Json.pretty(p);
property.isReadOnly = p.getReadOnly();
String type = getSwaggerType(p);
if (p instanceof AbstractNumericProperty) {