当前位置:网站首页>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
边栏推荐
- MySQL数据库中delete、truncate、drop原理详解
- Overview of bus structure
- 数据可视化:使用Excel制作雷达图
- 怎样读取Excel表格到数据库
- STM32F103ZET6【标准库函数开发】----库函数介绍
- Misunderstanding of flush () method of OutputStream class
- QT compilation qtxlsx Library
- 洋桃电子STM32物联网入门30步笔记三、新建CubeIDE工程和设置讲解
- AQS & ReentrantLock 实现原理
- STM32 uses Hal library. The overall structure and function principle are introduced
猜你喜欢
洋桃电子STM32物联网入门30步笔记二、CubeIDE下载、安装、汉化、设置
四张图弄懂matplotlib的一些基本用法
Notes on 30 steps of introduction to the Internet of things of yangtao electronics STM32 III. cubemx graphical programming and setting the IO port on the development board
QT compilation qtxlsx Library
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
增强现实技术是什么?能用在哪些地方?
synchronized 实现原理
第一性原理 思维导图
STM32使用HAL库,整体结构和函数原理介绍
Detailed explanation of ansible automatic operation and maintenance (I) installation and deployment, parameter use, list management, configuration file parameters and user level ansible operating envi
随机推荐
[explanation] get ora-12838: cannot read / modify an object after modifying it in parallel
One click cleanup of pycharm and jupyter cache files under the project
idea配置连接远程数据库MySQL,或者是Navicat连接远程数据库失败问题(已解决)
耳穴减肥自身感受细节描述0422
DOM learning - add + - button
作文以记之 ~ 二叉树的后序遍历
QFileDialog select multiple files or folders
Anonymous type (c Guide Basics)
【深度好文】Flink SQL流批⼀体化技术详解(一)
程序,进程,线程;内存结构图;线程的创建和启动;Thread的常用方法
DOM learning notes - traverse all element nodes of the page
Using qlst excel file
flask项目跨域拦截处理以及dbm数据库学习【包头文创网站开发】
MySQL数据库中delete、truncate、drop原理详解
rust 使用tokio的Notify 和timeout实现类似可超时条件变量的效果
Kubernetes如何使用harbor拉去私有镜像
Stm32f103zet6 [development of standard library functions] - Introduction to library functions
okcc呼叫中心外呼系统智能系统需要用多大的盘存录音?
线程的调度(优先级)
Ansible Automation Operation and Maintenance details (ⅰ) Installation and Deployment, Parameter use, list Management, Profile Parameters and user level ansible operating environment Construction