3

I want to modify the Example Value under the Data Type on my Swagger-ui interface. currently it contains the following default value (generated by Swagger):

"user":{
        "birth":null,
        "nationality":null,
        "lastname":null,
        "firstname":null,
        "identity":null
     }

I want to specify real values instead of the "null" values. PS: I use spring boot with annotations: @ApiOperation,...

StanislavL
  • 56,971
  • 9
  • 68
  • 98
Chayma Atallah
  • 725
  • 2
  • 13
  • 30

1 Answers1

0

You must then insert @ApiModelProperty anotation for all your attributes inside your bean. Then put an example attribute inside. Let's say your user is mapped to the User.java class, so you would have:

public class User {

    @ApiModelProperty(value = "The birthdate", example = "1985-12-07", format= "yyyy-MM-dd")
    private String birth;
A. Masson
  • 2,287
  • 3
  • 30
  • 36