schemaErrorFormatter
uses an insufficient validation type
#4093
Labels
feature request
New feature to be added
help wanted
Help the community by contributing to this issue
semver-minor
Issue or PR that should land as semver minor
typescript
TypeScript related
Prerequisites
Fastify version
4.2.0
Plugin version
No response
Node.js version
16.15.1
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
Irrelevant
Description
The
FastifySchemaValidationError
type used for theschemaErrorFormatter
callback has a small subset of the fields available from the full Ajv validation error object.fastify/types/schema.d.ts
Lines 25 to 28 in 8fccc46
This is the proper object:
fastify/fastify.d.ts
Lines 178 to 190 in 8fccc46
Steps to Reproduce
Workaround:
Expected Behavior
Compiles, resulting in pretty errors like this:
body.roles[0] must be equal to one of the allowed values: internal, owner, admin, communicator
body.roles must NOT have more than 1 items
querystring.ownerId must NOT have fewer than 28 characters
The text was updated successfully, but these errors were encountered: