On my Swagger page, I am (mostly) able to order the operations as described on the Swashbuckle page.
Below the operations is a "Schemas" section showing the data structures used by the actions. These data structures appear in a arbitrary order. I would like to sort them.
The question Swagger sort Schema Defintions superficially looks like the same question, but in that question "sort" is used in the sense of "sorting the items into different bins", not "ordering a list" which is what I want.
I have made a document filter that "works", but when I look at the code I wrote, I die a little inside.
Is there a more correct way to do this?
Edit: To be specific, what I object to about this code is that it is "working" by sorting the entries in a Dictionary, which is just bad ( see this question ).
Turns out the answer was simply to use a SortedDictionary:
openApiDoc.Components.Schemas = new System.Collections.Generic.SortedDictionary<string, OpenApiSchema>(openApiDoc.Components.Schemas);