在Swagger UI中显示模型属性的默认值

时间:2019-11-14 09:50:17

标签: spring-boot swagger swagger-ui

我正在使用Spring Boot Java和Swagger 2来记录我的API。 我可以使用什么Spring注释在Swagger UI中显示默认值mydoggie

Desired Result

1 个答案:

答案 0 :(得分:0)

您可以添加示例和默认值,并使用以下注释在Swagger 2中显示:

@ApiModelProperty(value = "value to show", example = "example to show")

我希望对您有帮助