io.swagger.annotations.ApiOperation#response ( )源码实例Demo

下面列出了io.swagger.annotations.ApiOperation#response ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: sofa-rpc   文件: RpcReaderExtension.java
private static Type getResponseType(Method method) {
    final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class);
    if (apiOperation != null && !ReflectionUtils.isVoid(apiOperation.response())) {
        return apiOperation.response();
    } else {
        return method.getGenericReturnType();
    }
}
 
源代码2 项目: swagger-dubbo   文件: DubboReaderExtension.java
private static Type getResponseType(Method method) {
	final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class);
	if (apiOperation != null && !ReflectionUtils.isVoid(apiOperation.response())) {
		return apiOperation.response();
	} else {
		return method.getGenericReturnType();
	}
}
 
源代码3 项目: swagger-maven-plugin   文件: JaxrsReader.java
private void handleSubResource(String[] apiConsumes, String httpMethod, String[] apiProduces, Map<String, Tag> tags, Method method, ApiOperation apiOperation, String operationPath, Operation operation) {
    if (isSubResource(httpMethod, method)) {
        Class<?> responseClass = method.getReturnType();
        if (apiOperation != null && !apiOperation.response().equals(Void.class) && !apiOperation.response().equals(void.class)) {
            responseClass = apiOperation.response();
        }
        LOGGER.debug("handling sub-resource method " + method.toString() + " -> " + responseClass);
        read(responseClass, operationPath, httpMethod, true, apiConsumes, apiProduces, tags, operation.getParameters());
    }
}
 
 同类方法