Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

通过swagger.v3的注解@ApiResponse定义的Response Content无法展示 #745

Open
likue opened this issue Feb 29, 2024 · 1 comment
Open

Comments

@likue
Copy link

likue commented Feb 29, 2024

Describe the bug
通过swagger.v3的注解@ApiResponse定义的Response Content无法展示,原始swagger是可以正常展示的
image
image

To Reproduce
Steps to reproduce the behavior:

  1. 使用以下注解:置于Controller类接口控制方法上
    @ApiResponse(responseCode = "200", content = @Content(mediaType = "application/json", schemaProperties = {@SchemaProperty(name = "a", schema = @Schema(name = "aname",title = "a_array_item_title",type = "integer",defaultValue = "1",minimum = "0",maximum = "100")), @SchemaProperty(name = "b", schema = @Schema(name = "b_name",title = "b_array_item_title",type = "integer",defaultValue = "1",minimum = "0",maximum = "100"))}, array =@ArraySchema(schema = @Schema(title = "请求数组",type = "object",example = "{\"a\":1}"))))
  2. 启动服务,分别打开/swagger-ui/index.html地址与doc.html查看,swagger正常展示,knife4j无法展示。

Knife4j Version (please complete the following information):

  • Knife4j Version : 4.5.0
  • spring-boot 3.2.3

Additional context
image
image
需要处理一下接口返回json格式的数据

@AnyFork
Copy link

AnyFork commented Apr 18, 2024

解决了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants