Skip to content

Commit

Permalink
Expose readOnly attribute on model properties to templates, can now u…
Browse files Browse the repository at this point in the history
…se isReadOnly property in model templates
  • Loading branch information
Evan Fossier committed Sep 22, 2015
1 parent 9e5de7d commit a6df340
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -628,6 +628,7 @@ public CodegenProperty fromProperty(String name, Property p) {
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) {
Expand Down

0 comments on commit a6df340

Please sign in to comment.