aspnet-api-versioning
aspnet-api-versioning copied to clipboard
Do we have any samples about how to generate OpenAPI documents with ApiVersion and Group
trafficstars
Is there an existing issue for this?
- [x] I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
Do we have any samples about how to generate OpenAPI documents with ApiVersion and Group?
Describe the solution you'd like
Hope can see some samples like Swagger samples that show how to generate Open API document with ApiVersion and Group.
Additional context
No response
I am looking for the same thing. I can only find an example using swagger. https://github.com/dotnet/aspnet-api-versioning/blob/main/examples/AspNetCore/WebApi/MinimalOpenApiExample/Program.cs
Is this possible?
Just having
services
.AddOpenApi("v1)
.AddOpenApi("v2)
.AddApiVersioning(opt => {
opt.ReportApiVersions = true;
}).AddApiExplorer(options => {
options.GroupNameFormat = "'v'VVV";
});
//app init
app.MapOpenApi();
Makes both v1 and v2 documents available and with the correct looking structures