seriousme / fastify-openapi-glue

A plugin for the Fastify webserver to autogenerate a Fastify configuration based on a OpenApi(v2/v3) specification.
MIT License
202 stars 34 forks source link

example fails with FST_ERR_SCH_VALIDATION_BUILD #457

Closed mark1010 closed 1 year ago

mark1010 commented 1 year ago

steps to recreate:

follow Examples in README.md:

vscode ➜ /workspaces/fastify-openapi-glue (master) $ npm i

> fastify-openapi-glue@4.1.2 prepare
> husky install

husky - Git hooks installed

added 328 packages, and audited 491 packages in 1m

42 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
npm notice 
npm notice New minor version of npm available! 9.5.0 -> 9.6.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v9.6.0
npm notice Run npm install -g npm@9.6.0 to update!
npm notice 
vscode ➜ /workspaces/fastify-openapi-glue (master) $ npm start

> fastify-openapi-glue@4.1.2 start
> fastify start examples/petstore/index.js

FastifyError [Error]: Failed building the validation schema for POST: /v2/pet, due to error strict mode: unknown keyword: "xml"
    at Boot.<anonymous> (/workspaces/fastify-openapi-glue/node_modules/fastify/lib/route.js:366:21)
    at Object.onceWrapper (node:events:627:28)
    at Boot.emit (node:events:525:35)
    at /workspaces/fastify-openapi-glue/node_modules/avvio/boot.js:160:12
    at /workspaces/fastify-openapi-glue/node_modules/avvio/plugin.js:275:7
    at done (/workspaces/fastify-openapi-glue/node_modules/avvio/plugin.js:200:5)
    at check (/workspaces/fastify-openapi-glue/node_modules/avvio/plugin.js:224:9)
    at node:internal/process/task_queues:140:7
    at AsyncResource.runInAsyncScope (node:async_hooks:204:9)
    at AsyncResource.runMicrotask (node:internal/process/task_queues:137:8) {
  code: 'FST_ERR_SCH_VALIDATION_BUILD',
  statusCode: 500
}
seriousme commented 1 year ago

Hi,

Good find, a fix is in the works. The regression escaped the test suite, which has also been fixed now.

Thanks for reporting, Hans

seriousme commented 1 year ago

FYI: I just released 4.1.3 on NPM in which the issue should be fixed.

mark1010 commented 1 year ago

Thanks, that's working for me now 👍.