问题描述
我使用SpringBoot
和springdoc-openapi-ui
。我有带方法的控制器,其中包含数组作为url参数:
@Parameters(value = {
@Parameter(in = ParameterIn.QUERY,name = "output",example = "[f1,f2,f3]",content = @Content(array = @ArraySchema(schema = @Schema(type = "string"))))
})
public ResponseEntity<Object> showReportData(@RequestParam(value = "output") String[] outputFields) {
//some body
}
但是,当我打开SwaggerUI
时,在项目文本框中看不到示例值:
为什么会这样?为什么示例数组未显示在item中?
解决方法
这似乎与您的浏览器配置有关。 尝试更改浏览器...
数组在swagger-ui中的工作原理像。