Skip to main content
Declare a field’s default and the constraints the runtime enforces before a value reaches your model. Use it as the default of an InputState field or of an @event handler parameter.
Signature
Any
The value a new session starts from. Omit it and the field is required: a client has to set it before its value is read. A mutable default is rejected when the class is declared.
str | None
What the client sees for the generated command, in the published schema.
int | float | None
Inclusive lower and upper bounds on a number.
int | None
Bounds on the length of a string or sequence.
list | None
The exhaustive set of accepted values.
bool
default:"False"
Marks free text a deployment should moderate. The runtime moderates nothing itself; the mark is a preference read off the published schema.
A value that violates a constraint is refused with invalid_command, the field keeps its old value, and your code is never called.