I'm using Springdoc (1.4.8) to document our Rest API. 99% of the calls are secured using an OAuth2 Bearer Token so I'd like to add it by default like this:
new OpenAPI()
.components(new Components()
.addSecuritySchemes("bearerTokenScheme",
new SecurityScheme()
.type(SecurityScheme.Type.HTTP)
.name("bearerTokenScheme")
.scheme("Bearer")
.bearerFormat("JWT")
)
)
.addSecurityItem(new SecurityRequirement()
.addList("bearerTokenScheme")
)
This works fine to have it specified by default, but my question is now, can I somehow overrule it by specifying a single call to be unsecured?
I do realize that omitting .addSecurityItem() will show calls as unsecured by default, but I'd like to have them secured by default and only having to override it when unsecured.