Skip to main content
Shared Runs in your resource. See the Schemas guide for patterns. Every rule is bounded. Validated input has a known maximum size.

Builders

validate is fun(value): boolean, string?. It runs after the built-in checks inside pcall.
Unknown options raise with a suggestion. String, Array and Map without max raise at load time.

Define

UgSchemaRule[]
required
One rule per argument. Optional rules MUST be trailing.

Validate

boolean
table?
Fresh values with n set to the declared count. Use table.unpack(args, 1, args.n).
string?
Failure path, such as arg 1.items[2].name: MUST be a string. For server logs only.
Trailing nils are tolerated. Extra values are rejected.

Check

Validates one value against one rule.

Example