【发布时间】:2020-05-09 10:06:15
【问题描述】:
我在文档中使用 swagger,但是我看到 DTO 在 Swagger UI 上是空的。
这是 DTO PatientDto
我可以看到 swagger 中有一个空模型
这里也是swagger配置
有人可以帮忙吗?
【问题讨论】:
标签: spring-boot swagger swagger-ui dto
我在文档中使用 swagger,但是我看到 DTO 在 Swagger UI 上是空的。
这是 DTO PatientDto
我可以看到 swagger 中有一个空模型
这里也是swagger配置
有人可以帮忙吗?
【问题讨论】:
标签: spring-boot swagger swagger-ui dto
您需要使用以下内容注释控制器:
@ApiImplicitParams({
@ApiImplicitParam(
name = "patientDto",
dataType = "PatientDto",
examples = @io.swagger.annotations.Example(
value = {
@ExampleProperty(value = "’patientDto‘:{'fName': 'John', 'lName='Doe'}", mediaType = "application/json")
}))
})
有关更多信息,您可以查看此讨论 https://github.com/springfox/springfox/issues/2352
它对我有用。
【讨论】: