我有一个提供openapi的spring启动应用程序。我用过招摇。我有一个存储jsonschema的文件,我想将它解析为io.swagger.v3.oas.models.media.schema,将其添加到swagger中。我找不到任何现有的解决方案。有任何spring引导库支持这个功能吗?谢谢。
ercv8c1e1#
如果您使用的是SpringWebMVChateos端点,那么您可以直接使用https://springdoc.org/. 例如:@requestmapping、@getmapping等。springdoc openapi附带ui和openapi v3文档生成。如果不是,并且您更喜欢使用jaxrs2来配置restful端点,那么使用 <groupId>io.swagger.core.v3</groupId><artifactId>swagger-jaxrs2</artifactId> ,并使用 JerseyConfig extends ResourceConfig and include io.swagger.v3.integration.sources 用于jaxrs2扫描。
<groupId>io.swagger.core.v3</groupId><artifactId>swagger-jaxrs2</artifactId>
JerseyConfig extends ResourceConfig and include io.swagger.v3.integration.sources
1条答案
按热度按时间ercv8c1e1#
如果您使用的是SpringWebMVChateos端点,那么您可以直接使用https://springdoc.org/. 例如:@requestmapping、@getmapping等。
springdoc openapi附带ui和openapi v3文档生成。
如果不是,并且您更喜欢使用jaxrs2来配置restful端点,那么使用
<groupId>io.swagger.core.v3</groupId><artifactId>swagger-jaxrs2</artifactId>
,并使用JerseyConfig extends ResourceConfig and include io.swagger.v3.integration.sources
用于jaxrs2扫描。