当前位置:网站首页>swagger文档导出自定义v2/api-docs拦截
swagger文档导出自定义v2/api-docs拦截
2022-04-23 08:10:00 【Silence丶你的名字】
controller
Swagger2ControllerWebMvc
package com.alipay.mychain.taas.apidoc;
import io.swagger.models.Swagger;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import springfox.documentation.service.Documentation;
import springfox.documentation.spring.web.DocumentationCache;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.mappers.ServiceModelToSwagger2Mapper;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ApiDocApplication.class)
public class ApiDocApplicationTests {
@Autowired
private DocumentationCache documentationCache;
@Autowired
private ServiceModelToSwagger2Mapper mapper;
@Test
public void getDocumentation() {
String groupName = Docket.DEFAULT_GROUP_NAME;
Documentation documentation = documentationCache.documentationByGroup(groupName);
Swagger swagger = mapper.mapDocumentation(documentation);
System.out.println(swagger);
}
}
版权声明
本文为[Silence丶你的名字]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_42553504/article/details/124352378
边栏推荐
- Multi vision slam
- Navicat remote connection MySQL
- Comparison of indoor positioning technology
- JS中复制数组
- PDF with watermark
- QT reading and writing XML files
- 耳穴减肥自身感受细节描述0422
- ELK生产实践
- Shell script advanced
- Listed on the Shenzhen Stock Exchange: the market value is 5.2 billion yuan. Lu is the East and his daughter is American
猜你喜欢
Input / output system
Goland 调试go使用-大白记录
程序,进程,线程;内存结构图;线程的创建和启动;Thread的常用方法
Community group purchase applet source code + interface DIY + nearby leader + supplier + group collage + recipe + second kill + pre-sale + distribution + live broadcast
RPC过程
Failed to convert a NumPy array to a Tensor(Unsupported Object type int)
396. Rotate Function
[explanation] get ora-12838: cannot read / modify an object after modifying it in parallel
【深度好文】Flink SQL流批⼀体化技术详解(一)
输入/输出系统
随机推荐
监控智能回放是什么,如何使用智能回放查询录像
Community group purchase applet source code + interface DIY + nearby leader + supplier + group collage + recipe + second kill + pre-sale + distribution + live broadcast
什么是RPC
线程的调度(优先级)
A simple theme of Typecho with beautiful appearance_ Scarfskin source code download
Qtablewidget header customization and beautification developed by pyqt5 (with source code download)
How browser works
My heart's broken! A woman's circle of friends envied others for paying wages on time and was fired. Even her colleagues who liked her were fired together
colorui 解决底部导航遮挡内容问题
Knowledge points and problem solutions related to information collection
idea配置连接远程数据库MySQL,或者是Navicat连接远程数据库失败问题(已解决)
使用JWT生成与解析Token
Redis master-slave server problem
Add random attributes to the Li class array objects and sort them
【路科V0】验证环境2——验证环境组件
00后最关注的职业:公务员排第二,第一是?
输入/输出系统
stm32以及freertos 堆栈解析
一键清理项目下pycharm和Jupyter缓存文件
跨域配置报错: When allowCredentials is true, allowedOrigins cannot contain the special value “*“