Skip to content

Commit 09349c1

Browse files
author
Rares Polenciuc
committed
fix: add missing DurableExecutionArn to StopDurableExecution request body
- Extract ARN from URL path and include in body_data before parsing - StopDurableExecutionRequest to fix "Request body is required" error.
1 parent e7ddc9b commit 09349c1

File tree

1 file changed

+6
-4
lines changed
  • src/aws_durable_execution_sdk_python_testing/web

1 file changed

+6
-4
lines changed

src/aws_durable_execution_sdk_python_testing/web/handlers.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -387,14 +387,16 @@ def handle(self, parsed_route: Route, request: HTTPRequest) -> HTTPResponse:
387387
HTTPResponse: The HTTP response to send to the client
388388
"""
389389
try:
390-
body_data: dict[str, Any] = self._parse_json_body(request)
391-
stop_request: StopDurableExecutionRequest = (
392-
StopDurableExecutionRequest.from_dict(body_data)
393-
)
390+
body_data: dict[str, Any] = self._parse_json_body_optional(request)
394391

395392
stop_route = cast(StopDurableExecutionRoute, parsed_route)
396393
execution_arn: str = stop_route.arn
397394

395+
body_data["DurableExecutionArn"] = execution_arn
396+
stop_request: StopDurableExecutionRequest = (
397+
StopDurableExecutionRequest.from_dict(body_data)
398+
)
399+
398400
stop_response: StopDurableExecutionResponse = self.executor.stop_execution(
399401
execution_arn, stop_request.error
400402
)

0 commit comments

Comments
 (0)