Schema decorators

Decorators (written @name or @name(args)) attach schema metadata to declarations and fields, describing the document's legal structure that wcl check validates.

DecoratorPurpose
@documentMarks the type as the document root schema (composes per namespace — many merge)
@block("kind")Makes the type a nestable block of that kind
@child("kind")A field holding a single nested block of the given kind
@children("kind")A field holding a list of nested blocks (or union variants — dispatch)
@inline(slot)Binds the block's positional label to a field
@default(expr)Default value used when the field is omitted
@table("kind")Marks the row schema for pipe-table syntax
@decorator("name")Makes the type the schema for a user-defined @name decorator's arguments
@docCarries documentation metadata attached to a declaration
@by_refA block of this kind reifies to a resolvable reference instead of inlining (carried on a record, rendered elsewhere)
@only / @exceptRestrict which kinds or fields a slot accepts (include-list / exclude-list)
@connections(S)Accumulates -> connection statements on the field as records of schema S

Related

- Schema & Decorators

- Fields & Blocks

- Connections