[OpenAPI] Cannot skip SecurityScheme for controllers with [AllowAnonymous] #61264
Labels
area-minimal
Includes minimal APIs, endpoint filters, parameter binding, request delegate generator etc
feature-openapi
Is there an existing issue for this?
Describe the bug
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/customize-openapi?view=aspnetcore-9.0
documentation shows you can do something like this
Which applies the security schema for all the endpoints, but it doesnt show a way to skip the endpoints or controllers that have the AllowAnonymousAttribute applied
for now the only workaround I have found is by using Tags, but it is a little hacky.
Expected Behavior
Please show an example on how to skip security requirements for controllers / endpoints that have the AllowAnonymousAttribute applied
Thanks.
Steps To Reproduce
The steps to repro the issue are at https://learn.microsoft.com/en-us/aspnet/core/fundamentals/openapi/customize-openapi?view=aspnetcore-9.0#use-document-transformers
Exceptions (if any)
No response
.NET Version
9.0.104
Anything else?
No response
The text was updated successfully, but these errors were encountered: