当前位置:网站首页>Swagger document export custom V2 / API docs interception
Swagger document export custom V2 / API docs interception
2022-04-23 08:35:00 【Silence, your name】
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, your name]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230810182042.html
边栏推荐
- colorui 解决底部导航遮挡内容问题
- 【深度好文】Flink SQL流批⼀体化技术详解(一)
- 《深度学习》学习笔记(八)
- form表单 post提交 数据量大的问题
- swagger文档导出自定义v2/api-docs拦截
- QT reading and writing XML files
- 信息收集相关知识点及题解
- SYS_ CONNECT_ BY_ Path (column, 'char') combined with start with connect by prior
- Add random attributes to the Li class array objects and sort them
- Reference passing 1
猜你喜欢

IDEA导入commons-logging-1.2.jar包

洋桃电子STM32物联网入门30步笔记二、CubeIDE下载、安装、汉化、设置

Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam

Input / output system

Excle plus watermark

Noyer électronique stm32 Introduction à l'Internet des objets 30 étapes notes I. différences entre la Bibliothèque Hal et la Bibliothèque standard

洋桃电子STM32物联网入门30步笔记一、HAL库和标准库的区别

Reference passing 1

Get the absolute path of the class according to the bytecode

洋桃电子STM32物联网入门30步笔记三、CubeMX图形化编程、设置开发板上的IO口
随机推荐
LeetCode-199-二叉树的右视图
rembg 分割mask
Using qlst excel file
【精品】利用动态代理实现事务统一管理 二
form中enctype属性
tsdf +mvs
Navicat远程连接mysql
怎样读取Excel表格到数据库
lgb,xgb,cat k折交叉验证
STM32 uses Hal library. The overall structure and function principle are introduced
How to encrypt devices under the interconnection of all things
Redis Desktop Manager for Mac(Redis可视化工具)
耳穴诊疗随笔0421
《深度学习》学习笔记(八)
Shell script advanced
RPC procedure
Input / output system
【深度好文】Flink SQL流批⼀体化技术详解(一)
对OutputStream类的flush()方法的误解
idea底栏打开services