Open amritk opened 2 weeks ago
@amritk I had the same problem, but based on this #8 component.securitySchemes
should be placed inside the documentation property like
new Elysia().use(
swagger({
documentation: {
components: {
securitySchemes: {
BearerAuth: {
type: 'http',
scheme: 'bearer',
bearerFormat: 'JWT',
},
},
},
},
scalarConfig: {
authentication: {
preferredSecurityScheme: 'BearerAuth',
},
},
}),
).get(
'/endpoint',
() => 'endpoint',
{ detail: { security: [{ BearerAuth: [] }] }
);
this should be detailed in the documentation, took me a while to find out the proper configuration
As seen in this ticket, when you specify security on an endpoint, how can you get the securityScheme added to the components.securitySchemes in the openapi.json?