Prerequisites
Fastify version
4.27.0
Plugin version
8.14.0
Node.js version
20.11.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.5
Description
await app.register(swagger, {
mode: 'dynamic',
openapi: config.get('openapi'),
exposeHeadRoutes: false
})
Even if exposeHeadRoutes is set to false, HEAD routes still exist in the specification.
I traced the code and found that it works correctly after modifying the following code in addHook() (lib/util/add-hook.js):
// routes.push(routeOptions)
routes.push({...routeOptions})
I'm not sure if there is a problem with modifying it like this, or if there is another better way?
Link to code that reproduces the bug
No response
Expected Behavior
No response
Prerequisites
Fastify version
4.27.0
Plugin version
8.14.0
Node.js version
20.11.1
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
14.5
Description
Even if
exposeHeadRoutesis set to false, HEAD routes still exist in the specification.I traced the code and found that it works correctly after modifying the following code in addHook() (
lib/util/add-hook.js):I'm not sure if there is a problem with modifying it like this, or if there is another better way?
Link to code that reproduces the bug
No response
Expected Behavior
No response