knife4j icon indicating copy to clipboard operation
knife4j copied to clipboard

knife4j-openapi3-jakarta-spring-boot-starter @Schema注解无法对泛型的字段进行解释

Open liyuan0420 opened this issue 6 months ago • 1 comments

Describe the bug @Data @Schema(name = "ApiRespose") public class ApiResponse<T> implements Serializable { @Schema(description = "业务处理成功结果", requiredMode = Schema.RequiredMode.NOT_REQUIRED) private T data; } 外层使用时已明确了该字段类型也无法在文档显示出相关data的属性。 以前在2.x版本里面使用@APIModel和@ApiModelProperty的方式是正常的。 升级之后就不行了~

To Reproduce Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Knife4j Version (please complete the following information): <groupId>com.github.xiaoymin</groupId> <artifactId>knife4j-openapi3-jakarta-spring-boot-starter</artifactId> 4.4.0

Additional context Add any other context about the problem here.

liyuan0420 avatar Aug 16 '24 11:08 liyuan0420