Skip to content

Commit df26cbd

Browse files
committed
feat: use readonly keyword in document and row model params
1 parent 8e8e396 commit df26cbd

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

templates/react-native/src/models.ts.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export namespace Models {
1111
/**
1212
* {{ property.description }}
1313
*/
14-
{{ property.name }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }};
14+
{% if property.readOnly %}readonly {% endif %}{{ property.name }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }};
1515
{% endfor %}
1616
}
1717
{% if definition.additionalProperties %}

templates/web/src/models.ts.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export namespace Models {
1414
/**
1515
* {{ property.description | raw }}
1616
*/
17-
{{ property.name }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }};
17+
{% if property.readOnly %}readonly {% endif %}{{ property.name }}{% if not property.required %}?{% endif %}: {{ property | getSubSchema(spec) | raw }};
1818
{% endfor %}
1919
}
2020
{% if definition.additionalProperties %}

0 commit comments

Comments
 (0)