Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add documentation for zod type provider #4456

Merged
merged 8 commits into from
Jun 25, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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