Skip to content

Commit 754af4a

Browse files
committed
Validate SuccessAction workflowId
1 parent 98b971e commit 754af4a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/main/java/com/apiflows/parser/OpenAPIWorkflowValidator.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,13 @@ List<String> validateSuccessAction(String workflowId, String stepId, SuccessActi
273273
}
274274
}
275275

276+
if(successAction.getWorkflowId() != null && successAction.getType() != null && successAction.getType().equals("goto")) {
277+
// when type `goto` workflowId must exist (if provided)
278+
if(!workflowExists(workflowId)) {
279+
errors.add("Step " + stepId + " SuccessAction workflowId is invalid (no such a workflow exists)");
280+
}
281+
}
282+
276283
return errors;
277284
}
278285

0 commit comments

Comments
 (0)