-
Notifications
You must be signed in to change notification settings - Fork 8.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid JSON string when using Array[String] in HTTP request node #12759
Comments
I found a similar unsolved discussion titled JSON not recognizing a string item from an iteration, which might be related to the issue you're experiencing [1]. To address the JSON parsing error when using a string array in the HTTP Request node in Dify version 0.15.1, ensure that the JSON string is correctly formatted before it is parsed. The Here's a snippet of the relevant code: case "json":
if len(data) != 1:
raise RequestBodyError("json body type should have exactly one item")
json_string = self.variable_pool.convert_template(data[0].value).text
try:
json_object = json.loads(json_string, strict=False)
except json.JSONDecodeError as e:
raise RequestBodyError(f"Failed to parse JSON: {json_string}") from e
self.json = json_object Ensure that the JSON string is valid and properly formatted before it is passed to the HTTP Request node. If the JSON string is generated dynamically, verify that all necessary escaping and formatting are correctly applied. If the error persists, inspect the JSON string being passed to identify any syntax issues [2]. To continue talking to Dosu, mention @dosu. Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other |
Your suggested case is not using any of string array instance. |
/api/core/workflow/nodes/http_request/executor.py To: This work for me |
Self Checks
Dify version
0.15.1
Cloud or Self Hosted
Self Hosted (Docker), Self Hosted (Source)
Steps to reproduce
✔️ Expected Behavior
No response
❌ Actual Behavior
No response
The text was updated successfully, but these errors were encountered: