mirror of
https://github.com/valitydev/openapi-generator.git
synced 2024-11-08 19:33:55 +00:00
Expose readOnly attribute on model properties to templates, can now use isReadOnly property in model templates
This commit is contained in:
parent
9e5de7da5e
commit
a6df340cdc
@ -32,6 +32,7 @@ public class CodegenProperty {
|
|||||||
public Boolean hasMore = null, required = null, secondaryParam = null;
|
public Boolean hasMore = null, required = null, secondaryParam = null;
|
||||||
public Boolean isPrimitiveType, isContainer, isNotContainer;
|
public Boolean isPrimitiveType, isContainer, isNotContainer;
|
||||||
public boolean isEnum;
|
public boolean isEnum;
|
||||||
|
public Boolean isReadOnly = false;
|
||||||
public List<String> _enum;
|
public List<String> _enum;
|
||||||
public Map<String, Object> allowableValues;
|
public Map<String, Object> allowableValues;
|
||||||
public CodegenProperty items;
|
public CodegenProperty items;
|
||||||
|
@ -628,6 +628,7 @@ public class DefaultCodegen {
|
|||||||
property.example = p.getExample();
|
property.example = p.getExample();
|
||||||
property.defaultValue = toDefaultValue(p);
|
property.defaultValue = toDefaultValue(p);
|
||||||
property.jsonSchema = Json.pretty(p);
|
property.jsonSchema = Json.pretty(p);
|
||||||
|
property.isReadOnly = p.getReadOnly();
|
||||||
|
|
||||||
String type = getSwaggerType(p);
|
String type = getSwaggerType(p);
|
||||||
if (p instanceof AbstractNumericProperty) {
|
if (p instanceof AbstractNumericProperty) {
|
||||||
|
Loading…
Reference in New Issue
Block a user