Skip to content

fix: deserialize JSON string body in HTTP provider before sending request#6548

Open
ausias-armesto wants to merge 5 commits into
keephq:mainfrom
ausias-armesto:fix/parse-http-json
Open

fix: deserialize JSON string body in HTTP provider before sending request#6548
ausias-armesto wants to merge 5 commits into
keephq:mainfrom
ausias-armesto:fix/parse-http-json

Conversation

@ausias-armesto
Copy link
Copy Markdown
Contributor

Close #6547

When a workflow renders body: "{{ alert }}", the template produces a JSON string instead of a dict. Passing that string to requests.post(json=body) double-encodes it, sending a JSON string to the target instead of a JSON object.

The fix mirrors the existing handling already in place for headers: if body arrives as a string and is valid JSON, it is deserialized back to a dict before being handed to requests. Non-JSON strings are left unchanged for backwards compatibility.

Adds unit tests for the HTTP provider.

@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. Bug Something isn't working Provider Providers related issues labels May 28, 2026
@dosubot dosubot Bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels May 28, 2026
@ausias-armesto
Copy link
Copy Markdown
Contributor Author

@shahargl Can you have a look at this pull request. It would be nice to have it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working Provider Providers related issues size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: HTTP provider sends double-encoded JSON when workflow body uses {{ alert }} template

1 participant