How do I make swagger-ui to show pre-populated real values in the Example box below? (The box for request model that shows when user clicks on "Try it out" button in swagger-ui).
I am using SpringBoot/Java and I would like it to show some real values rather than data types. It seam to do that for DOB field by default.
I have MyModel
defined as below and I was expecting that using "value
" in ApiModelProperty
will set these values but it is not:
@ApiModel(description="blahblah")
public class MyModel {
@ApiModelProperty(notes = "some notes", name = "name", required = true, value = "Bot")
private String name;
@ApiModelProperty(notes = "Date of birth", name = "dob", required = true)
private OffsetDateTime dob;
@ApiModelProperty(notes="How old", name = "age", required = true, value = "31")
private Integer age;
...
}
I would like above to look like:
Use example
:
@ApiModelProperty(notes = "some notes", name = "name", required = true, example = "Bot")
private String name;