79763300

Date: 2025-09-12 19:50:19
Score: 2.5
Natty:
Report link

Just add this document.security = [{ bearer: [] }] after creating the Swagger document.
There is no need to add @ApiBearerAuth to every controller.

const config = new DocumentBuilder()
    .setTitle('API Documentation')
    .setVersion('1.0')
    .addBearerAuth()
    .build();
  const document = SwaggerModule.createDocument(app, config);

  // ✅ Apply bearer globally
  document.security = [{ bearer: [] }];
Reasons:
  • Blacklisted phrase (1): this document
  • Has code block (-0.5):
  • User mentioned (1): @ApiBearerAuth
  • Low reputation (1):
Posted by: Atishay Jain