![JAR search and dependency download from the Maven repository](/logo.png)
io.github.stylesmile.knife4j.OpenApi3Utils Maven / Gradle / Ivy
package io.github.stylesmile.knife4j;
import io.github.stylesmile.annotation.RequestMapping;
import io.github.stylesmile.handle.HandlerManager;
import io.github.stylesmile.handle.MappingHandler;
import io.github.stylesmile.knife4j.openapi.MethodInfo;
import io.github.stylesmile.knife4j.openapi.SwaggerInfo;
import io.github.stylesmile.knife4j.openapi.SwaggerParameter;
import io.github.stylesmile.knife4j.openapi.Tags;
import io.github.stylesmile.knife4j.openapi3.Info;
import io.github.stylesmile.knife4j.openapi3.OpenApi3Info;
import io.github.stylesmile.knife4j.openapi3.Openapi3MethodInfo;
import io.github.stylesmile.knife4j.openapi3.Server;
import io.github.stylesmile.parameter.ParameterWrap;
import io.github.stylesmile.tool.JsonGsonUtil;
import io.github.stylesmile.tool.StringUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Parameters;
import io.swagger.v3.oas.annotations.tags.Tag;
import java.io.IOException;
import java.lang.reflect.Method;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CopyOnWriteArrayList;
/**
* Open Api v2 工具类
*
* @author noear
* @since 2.4
*/
public class OpenApi3Utils {
/**
* 获取接口分组资源
*/
// public static String getApiGroupResourceJson() throws IOException {
// return getApiGroupResourceJson("/swagger/v2");
// }
/**
* 获取接口分组资源
*/
// public static String getApiGroupResourceJson(String resourceUri) throws IOException {
// Map mappingHandlerList = HandlerManager.getAllMappingHandler();
//
// List resourceList = new ArrayList<>();
// for (String key : mappingHandlerList.keySet()) {
// if (StringUtil.isNotEmpty(key)) {
//// String group = bw.name();
//// String groupName = ((DocDocket) bw.raw()).groupName();
//// String url = resourceUri + "?group=" + group;
// }
// }
// return JsonGsonUtil.objectToJson(resourceList);
// }
/**
* 获取接口
*/
public static String getApiJson(String group) throws IOException {
Map mappingHandlerList = HandlerManager.getAllMappingHandler();
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy