Transformation
We can transform schema into various formats, including other other libraries and JSON schema.
For out-of-the-box library support, view the Library Support page.
If you're looking to implement custom parsers and formatters, keep reading these docs.
Given the nature and complexity of schema/validation libraries, conversions tend to be a somewhat lossy process, meaning perfect transformations are not always possible.
Parser
Parsers convert a schema into an abstract "schema def". This is somewhat similar to JSON schema, but simpler and easier to work with.
Formatter
Formatter
s are used to convert schema defs into another form. For example, given a schema def, a zod
formatter would convert the def into usable zod
schema.
Discriminator
Discriminator
s are used determine if a schema is of a particular library.