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.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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