Closed 0xMukesh closed 2 years ago
I never tried using it with @fastify/type-provider-typebox
and @sinclair/typebox
, so not sure what is the source of the error.
Can you try wrapping your Type.Object
with Type.Strict
? so it will be:
POST.opts = {
schema: {
body: Type.Strict(Type.Object({
name: Type.String({
description: "Name of the user",
}),
email: Type.String({
description: "Email of the user",
}),
})),
},
};
@yonathan06 Have tried it out, still the same error
Is there any kind of way to integrate other input-validation library such as zod
to fastify-now
?
not sure if that is a fastify-now
issue, does your code work with a regular route using register()
function?
Hey! I have figured out the issue, was a mistake from my side. Thanks for pointing me towards the solution 😄
Hey! I'm trying to use typebox along with fastify-now, but I'm facing errors while doing so.
I have installed and imported the
@fastify/type-provider-typebox
libraryI have configured the type-provider which would be used globally
I have imported
@sinclair/typebox
to my route file and added the schema via:When I try to run the application, I face this error: