Springboot 2.6.7,Springdoc 1.6.8我需要有V3/API-DOC和V1/API-DOCS
我正在尝试将Springboot应用程序从2.5.9升级到2.6.7,因此由于许多兼容性问题,我需要从Springfox 3.0.0迁移到Springdoc 1.6.8。
在Springfox中,我以这种方式配置了
springfox:
documentation:
swaggerUi:
baseUrl: /documentation
openApi:
v3:
path: /documentation/v3/api-docs
swagger:
v2:
path: /documentation/v2/api-docs
我使用V2 API-DOC作为其他内容,因此我想继续拥有V2文档。
您知道是否有可能与SpringDoc生产V2和V3文档?
谢谢
I'm trying to upgrade my springboot app from 2.5.9 to 2.6.7 so i needed to migrate from springfox 3.0.0 to springdoc 1.6.8 because of many compatibility issues.
In springfox i configured in this way
springfox:
documentation:
swaggerUi:
baseUrl: /documentation
openApi:
v3:
path: /documentation/v3/api-docs
swagger:
v2:
path: /documentation/v2/api-docs
I used v2 api-docs for other stuffs so i'd like to continue to have also a v2 documentation.
Do you know if is possible to produce v2 and v3 documentation with springdoc?
thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要使用SpringDoc的API组来实现所需的目标。
API组是一个指定API的BEAN,该API将/排除在组中。在您的情况下,V2 API形成一个组,而V3 API形成另一组。
V2 bean应定义如下
,V3豆如下所述,
请参阅答案在这里API组。
You need to use the API Groups from Springdoc to achieve what you're looking for.
An API Group is a bean that specifies which APIs to include/exclude from a group. In your case, v2 APIs form one group while v3 APIs form another group.
The v2 bean should be defined as follows
and the v3 bean as follows
Refer to the answer here for details on how wildcards behave for the API Groups.