-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: 优化 springdoc-openapi 对象型参数处理
1.使用 default-flat-param-object 全局设置对象型参数展示形式。此设置是在 springdoc-openapi v1.6.11 版本开始添加的新特性(详情请参阅:https://github.com/springdoc/springdoc-openapi/pull/1805),在此之前,只能在所有需要处理的对象型参数类上使用 @ParameterObject,工作量较大。 2.作者在使用上方这个配置时还遇到了一个 Bug,那就是只要在对象型参数前使用了注解,例如:@validated PageQuery pageQuery,这个配置就不会生效了。此问题已在 GitHub 提交了相应 issue(详情请参阅:https://github.com/springdoc/springdoc-openapi/issues/2181),并且 springdoc-openapi 社区某个小伙伴儿已在当前最新发布的 v2.1.0 和 v1.7.0 中修复。 注意:由于当前使用的 Knife4j 版本其内部引入的 springdoc-openapi 相关依赖非最新版本,所以为了解决配置不生效问题,暂时将部分对象型参数移除了 @validated 注解(除了 PageQuery,其他类当前也未实际添加校验,所以直接移除了)。当然如果不想移除的话,也可以从依赖上功夫,即移除 Knife4j 内引入的 springdoc-openapi 相关依赖,然后自行添加 springdoc-openapi 相关依赖并指定最新版本即可。
- Loading branch information
Showing
14 changed files
with
22 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters