From 83f6b36d362220fc23418f71a97af8b2c1f1bc61 Mon Sep 17 00:00:00 2001 From: Helber Belmiro Date: Thu, 17 Aug 2023 11:57:58 -0300 Subject: [PATCH 1/2] KOGITO-9699 Upgraded quarkus-openapi-generator Signed-off-by: Helber Belmiro --- kogito-build/kogito-dependencies-bom/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kogito-build/kogito-dependencies-bom/pom.xml b/kogito-build/kogito-dependencies-bom/pom.xml index ab4b803d0fb..7aa1875b39f 100644 --- a/kogito-build/kogito-dependencies-bom/pom.xml +++ b/kogito-build/kogito-dependencies-bom/pom.xml @@ -29,7 +29,7 @@ 2.4.10 1.0.0-preview.20220705 1.1.0 - 1.3.8 + 1.3.9 0.0.6 1.1.5 0.0.8 From 3b2d2b9af828755014941560ba4d245fbf711c77 Mon Sep 17 00:00:00 2001 From: Helber Belmiro Date: Thu, 17 Aug 2023 16:05:36 -0300 Subject: [PATCH 2/2] KOGITO-9699 Changed WorkflowOpenApiHandlerGenerator to support Response instead of void Signed-off-by: Helber Belmiro --- .../workflow/openapi/WorkflowOpenApiHandlerGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java index 310ed2cfdf9..06d572ada9e 100644 --- a/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java +++ b/quarkus/extensions/kogito-quarkus-serverless-workflow-extension/kogito-quarkus-serverless-workflow-deployment/src/main/java/org/kie/kogito/quarkus/serverless/workflow/openapi/WorkflowOpenApiHandlerGenerator.java @@ -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; @@ -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));