Search code examples
javaspring-bootswagger-uispringfox

Swagger UI - customize Models section layout


I'd like to make some customizations in models layouts, or at least add some comments.

Here is how it looks like by default:

enter image description here

I use java springfox for swagger UI. Here is my Swagger config:

enter image description here

Is it possible to do that?


Solution

  • It seems to me that you are looking for @ApiModelProperty. You can annotate each attribute with it and include value parameter as the description. Additional details at https://www.baeldung.com/swagger-apiparam-vs-apimodelproperty.

    @ApiModelProperty(value = "Your description")
    int fromLocation;