PacktPublishing / Accelerating-Server-Side-Development-with-Fastify

Accelerate Web Development with Fastify, published by Packt
MIT License
128 stars 37 forks source link

Missing a schema for 'limit' #61

Closed EnergeticPixels closed 1 month ago

EnergeticPixels commented 1 month ago

@Eomm @mcollina,

Fastify and nodejs is complaining about a missing schema definition for 'limit' and 'skip'. The book did not say anything about these. I am getting the error below. Did I miss something?

My sample code: https://github.com/EnergeticPixels/fastify_steroids/commit/32c444f504a3153fc5da1900b797bc197a8680e0

   {"level":50,"time":1725912348109,"pid":10093,"hostname":"MarsVenus","err":{"type":"FastifyError","message":"Failed building the validation schema for GET: /todos, due to error can't resolve reference schema:limit#/properties/limit from id schema:todo:list:query","stack":"FastifyError: Failed building the validation schema for GET: /todos, due to error can't resolve reference schema:limit#/properties/limit from id schema:todo:list:query\n at Boot.<anonymous> (/home/ajackman/projects/ep/fastify_steriods/node_modules/.pnpm/[fastify@4.28.1](vscode-file://vscode-app/c:/Users/energ/AppData/Local/Programs/Microsoft%20VS%20Code%20Insiders/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)/node_modules/fastify/lib/route.js:420:21)\n at Object.onceWrapper (node:events:633:28)\n at Boot.emit (node:events:531:35)\n at /home/ajackman/projects/ep/fastify_steriods/node_modules/.pnpm/[avvio@8.4.0](vscode-file://vscode-app/c:/Users/energ/AppData/Local/Programs/Microsoft%20VS%20Code%20Insiders/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)/node_modules/avvio/boot.js:102:12\n at /home/ajackman/projects/ep/fastify_steriods/node_modules/.pnpm/[avvio@8.4.0](vscode-file://vscode-app/c:/Users/energ/AppData/Local/Programs/Microsoft%20VS%20Code%20Insiders/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)/node_modules/avvio/boot.js:437:7\n at done (/home/ajackman/projects/ep/fastify_steriods/node_modules/.pnpm/[avvio@8.4.0](vscode-file://vscode-app/c:/Users/energ/AppData/Local/Programs/Microsoft%20VS%20Code%20Insiders/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)/node_modules/avvio/lib/plugin.js:226:5)\n at check (/home/ajackman/projects/ep/fastify_steriods/node_modules/.pnpm/[avvio@8.4.0](vscode-file://vscode-app/c:/Users/energ/AppData/Local/Programs/Microsoft%20VS%20Code%20Insiders/resources/app/out/vs/code/electron-sandbox/workbench/workbench.html)/node_modules/avvio/lib/plugin.js:250:9)\n at node:internal/process/task_queues:140:7\n at AsyncResource.runInAsyncScope (node:async_hooks:206:9)\n at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8)","code":"FST_ERR_SCH_VALIDATION_BUILD","name":"FastifyError","statusCode":500},"msg":"Failed building the validation schema for GET: /todos, due to error can't resolve reference schema:limit#/properties/limit from id schema:todo:list:query"}
EnergeticPixels commented 1 month ago

@Eomm, @mcollina

Please close this ticket as it was made in haste. I found the schema definition files within the Chapter 8 folder. When I discovered the issue, I was working from Chapter 7.

Fixes #61