Duplicit security content for methods in minimal api
Problem
on each access of swagger.json file new security item is inserted
on 4th access it looks like this:
"security": [
{
"oauth2": [ ]
},
{
"oauth2": [ ]
},
{
"oauth2": [ ]
},
{
"oauth2": [ ]
}
]
Version
Framework: net8.0 Microsoft.AspNetCore.OpenApi: 8.0.3 Swashbuckle.AspNetCore: 6.5.0 Swashbuckle.AspNetCore.Filters: 8.0.1
Example
https://github.com/scholtz/TestMinimalAPI
Why is it problem
We want to use the swagger for generated clients and in cicd pipeline on each build of the web api we want to insert into the code repo the generated swagger file which will rebuild the affected shared client. Because on each hit we get different file and will force rebuild of the project.
I can't reproduce this, and the URL https://github.com/scholtz/TestMinimalAPI gives me a 404 - is it a private repo?
Which of my filters are you using? And how are they configured in Program.cs?
@mattfrear sorry, my mistake, https://github.com/scholtz/TestMinimalAPI is public now.
thanks
I'm not sure why yet, but this is caused by your usage of .WithOpenApi();
If you remove that it doesn't happen.
Released https://www.nuget.org/packages/Swashbuckle.AspNetCore.Filters/8.0.2