Swagger UI 端点参数的自定义顺序

Swagger UI custom order of endpoint parameters

我们可以看到 spring 按名称的字母顺序对参数排序。

我想像@ApiModel class 中那样提供自定义订单。

所以 fromLocation 应该是最后一个。

我怎样才能做到这一点?

看起来这在 Springfox 上是不可能的,因为移动到 Java 8 它是按字母顺序排列的:

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

更多详情:https://github.com/springfox/springfox/issues/2418