samchon / nestia

NestJS Helper Libraries + TypeScript OpenAPI generator
https://nestia.io/
MIT License
1.76k stars 91 forks source link

Feat: Support Swagger Optional Security Tag #847

Closed rojiwon123 closed 5 months ago

rojiwon123 commented 5 months ago

In OpenAPI, optional security is supported, which refers to APIs where authorization tokens may or may not be present. To support this in Nestia, some code modifications were made.

Below is how you can add optional security:

@nest.Controller("security")
export class Controller{
  /**
  * @security
  * @security bearer
  */
  async security(){}
}

about #849 about https://github.com/OAI/OpenAPI-Specification/issues/14

samchon commented 5 months ago

Upgrade to v2.6.1, then your feature be activated.