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.18.0
8.6.0
16
Linux
22.04
Is there a way to hide authorization header from OpenAPI 3.1.0 UI, so that I would not need to set a dummy unused value every time?
import { fastify } from "fastify"; import fs from "@fastify/swagger"; import fsu from "@fastify/swagger-ui"; const app = fastify(); await app.register(fs, { openapi: { openapi: "3.1.0", components: { securitySchemes: { bearerAuth: { type: "http", scheme: "bearer", }, }, }, }, }); await app.register(fsu); app.get( "/", { schema: { headers: { type: "object", properties: { authorization: { type: "string" } }, required: ["authorization"], }, security: [{ bearerAuth: [] }], }, }, async (request, reply) => { return { hello: "world" }; } ); app .listen({ port: 3001 }) .then(() => { console.log("listening"); }) .catch((err) => console.log(err));
Authorization valued should not be required if already set or authorization property should be hidden in UI
The text was updated successfully, but these errors were encountered:
You are configuring it wrong. You have to define the security schema globally when initializing fastify-swagger.
Sorry, something went wrong.
@Uzlopak even if I move security: [{ bearerAuth: [] }], from routes to swagger coonfig it doesn't change anything
security: [{ bearerAuth: [] }],
fix(openapi): hide auth header when set in securityScheme
831b0d3
fixes fastify#734
Any chance to fix it?
Successfully merging a pull request may close this issue.
Prerequisites
Fastify version
4.18.0
Plugin version
8.6.0
Node.js version
16
Operating system
Linux
Operating system version (i.e. 20.04, 11.3, 10)
22.04
Description
Is there a way to hide authorization header from OpenAPI 3.1.0 UI, so that I would not need to set a dummy unused value every time?
Steps to Reproduce
Expected Behavior
Authorization valued should not be required if already set or authorization property should be hidden in UI
The text was updated successfully, but these errors were encountered: