Skip to content

Commit

Permalink
docs: Add documentation for zod type provider (#4456)
Browse files Browse the repository at this point in the history
Co-authored-by: Frazer Smith <frazer.dev@outlook.com>
  • Loading branch information
kibertoad and Fdawgs committed Jun 25, 2023
1 parent 433439f commit 03c5fc7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs/Reference/Type-Providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ keep associated types for each schema defined in your project.

Type Providers are offered as additional packages you will need to install into
your project. Each provider uses a different inference library under the hood;
allowing you to select the library most appropriate for your needs. Type
allowing you to select the library most appropriate for your needs. Official Type
Provider packages follow a `@fastify/type-provider-{provider-name}` naming
convention.
convention, and there are several community ones available as well.

The following inference packages are supported:

- `json-schema-to-ts` -
[github](https://github.com/ThomasAribart/json-schema-to-ts)
- `typebox` - [github](https://github.com/sinclairzx81/typebox)
- `zod` - [github](https://github.com/colinhacks/zod)

### Json Schema to Ts

Expand Down Expand Up @@ -91,6 +92,12 @@ See also the [TypeBox
documentation](https://github.com/sinclairzx81/typebox#validation) on how to set
up AJV to work with TypeBox.

### Zod

See [official documentation](https://github.com/turkerdev/fastify-type-provider-zod)
for Zod type provider instructions.


### Scoped Type-Provider

The provider types don't propagate globally. In encapsulated usage, one can
Expand Down

0 comments on commit 03c5fc7

Please sign in to comment.