当前位置:网站首页>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
边栏推荐
- Overview of bus structure
- 什么是RPC
- Trust uses Tokio's notify and timeout to achieve the effect similar to the timeout condition variable
- DOM learning notes - traverse all element nodes of the page
- 四张图弄懂matplotlib的一些基本用法
- 耳穴诊疗随笔0421
- Queue (C language / linked list)
- 引用传递1
- 洋桃电子STM32物联网入门30步笔记二、CubeIDE下载、安装、汉化、设置
- Record: JS several methods to delete one or more items in the array
猜你喜欢

洋桃电子STM32物联网入门30步笔记四、工程编译和下载

Failed to convert a NumPy array to a Tensor(Unsupported Object type int)

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

IDEA导入commons-logging-1.2.jar包

让地球少些“碳”息 度能在路上

Shell脚本进阶

Overview of bus structure

pgsql想实现mysql一样样的列子查询操作

idea底栏打开services

洋桃電子STM32物聯網入門30步筆記一、HAL庫和標准庫的區別
随机推荐
获取TrustedInstaller权限
Overview of bus structure
数据可视化:使用Excel制作雷达图
Transformer XL: attention language modelsbbeyond a fixed length context paper summary
STM32 uses Hal library. The overall structure and function principle are introduced
[learning] audio and video development from scratch (9) -- nuplayer
Generate and parse tokens using JWT
MATLAB 画五星红旗
Detailed description of self feeling of auricular point weight loss 0422
'恶霸' Oracle 又放大招,各大企业连夜删除 JDK。。。
Redis Desktop Manager for Mac(Redis可视化工具)
MySQL数据库中delete、truncate、drop原理详解
Queue (C language / linked list)
How to generate assembly file
跨域配置报错: When allowCredentials is true, allowedOrigins cannot contain the special value “*“
关于数组复制问题
Large amount of data submitted by form post
Goland 调试go使用-大白记录
面了一圈,整理了这套面试题。。
引用传递1