private void readImplicitParameters(Method method, Operation operation) { processImplicitParams(ReflectionUtils.getAnnotation(method, ApiImplicitParams.class), operation); processImplicitParams(ReflectionUtils.getAnnotation(method.getDeclaringClass(), ApiImplicitParams.class), operation); }
private void readImplicitParameters(Method method, Operation operation) { processImplicitParams(ReflectionUtils.getAnnotation(method, ApiImplicitParams.class), operation); processImplicitParams(ReflectionUtils.getAnnotation(method.getDeclaringClass(), ApiImplicitParams.class), operation); }
private void readImplicitParameters(Method method, Operation operation) { processImplicitParams(ReflectionUtils.getAnnotation(method, ApiImplicitParams.class), operation); processImplicitParams(ReflectionUtils.getAnnotation(method.getDeclaringClass(), ApiImplicitParams.class), operation); }
public void setDeprecated(Operation operation, Method method) { operation.deprecated(ReflectionUtils.getAnnotation(method, Deprecated.class) != null); }
@Override public void setDeprecated(Operation operation, Method method) { operation.deprecated(ReflectionUtils.getAnnotation(method, Deprecated.class) != null); }
public void applySummary(Operation operation, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); if (apiOperation != null && StringUtils.isNotBlank(apiOperation.value())) { operation.summary(apiOperation.value()); } }
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(); } }
public void applyDescription(Operation operation, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); if (apiOperation != null && StringUtils.isNotBlank(apiOperation.notes())) { operation.description(apiOperation.notes()); } }
public String getHttpMethod(ReaderContext context, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); return apiOperation == null || StringUtils.isEmpty(apiOperation.httpMethod()) ? context.getParentHttpMethod() : apiOperation.httpMethod(); }
@Override public void applySummary(Operation operation, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); if (apiOperation != null && StringUtils.isNotBlank(apiOperation.value())) { operation.summary(apiOperation.value()); } }
@Override public String getHttpMethod(ReaderContext context, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); return apiOperation == null || StringUtils.isEmpty(apiOperation.httpMethod()) ? HttpMethod.POST.name() : apiOperation.httpMethod(); }
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(); } }
public void applyOperationId(Operation operation, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); if (apiOperation != null && StringUtils.isNotBlank(apiOperation.nickname())) { operation.operationId(apiOperation.nickname()); } else { operation.operationId(method.getName()); } }
public void applySecurityRequirements(ReaderContext context, Operation operation, Method method) { final List<SecurityRequirement> securityRequirements = new ArrayList<SecurityRequirement>(); final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); final Api apiAnnotation = context.getCls().getAnnotation(Api.class); if (apiOperation != null) { securityRequirements.addAll(parseAuthorizations(apiOperation.authorizations())); } if (securityRequirements.isEmpty() && apiAnnotation != null) { securityRequirements.addAll(parseAuthorizations(apiAnnotation.authorizations())); } for (SecurityRequirement securityRequirement : securityRequirements) { operation.security(securityRequirement); } }
public String getPath(ReaderContext context, Method method) { final Api apiAnnotation = context.getCls().getAnnotation(Api.class); final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); final String operationPath = apiOperation == null ? null : apiOperation.nickname(); return PathUtils.collectPath(context.getParentPath(), apiAnnotation == null ? null : apiAnnotation.value(), StringUtils.isBlank(operationPath) ? method.getName() : operationPath); }
@Override public String getPath(ReaderContext context, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); String operationId = null == apiOperation ? "" : StringUtils.isBlank(apiOperation.nickname()) ? null : apiOperation.nickname(); return PathUtils.collectPath(context.getParentPath(), context.getInterfaceCls().getName(), method.getName(), operationId); }
private void readExternalDocs(Method method, Operation operation) { io.swagger.annotations.ExternalDocs externalDocs = ReflectionUtils.getAnnotation(method, io.swagger.annotations.ExternalDocs.class); if(externalDocs != null) { operation.setExternalDocs(new ExternalDocs(externalDocs.value(), externalDocs.url())); } }
private void readExternalDocs(Method method, Operation operation) { io.swagger.annotations.ExternalDocs externalDocs = ReflectionUtils.getAnnotation(method, io.swagger.annotations.ExternalDocs.class); if(externalDocs != null) { operation.setExternalDocs(new ExternalDocs(externalDocs.value(), externalDocs.url())); } }
private void readExternalDocs(Method method, Operation operation) { io.swagger.annotations.ExternalDocs externalDocs = ReflectionUtils.getAnnotation(method, io.swagger.annotations.ExternalDocs.class); if (externalDocs != null) { operation.setExternalDocs(new ExternalDocs(externalDocs.value(), externalDocs.url())); } }
@Override public void applyDescription(Operation operation, Method method) { final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); if (apiOperation != null && StringUtils.isNotBlank(apiOperation.notes())) { operation.description(apiOperation.notes()); } operation.description(operation.getDescription() == null ? outputMethod(method) : (outputMethod(method) + operation.getDescription())); }