MemberDef
MemberDef — defining one member's type, constraints, and optional/nullable/default behavior.
Writing a MemberDef
~ $schema: {
age: { number, min: 0, max: 120 }, # type + keyed options
level: { int16, 1, [1, 2, 3] }, # type + default + choices
name: { string, pattern: "^[A-Za-z]+$" }, # type + keyed option
tags: { array, of: string, minLen: 1 } # container type + options
}
---
~ 30, 2, John, [a, b]Validation against the TypeDef
age: { number, minimum: 10 }
---
42 # ✗ unknown-member — number has no option "minimum" (use min)Optional, nullable, and default
MemberDef vs. SchemaDef
Nested shapes
Implementation status (beta)
See Also
Last updated
Was this helpful?
