xiaoymin / knife4j

Knife4j is a set of Swagger2 and OpenAPI3 All-in-one enhancement solution
https://doc.xiaominfo.com
Apache License 2.0
4.06k stars 613 forks source link

实体类中是用@Schema注解注释单个小写字母的驼峰命名字段,注解不生效问题 #675

Open trifolium-x opened 10 months ago

trifolium-x commented 10 months ago

Describe the bug 您好,我在springDoc提了一个bug没人回应,你能帮我看看是什么原因 A clear and concise description of what the bug is. 在实体类中使用@Schema注释比如 private String hName,private String aTest这样的字段,不生效,除非是类似于 private String userName,private String test Screenshots image

image

Knife4j Version (please complete the following information):

<dependency>
            <groupId>com.github.xiaoymin</groupId>
            <artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
            <version>4.3.0</version>
        </dependency>
xiaoymin commented 10 months ago

是的,不能这么写,解析框架会认为不规范

trifolium-x commented 10 months ago

这就非常难受了,改的东西太多了,怎么会有这么奇怪要求。

trifolium-x commented 10 months ago

这个问题似乎是Jackson造成的: https://stackoverflow.com/questions/30205006/why-does-jackson-2-not-recognize-the-first-capital-letter-if-the-leading-camel-c