API Methods Sort: Swagger version 3.0.2

I am using swagger version 3.0.2 , I also followed this answer , but there was no effect on the order of the method.

window.onload = function() {

  const ui = SwaggerUIBundle({
  .....
  apisSorter: "alpha",
  layout: "StandaloneLayout"
})

Can anyone tell a better way to reorder the API methods.

+4
source share
1 answer

Swagger UI 3.0.7 added support for the 2.x parameter operationsSorter, which controls the sorting of methods within each API / tag.

operationsSorter

API. "" ( - ), "" ( HTTP) (. Array.prototype.sort(), , ). , .

const ui = SwaggerUIBundle({
  url: "http://petstore.swagger.io/v2/swagger.json",
  ...
  operationsSorter: "alpha"
})

apisSorter 3.x.

+1

Source: https://habr.com/ru/post/1673008/


All Articles