Skip to content

Commit

Permalink
Fixing rest create workflow action
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Palis <[email protected]>
  • Loading branch information
joshpalis committed Apr 11, 2024
1 parent f5f2fd9 commit 855bd83
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,13 @@ protected RestChannelConsumer prepareRequest(RestRequest request, NodeClient cli
useCaseDefaultsMap = ParseUtils.parseJsonFileToStringToStringMap("/" + defaultsFilePath);
List<String> requiredParams = DefaultUseCases.getRequiredParamsByUseCaseName(useCase);

if (request.hasContent() == false && requiredParams.size() != 0) {
throw new FlowFrameworkException(
"Missing the following required parameters for use case [" + useCase + "] : " + requiredParams.toString(),
RestStatus.BAD_REQUEST
);
if (request.hasContent() == false) {
if (requiredParams.size() != 0) {
throw new FlowFrameworkException(
"Missing the following required parameters for use case [" + useCase + "] : " + requiredParams.toString(),

Check warning on line 135 in src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/flowframework/rest/RestCreateWorkflowAction.java#L134-L135

Added lines #L134 - L135 were not covered by tests
RestStatus.BAD_REQUEST
);
}
} else {
try {
XContentParser parser = request.contentParser();
Expand Down

0 comments on commit 855bd83

Please sign in to comment.