Search code examples
springspring-bootswaggerswagger-uispringfox

Swagger UI custom order of endpoint parameters


As we can see spring orders parameters by the name alphabetically.

enter image description here

I'd like to provide a custom order like in the @ApiModel class.

enter image description here

So fromLocation should be the last.

How can I achieve this?


Solution

  • It looks like this is not possible on Springfox and since the move to Java 8 it is alphabetically ordered:

    What we discovered when moving to java 8 compiler was that the order changed. When we realized that was the case, the parameters were changed to being alphabetically sorted

    More details: https://github.com/springfox/springfox/issues/2418