当前位置:网站首页>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
边栏推荐
- IDEA导入commons-logging-1.2.jar包
- Excle plus watermark
- Green apple film and television system source code film and television aggregation film and television navigation film and television on demand website source code
- AQS & ReentrantLock 实现原理
- Knowledge points and problem solutions related to information collection
- JSP page coding
- pdf加水印
- Protobuf简介
- JVM工具之Arthas使用
- '恶霸' Oracle 又放大招,各大企业连夜删除 JDK。。。
猜你喜欢

QT reading and writing XML files

'恶霸' Oracle 又放大招,各大企业连夜删除 JDK。。。

ansible自動化運維詳解(一)ansible的安裝部署、參數使用、清單管理、配置文件參數及用戶級ansible操作環境構建

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

【深度好文】Flink SQL流批⼀体化技术详解(一)

WordPress love navigation theme 1.1.3 simple atmosphere website navigation source code website navigation source code

测试你的机器学习流水线

监控智能回放是什么,如何使用智能回放查询录像

Yangtao electronic STM32 Internet of things entry 30 step notes IV. engineering compilation and download

Shell脚本进阶
随机推荐
Online app resource download website source code
JVM工具之Arthas使用
Ansible Automation Operation and Maintenance details (ⅰ) Installation and Deployment, Parameter use, list Management, Profile Parameters and user level ansible operating environment Construction
[learning] audio and video development from scratch (9) -- nuplayer
Transformer XL: attention language modelsbbeyond a fixed length context paper summary
'bully' Oracle enlarged its move again, and major enterprises deleted JDK overnight...
正点原子携手OneOS直播 OneOS系统教程全面上线
Use of applicationreadyevent
让地球少些“碳”息 度能在路上
Noyer électronique stm32 Introduction à l'Internet des objets 30 étapes notes I. différences entre la Bibliothèque Hal et la Bibliothèque standard
匿名類型(C# 指南 基礎知識)
Description of the abnormity that the key frame is getting closer and closer in the operation of orb slam
Data deletion and modification (MySQL)
How browser works
什么是RPC
分布式消息中间件框架选型-数字化架构设计(7)
Ear acupoint diagnosis and treatment essay 0421
Redis master-slave server problem
Word plus watermark
《深度学习》学习笔记(八)