java - Sort API methods in Swagger-UI -


I can not find a working example, how can I find the following: I want my API Methods of Sorting in Swag-UI (GET-POST-PUT-DELETE) or / and alphabetically.

So far, all the methods are displayed in a random order, not even in the order of my source code.

I use jack-rs + jersey 1.

Sorting by the @OpoOptions feature is not an option for me, because there are so many ways and the API is still spreading, so I'll need it if all is new, then update all .

Any hint?

Update for Swagger UI 2.1.0 +: Sorter The parameter is divided into two parameters, as stated in:

apisSorter

Apply a type in the API / tag list 'Alpha' (sorted by name) or a function can be done (see array.prototype sort.) To know how the sort function works). The default is the order given by the server unchanged.

Operations Server

Apply one type to the operations list of each API. It can be 'alpha' (depending on the path of alphanumeric form), 'method' (sorted by the HTTP method) or a function (see example.proteotype sort), how it works out how the sort function works. ). By default the order unchanged by the server is returned.

Then you would like to update the sorter to sort the API code to apisSorter alphabetically, and / or operations Source to sort the operations list for each API

  window.swaggerUi = new swaggerUi ({apisSorter: "APISSortter:" alpha "});  

For older swirling UI versions of more than 2.100 :

The sorter parameter is still relevant to the old Swagger UI Edition of:

SwaggerUi instantaneously You can use the Sorter parameter while specifying this swarj-UI in index.html in JavaScript. From:

A type of sorter API list It can be ' alpha ' (alphanumeric order path) or ' method ' (sort operation by HTTP method). By default, the server is unchanged The order has been given.

:

  window.swaggerUi = new swgger Uai ({... sorter: "alpha"});    

Comments

Popular posts from this blog

c# - Textbox not clickable but editable -

Matlab transpose a table vector -

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -