Skip to content
Discussion options

You must be logged in to vote

@mad-coder-365 Hi,

"@fastify/type-provider-typebox": "^5.1.0",

By default, the Fastify Type Provider uses Ajv under the hood, so Ajv will be responsible for generating error messages. To have TypeBox generate errors, you will need to override the Fastify validation compiler. The TypeBox provider has a Fastify compatible compiler function built in, you just need to enable it using the following.

https://github.com/fastify/fastify-type-provider-typebox?tab=readme-ov-file#type-compiler

I think if you set this up, the, validation errors will flow through SetErrorFunction.

Let me know if this helps
S

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@mad-coder-365
Comment options

@mad-coder-365
Comment options

Answer selected by mad-coder-365
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants