You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When creating an entity, sometimes initial values for a later readonly property might need to be created. Designing a schema with readonly does not work out, as it prevents writing once. Example:
/entity/{id}get:
schema:
type: objectproperties:
virtual:
type: booleanreadOnly: truename:
type: stringput:
schema:
oneOf:
- type: objectdescription: use only on createproperties:
virtual:
type: booleanwriteOnly: truename:
type: string
- type: objectdescription: use only on update (on name)properties:
virtual:
type: booleanreadOnly: truename:
type: string
The schema looks kind of redundant, as virtual should only be set on first put and become immutable afterwards. It can currently only be "solved" by adding a description when to use which schema. Is there any way to design a schema, defining properties immutable after creation?
The text was updated successfully, but these errors were encountered:
Retro64
changed the title
Provide property to document "write once" on entity creation, e.g. for an entity type
Provide property to document "write once" on entity creation/immutability after creation for a field of a property
Oct 11, 2021
Retro64
changed the title
Provide property to document "write once" on entity creation/immutability after creation for a field of a property
Provide property to document "write once" on entity creation/immutability after creation for a field of an entity
Oct 11, 2021
When creating an entity, sometimes initial values for a later readonly property might need to be created. Designing a schema with readonly does not work out, as it prevents writing once. Example:
The schema looks kind of redundant, as
virtual
should only be set on first put and become immutable afterwards. It can currently only be "solved" by adding a description when to use which schema. Is there any way to design a schema, defining properties immutable after creation?The text was updated successfully, but these errors were encountered: