How to re-order endpoints in SwaggerUI ?
For instance if I want to switch the places of these 2 controllers how should I do that?
I tried adding numbers in front of the controller's name but that only rearranged them in the solution explorer
3 Replies
I know there's an operation sort https://github.com/domaindrivendev/Swashbuckle.AspNetCore#change-operation-sort-order-eg-for-ui-sorting
And it looks like someone made it a bit easier with https://terencegolla.com/.net/swashbucklecustom-ordering-of-controllers/
Terence Golla
Swashbuckle Custom Ordering of Controllers
This article is an adaptation of an article written by Rob Janssen (RobIII) in 2018 on customizing the order in which controllers are display in the Swagger UI by Swashbuckle. It addresses the depreciation of the method OrderActionGroupsBy which is no longer available when using AddSwaggerGen, UseSwagger and UseSwaggerUI in your ASP.NET API pro...
GitHub
GitHub - domaindrivendev/Swashbuckle.AspNetCore: Swagger tools for ...
Swagger tools for documenting API's built on ASP.NET Core - GitHub - domaindrivendev/Swashbuckle.AspNetCore: Swagger tools for documenting API's built on ASP.NET Core
Just an observation, your routes with spaces are a bit cursed.
But moreover, post /person/create-person is redundant from a rest design perspective; same with delete.
At least if you're looking towards using rest.
Person is a resource, and the http verbs already describe the operations.
I see...
great ty, also love the House pic