-
Notifications
You must be signed in to change notification settings - Fork 49
Labels
Description
What happened:
I tried to create a workflow with an openapi JSON file from Petstore, and it blows:
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Invalid OpenAPI document
at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:396)
at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:2096)
at org.acme.http.PetstoreFlowIT.petstoreWorkflowShouldReturnPetDetails(PetstoreFlowIT.java:32)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at io.quarkus.test.junit.QuarkusTestExtension.runExtensionMethod(QuarkusTestExtension.java:998)
at io.quarkus.test.junit.QuarkusTestExtension.interceptTestMethod(QuarkusTestExtension.java:846)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: java.lang.IllegalArgumentException: Invalid OpenAPI document
at io.serverlessworkflow.impl.executors.openapi.OpenAPIProcessor.getOperation(OpenAPIProcessor.java:43)
at io.serverlessworkflow.impl.executors.openapi.OpenAPIProcessor.parse(OpenAPIProcessor.java:38)
at io.serverlessworkflow.impl.executors.openapi.OpenAPIExecutor.lambda$apply$1(OpenAPIExecutor.java:72)
at io.serverlessworkflow.impl.resources.DefaultResourceLoader.lambda$load$2(DefaultResourceLoader.java:96)
at java.base/java.util.concurrent.ConcurrentHashMap.compute(ConcurrentHashMap.java:1916)
at io.serverlessworkflow.impl.resources.DefaultResourceLoader.load(DefaultResourceLoader.java:92)
at io.serverlessworkflow.impl.executors.openapi.OpenAPIExecutor.apply(OpenAPIExecutor.java:69)
at io.serverlessworkflow.impl.executors.CallTaskExecutor.internalExecute(CallTaskExecutor.java:58)
at io.serverlessworkflow.impl.executors.RegularTaskExecutor.execute(RegularTaskExecutor.java:63)
at io.serverlessworkflow.impl.executors.AbstractTaskExecutor.lambda$apply$7(AbstractTaskExecutor.java:256)
at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)
at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2309)
at io.serverlessworkflow.impl.executors.AbstractTaskExecutor.apply(AbstractTaskExecutor.java:256)
at io.serverlessworkflow.impl.executors.TaskExecutorHelper.processTaskList(TaskExecutorHelper.java:42)
at io.serverlessworkflow.impl.WorkflowMutableInstance.startExecution(WorkflowMutableInstance.java:78)
at io.serverlessworkflow.impl.WorkflowMutableInstance.start(WorkflowMutableInstance.java:62)
at io.quarkiverse.flow.Flow.startInstance(Flow.java:30)
at org.acme.http.PetstoreFlow_ClientProxy.startInstance(Unknown Source)
at org.acme.http.PetstoreFlowIT.petstoreWorkflowShouldReturnPetDetails(PetstoreFlowIT.java:29)
... 5 more
What you expected to happen:
To work despite the file format
How to reproduce it:
Anything else we need to know?:
This message is not helpful:
if (openAPI == null || openAPI.getPaths() == null) {
throw new IllegalArgumentException("Invalid OpenAPI document");
}
Also, I can't see any warns in the logs announcing that it couldn't read the file.
Environment:
- Specification version used: 1.0.0 / 7.5.0.Final