ReferenceSchema API
s.literal()
One exact value. Mostly used as the tag that tells the variants of a discriminated union apart.
Use it for
- The type field of a section in a page builder
Literal Schema
s.literal(string)
schemaOne exact value. Its main use is the tag of each variant in s.discriminatedUnion(). For a choice between a few strings, use s.enum().
Methods
.validate
Custom validation function
Example
Example
TypeScript