private OperationAdaptor convertResourceToOperation(BLangFunction resource, String httpMethod, int idIncrement) {
OperationAdaptor op = new OperationAdaptor();
if (resource != null) {
op.setHttpOperation(httpMethod);
op.setPath('/' + resource.getName().getValue());
Response response = new Response()
.description("Successful")
.example(MediaType.APPLICATION_JSON, "Ok");
op.getOperation().response(200, response);
String resName = resource.getName().getValue().replaceAll("_", " ");
op.getOperation().setOperationId(getOperationId(idIncrement, resName));
op.getOperation().setParameters(null);
this.parseResourceConfigAnnotationAttachment(resource, op);
this.parseResourceInfo(resource, op.getOperation(), httpMethod);
this.addResourceParameters(resource, op);
this.parseResponsesAnnotationAttachment(resource, op.getOperation());
}
return op;
}