We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
4.3.0
7.4.1
18.4
macOS
12.4
I have a route protected by bearer token and I would like swagger to capture this in the documentation. The route is defined as such:
async function routes(fastify: FastifyInstance) { fastify.get(`/users`, { onRequest: [fastify.authenticate], schema: { security: [ { "apiKey": [] } ] } },
However the compiler complains about error TS2322: Type '{ security: { apiKey: never[]; }[]; }' is not assignable to type 'FastifySchema'
error TS2322: Type '{ security: { apiKey: never[]; }[]; }' is not assignable to type 'FastifySchema'
Apply the schema.security property to fastify routes as per the readme https://github.com/fastify/fastify-swagger
schema.security
No response
The text was updated successfully, but these errors were encountered:
Similar issue fastify/fastify#4122
Looks like I needed to do an extra step to register my types.
Sorry, something went wrong.
No branches or pull requests
Prerequisites
Fastify version
4.3.0
Plugin version
7.4.1
Node.js version
18.4
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
12.4
Description
I have a route protected by bearer token and I would like swagger to capture this in the documentation. The route is defined as such:
However the compiler complains about
error TS2322: Type '{ security: { apiKey: never[]; }[]; }' is not assignable to type 'FastifySchema'
Steps to Reproduce
Apply the
schema.security
property to fastify routes as per the readme https://github.com/fastify/fastify-swaggerExpected Behavior
No response
The text was updated successfully, but these errors were encountered: