Skip to content
Advertisement

springfox ApiModelProperty position sorting not working

In my spring boot application, I cannot be able to manage my swagger JSON with fields ordered properly on @ApiModel annotated class.

Firstly, I imported springfox lib into my pom.xml:

JavaScript

Secondly, I created SwaggerConfig.java:

JavaScript

Thirdly, I created my PersonDTO annotated by @ApiModel:

JavaScript

Then, when I requesting for Json output at url http://localhost:[port]/[servlet-context-path]/v2/api-docs, it seems that the position order is not working:

JavaScript

Advertisement

Answer

This is currently broken in 3.0.0 see https://github.com/springfox/springfox/issues/3391

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement