springdoc / springdoc-openapi

Library for OpenAPI 3 with spring-boot
https://springdoc.org
Apache License 2.0
3.26k stars 493 forks source link

Missing custom example for operationsSorter and tagsSorter #2730

Closed CarlosOnline closed 1 week ago

CarlosOnline commented 1 week ago

I scanned the internet and can't find any examples of using custom opertationsSorter.

Can you please provide an example of a custom opertationsSorter function for Spring Boot Java?

What arguments are passed to the opertationsSorter ?

bnasslahsen commented 1 week ago

This duplicate of https://github.com/springdoc/springdoc-openapi/issues/1335

This example test of opertationsSorter, that you can use properties: https://github.com/springdoc/springdoc-openapi/blob/0287e836c425823c3102607bc8c698ca9cb38102/springdoc-openapi-starter-webmvc-ui/src/test/java/test/org/springdoc/ui/app27/SpringDocApp27Test.java#L30-L48

If you need to declare a JS function, you can have a look how to inject custom JS code from Java.

After window.ui = SwaggerUIBundle, you can add your customer functions.