问题
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
来源:https://stackoverflow.com/questions/33133512/how-to-replace-model-schema-body-parameter-with-actual-example