Closed jryannel closed 1 year ago
Readonly properties allow API writers to designate properties as fields to be readonly.
In the YAML document you would add:
properties: - name: prop01 type: int readonly: true
In the IDL you would use
interface Demo { readonly prop0: int
In the template you can check the type field:
{{ range .Properties }} {{ if .IsReadOnly }} // write readonly code {{ end }} {{ end }}
The same applies also to struct fields. But in general we see properties much more useful to be readonly then struct fields.
Readonly properties allow API writers to designate properties as fields to be readonly.
In the YAML document you would add:
In the IDL you would use
In the template you can check the type field:
The same applies also to struct fields. But in general we see properties much more useful to be readonly then struct fields.