springdoc-openapi icon indicating copy to clipboard operation
springdoc-openapi copied to clipboard

Sorter is not applied on OpenAPI API docs

Open netaravind opened this issue 5 years ago • 1 comments

Bug Description SpringDocs provides an option to sort the API resources by tags and operation id by using the following properties,

#For sorting endpoints alphabetically springdoc.swagger-ui.operationsSorter=alpha #For sorting tags alphabetically springdoc.swagger-ui.tagsSorter=alpha

This works fine for Swagger UI page, however the API docs link for OpenAPI spec file still shows unsorted resources.

To Reproduce Steps to reproduce the behavior:

  • springdoc-openapi-ui 1.5.10
  • The expectation is to show the Swagger UI and API docs API resources in the tags, operation id sort order, however Swagger UI shows the resources in the sorted order and API docs not.

Expected behavior

  • Both Swagger UI and API docs should show API resources in the sorted order specified in the application configuration

Screenshots Swagger UI Swagger UI

API Docs API Docs - OpenAPI Spec

netaravind avatar Sep 30 '21 19:09 netaravind

@netaravind,

As it's mentioned in the documentation. These are ui properties: springdoc.swagger-ui

The only sorting available for the /v3/api-docs endpoints is the alphabetical ordering using springdoc.writer-with-order-by-keys.

For anything else, use OpenApiCustomiser. And you have a lot of samples for ordering that you can adapt: https://github.com/springdoc/springdoc-openapi/issues/890

bnasslahsen avatar Sep 30 '21 21:09 bnasslahsen