Skip to content

Commit

Permalink
Merge pull request #1269 from efossier/expose-readonly-to-template
Browse files Browse the repository at this point in the history
Expose readOnly attribute on model properties to templates
  • Loading branch information
wing328 committed Sep 23, 2015
2 parents 85f9993 + a6df340 commit d09d8bb
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 @@ -34,6 +34,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 @@ -642,6 +642,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 d09d8bb

Please sign in to comment.