nir
nir

Reputation: 3868

how to replace Model schema Body parameter with actual example

I have spring-boot/spring-mvc and springfox swagger2 integration. I have attached sample screen shot. In parameter type of 'body' I have a Model schema which describe elements data types. string, 0 etc! How can I replace it with actual example so that I can 'Try it out' . That would be more useful for my API consumer.

enter image description here

Upvotes: 1

Views: 1599

Answers (1)

Haunted
Haunted

Reputation: 465

Not sure if you found the answer to this one, but I am going to answer this anyways.

The @ApiModelProperty has a property called example. You can make use of that.

@ApiModelProperty(value="name of the user", required=true, example="John")

Swagger

Upvotes: 2

Related Questions