Search code examples
c#swaggerswashbuckle

Adding Nested Grouping Sections in the UI for Actions within a Controller


Is it possible to have subsections within an action grouping? We currently use Controller-based differentiation to group functions, but are hosting a large amount of controllers and could use further nesting.

In other words, I know actions can be grouped/ordered with the following, but is it possible to group them multiple times:

  c.GroupActionsBy(apiDesc => apiDesc.HttpMethod.ToString());
  c.OrderActionGroupsBy(new DescendingAlphabeticComparer());

Solution

  • In theory yes, we can group actions multiple times we can create an insanity of nested groups, swagger & swashbuckle are both open-source if is not implemented we can do it ourselves, but my guess is that it will take a lot of time.

    My recommendation: upgrade to the latest swagger-ui 3.x, the latest version has a filter that doubles down as a search, take a look at my latest:

    http://swashbuckletest.azurewebsites.net/swagger/ui/index http://swashbuckletest.azurewebsites.net/swagger/ui/index?filter=Test



    I have not published my version to Nuget yet, if you want to try it is here: https://www.myget.org/feed/heldersepu/package/nuget/Swagger-Net