Skip to content

Commit

Permalink
KOGITO-9699 Changed WorkflowOpenApiHandlerGenerator to support Respon…
Browse files Browse the repository at this point in the history
…se instead of void

Signed-off-by: Helber Belmiro <[email protected]>
  • Loading branch information
hbelmiro committed Aug 17, 2023
1 parent 83f6b36 commit 3b2d2b9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
import java.util.stream.Stream;

import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.core.Response;

import org.jboss.jandex.AnnotationInstance;
import org.jboss.jandex.ClassInfo;
import org.jboss.jandex.DotName;
import org.jboss.jandex.MethodInfo;
import org.jboss.jandex.Type;
import org.jboss.jandex.Type.Kind;
import org.kie.kogito.codegen.api.context.KogitoBuildContext;
import org.kie.kogito.quarkus.serverless.workflow.ClassAnnotatedWorkflowHandlerGenerator;
import org.kie.kogito.quarkus.serverless.workflow.WorkflowCodeGenUtils;
Expand Down Expand Up @@ -88,7 +88,7 @@ private WorkflowHandlerGeneratedFile generateHandler(KogitoBuildContext context,
BlockStmt body = executeMethod.createBody();
MethodCallExpr methodCallExpr = new MethodCallExpr(new NameExpr(OPEN_API_REF), m.name());
final NameExpr parameters = new NameExpr(WORK_ITEM_PARAMETERS);
if (m.returnType().kind() == Kind.VOID) {
if (m.returnType().name().equals(DotName.createSimple(Response.class))) {
body.addStatement(methodCallExpr).addStatement(new ReturnStmt(new NullLiteralExpr()));
} else {
body.addStatement(new ReturnStmt(methodCallExpr));
Expand Down

0 comments on commit 3b2d2b9

Please sign in to comment.