use of org.kie.server.remote.rest.common.marker.KieServerEndpoint.EndpointType in project droolsjbpm-integration by kiegroup.
the class ReadOnlySwaggerDecoration method decorateOperation.
@Override
public void decorateOperation(Operation operation, Method method, Iterator<SwaggerExtension> chain) {
if (method.isAnnotationPresent(GET.class)) {
operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE);
if (chain.hasNext()) {
chain.next().decorateOperation(operation, method, chain);
}
return;
}
KieServerEndpoint api = method.getAnnotation(KieServerEndpoint.class);
if (api == null) {
api = method.getDeclaringClass().getAnnotation(KieServerEndpoint.class);
}
if (api != null) {
List<EndpointType> current = new ArrayList<>(asList(api.categories()));
current.retainAll(valid);
if (!current.isEmpty()) {
operation.setVendorExtension(SWAGGER_EXTENSION_READ_ONLY, Boolean.TRUE);
}
}
if (chain.hasNext()) {
chain.next().decorateOperation(operation, method, chain);
}
}
Aggregations