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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Different Type Providers for validation and serialization #5359
Comments
Check out my PR: #5315 I am currently using my own fork to overcome this issue: https://github.com/Bram-dc/fastify/tree/separated-typeprovider With this type-provider:
|
Nice, hope it will be merged soon ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Prerequisites
馃殌 Feature Proposal
I am currently using Zod for validation and serialization with
fastify-type-provider-zod
.With Zod, you can infer the schema type using z.infer or z.input. In many cases, these types are identical, but they can differ if you utilize the
default
feature.For the schema below, it would be beneficial if Fastify could accept
{ name: undefined }
as a response. It could be achieved using a Type Provider based onz.input<typeof zodSchema>
.Basically in the zod type provider we could implement something like the following for serialization purposes.
It it something that could be discussed ?
Motivation
No response
Example
No response
The text was updated successfully, but these errors were encountered: