-
-
Notifications
You must be signed in to change notification settings - Fork 59
Closed
Description
Prerequisites
- I have written a descriptive issue title
- I have searched existing issues to ensure it has not already been reported
Fastify version
3.0.0
Plugin version
3.0.0
Node.js version
16.2.0
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
18.04
Description
I think root level required calls should be ignored, because it creates an invalid schema
Steps to Reproduce
const s = S.object().required().prop('foo', S.string())
ajv.compile(s.valueOf())Result:
Error: schema is invalid: data/required/0 must be string
Because s.valueOf().required array contains a symbol but it expected to be an array of string
Expected Behavior
S.object().required().prop('foo', S.string()).valueOf() should return a valid json-schema
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels