- Notifications
You must be signed in to change notification settings - Fork710
[Swagger] FormatGroupName generates an extra ApiVersionDescription#1036
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I am using the latest version of the ApiExplorer (v7.1) and I am currently attempting to have different swagger documents for different controllers but also have versioning in addition to that.
I define my ApiExplorer as such:
But then, inside of the my
And end up with three Swagger documents with group names:
But only my two documents show up in the loop, i.e. |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 1 comment
-
Your configuration looks correct to me. I configured a similar setup using theOpenAPI example with the following changes: Added: [ApiVersion(1.0)][Route("api/[controller]")]publicclassValuesController:ControllerBase{[HttpGet]publicIActionResultGet()=>Ok();} Changed: [ApiVersion(1.0)][ApiVersion(0.9,Deprecated=true)][ApiExplorerSettings(GroupName="Orders")][Route("api/[controller]")]publicclassOrdersController:ControllerBase{// omitted for brevity} [ApiVersion(1.0)][ApiVersion(0.9,Deprecated=true)][ApiExplorerSettings(GroupName="People")][Route("api/v{version:apiVersion}/[controller]")]publicclassPeopleController:ControllerBase{// omitted for brevity} .AddApiExplorer( options=>{options.GroupNameFormat="'v'VVV";options.SubstituteApiVersionInUrl=true;options.FormatGroupName=(group,version)=>$"{group}-{version}";}); which produces the following: ![]()
Everything else is unchanged. That is what I would expect. I see that you're still using the older Sidebar
|
BetaWas this translation helpful?Give feedback.