-
-
Notifications
You must be signed in to change notification settings - Fork 28
Closed
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure the bug has not already been reported
Fastify version
4.3.0
Plugin version
No response
Node.js version
16.15.1
Operating system
Windows
Operating system version (i.e. 20.04, 11.3, 10)
10
Description
When the fastify validator calls the validator function (https://github.com/fastify/fastify/blob/66fc397212531c2565a9cb86a2c0f4a2f06a8c77/lib/validation.js#L79), it checks if a return is type
or has an error on it.
The TypeBox provider actually throws an excetion (
fastify-type-provider-typebox/index.ts
Line 28 in 5901092
throw new TypeBoxValidationError([...typeCheck.Errors(value)]) |
Steps to Reproduce
- Create a simple application using the TypeBox provider
- Register a route with a given schema (I have tested with a
body
param) - Try to make a request to the route with a missing field
fastify.route({
method: "POST",
url: "/user/sign-up",
schema: {
body: Type.Object({
email: Type.String()
})
},
handler() { }
})
Expected Behavior
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomers