This repository reproduces a validation error with [email protected]
when using Zod schemas with Fastify routes. The error occurs for a GET
route with a querystring
schema and may affect POST
routes with a body
schema.
Environment Node.js: v18.x Fastify: 5.2.1 fastify-type-provider-zod: 4.0.2 Zod: 3.24.2 TypeScript: 5.7.3
Failed building the validation schema for GET: /api/example, due to error schema is invalid: data/required must be array
- Install dependencies:
npm install
npm start
curl "http://localhost:3000/api/example?limit=10&offset=0"
Failed building the validation schema for GET: /api/example, due to error schema is invalid: data/required must be array
curl http://localhost:3000/debug-schema