当前位置: 首页>>代码示例>>Java>>正文


Java ApiImplicitParams.value方法代码示例

本文整理汇总了Java中io.swagger.annotations.ApiImplicitParams.value方法的典型用法代码示例。如果您正苦于以下问题:Java ApiImplicitParams.value方法的具体用法?Java ApiImplicitParams.value怎么用?Java ApiImplicitParams.value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.swagger.annotations.ApiImplicitParams的用法示例。


在下文中一共展示了ApiImplicitParams.value方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: applyImplicitParameters

import io.swagger.annotations.ApiImplicitParams; //导入方法依赖的package包/类
/**
 * Implemented to allow loading of custom types using CloudClassLoader.
 */
@Override
public void applyImplicitParameters(ReaderContext context, Operation operation, Method method) {
    // copied from io.swagger.servlet.extensions.ServletReaderExtension
    final ApiImplicitParams implicitParams = method.getAnnotation(ApiImplicitParams.class);
    if (implicitParams != null && implicitParams.value().length > 0) {
        for (ApiImplicitParam param : implicitParams.value()) {
            final Parameter p = readImplicitParam(context.getSwagger(), param);
            if (p != null) {
                if (p instanceof BodyParameter && param.format() != null)
                    p.getVendorExtensions().put("format", param.format());
                operation.parameter(p);
            }
        }
    }
}
 
开发者ID:CenturyLinkCloud,项目名称:mdw,代码行数:19,代码来源:ResourceReaderExtension.java

示例2: readImplicitParameters

import io.swagger.annotations.ApiImplicitParams; //导入方法依赖的package包/类
protected void readImplicitParameters(Method method, Operation operation) {
    ApiImplicitParams implicitParams = AnnotationUtils.findAnnotation(method, ApiImplicitParams.class);
    if (implicitParams == null) {
        return;
    }
    for (ApiImplicitParam param : implicitParams.value()) {
        Class<?> cls;
        try {
            cls = Class.forName(param.dataType());
        } catch (ClassNotFoundException e) {
            cls = method.getDeclaringClass();
        }

        Parameter p = readImplicitParam(param, cls);
        if (p != null) {
            operation.addParameter(p);
        }
    }
}
 
开发者ID:kongchen,项目名称:swagger-maven-plugin,代码行数:20,代码来源:AbstractReader.java

示例3: process

import io.swagger.annotations.ApiImplicitParams; //导入方法依赖的package包/类
@Override
public void process(Object annotation, OperationGenerator operationGenerator) {
  ApiImplicitParams apiImplicitParamsAnnotation = (ApiImplicitParams) annotation;

  MethodAnnotationProcessor processor =
      operationGenerator.getContext().findMethodAnnotationProcessor(ApiImplicitParam.class);
  for (ApiImplicitParam paramAnnotation : apiImplicitParamsAnnotation.value()) {
    processor.process(paramAnnotation, operationGenerator);
  }
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:11,代码来源:ApiImplicitParamsMethodProcessor.java

示例4: process

import io.swagger.annotations.ApiImplicitParams; //导入方法依赖的package包/类
@Override
public void process(Object annotation, SwaggerGenerator swaggerGenerator) {
  ApiImplicitParams apiImplicitParamsAnnotation = (ApiImplicitParams) annotation;

  ClassAnnotationProcessor processor =
      swaggerGenerator.getContext().findClassAnnotationProcessor(ApiImplicitParam.class);
  for (ApiImplicitParam paramAnnotation : apiImplicitParamsAnnotation.value()) {
    processor.process(paramAnnotation, swaggerGenerator);
  }
}
 
开发者ID:apache,项目名称:incubator-servicecomb-java-chassis,代码行数:11,代码来源:ApiImplicitParamsClassProcessor.java

示例5: applyImplicitParameters

import io.swagger.annotations.ApiImplicitParams; //导入方法依赖的package包/类
@Override
public void applyImplicitParameters(ReaderContext context, Operation operation, Method method) {
	final ApiImplicitParams implicitParams = method.getAnnotation(ApiImplicitParams.class);
	if (implicitParams != null && implicitParams.value().length > 0) {
		for (ApiImplicitParam param : implicitParams.value()) {
			final Parameter p = readImplicitParam(context.getSwagger(), param);
			if (p != null) {
				operation.parameter(p);
			}
		}
	}
}
 
开发者ID:Sayi,项目名称:swagger-dubbo,代码行数:13,代码来源:DubboReaderExtension.java

示例6: readImplicitParameters

import io.swagger.annotations.ApiImplicitParams; //导入方法依赖的package包/类
private void readImplicitParameters(Method method, Operation operation) {
    ApiImplicitParams implicitParams = method.getAnnotation(ApiImplicitParams.class);
    if (implicitParams != null && implicitParams.value().length > 0) {
        for (ApiImplicitParam param : implicitParams.value()) {
            Parameter p = readImplicitParam(param);
            if (p != null) {
                operation.addParameter(p);
            }
        }
    }
}
 
开发者ID:wso2,项目名称:msf4j,代码行数:12,代码来源:ExtendedSwaggerReader.java

示例7: getPath

import io.swagger.annotations.ApiImplicitParams; //导入方法依赖的package包/类
@Override
public String getPath(ReaderContext context, Method method) {
    String p = null;
    Api apiAnnotation = context.getCls().getAnnotation(Api.class);
    ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class);
    String operationPath = apiOperation == null ? null : apiOperation.nickname();
    if (operationPath != null && !operationPath.isEmpty()) {
        // same logic as ServletReaderExtension
        p = PathUtils.collectPath(context.getParentPath(),
                apiAnnotation == null ? null : apiAnnotation.value(), operationPath);
    }
    else {
        // try JAX-RS annotations
        Path parentPath = ReflectionUtils.getAnnotation(method.getDeclaringClass(), Path.class);
        if (parentPath != null && parentPath.value() != null && !parentPath.value().isEmpty()) {
            p = parentPath.value();
        }
        Path path = ReflectionUtils.getAnnotation(method, Path.class);
        if (path != null && path.value() != null && !path.value().isEmpty()) {
            if (p == null)
                p = path.value();
            else {
                if (path.value().startsWith("/"))
                    p += path.value();
                else
                    p = p + "/" + path.value();
            }
        }
        // check dynamic java, which has package-based pathing
        java.lang.Package pkg = method.getDeclaringClass().getPackage();
        if (p != null && "MDW".equals(pkg.getImplementationTitle())) {
            if (p.startsWith("/"))
                p = "/" + pkg.getName().replace('.', '/') + p;
            else
                p = "/" + pkg.getName().replace('.', '/') + "/" + p;
        }

        if (apiOperation != null) {
            ApiImplicitParams implicitParams = ReflectionUtils.getAnnotation(method, ApiImplicitParams.class);
            if (implicitParams != null && implicitParams.value() != null && implicitParams.value().length == 1) {
                ApiImplicitParam implicitParam = implicitParams.value()[0];
                if (implicitParam.name() != null && !"body".equals(implicitParam.paramType()) && !"query".equals(implicitParam.paramType()))
                    p += "/{" + implicitParam.name() + "}";
            }
        }
    }

    return p;
}
 
开发者ID:CenturyLinkCloud,项目名称:mdw,代码行数:50,代码来源:ResourceReaderExtension.java


注:本文中的io.swagger.annotations.ApiImplicitParams.value方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。