-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
JSON input out of order causing IncompleteInput for large json when using http.getStream() #2152
Comments
Hi @xsorifc28, I suspect the server returns a chuck-encoded response, even if you asked for Best regards, |
I don't think so, here is the response headers:
|
You got this header list with Curl. Headers might change from one response to the other; only the ones where |
I have already tried the I will get the headers from Arduino and post them in a follow up comment, curious to see if there is a difference. |
Any progress on this issue? |
I do not think this is a bug within ArduinoJson, seeking help from anyone with similar experience
Note - I am able to parse the json by reading the stream char-by-char into an array (and deleting some code/functionaliy to have enough memory)
Describe the bug
When passing http.getStream() to deserialize a large payload, I am getting
InvalidInput
error.The json that i am parsing is ~88k, which I understand exceeds the maximum string size for esp32 (65k) (using xiao esp32c3).
Therefore I tried to use http.getStream so that the json isn't duplicated in memory.
I tried
Serial.println(http.getStream().readString());
and this failes validation, the complete json is there but there are some characters our of order (cURL to the API & json validation passes).Given that getStream().readString() is returning a bad string, this doesn't seem to be an arduino json issue, but wanted to ask here to confirm and see if there was a work around.
Troubleshooter report
Here is the report generated by the ArduinoJson Troubleshooter:
deserializeJson()
returnsInvalidInput
jsonlint
says the document is valid (when using cURL, invalid data returned by http.getStream()Environment
Here is the environment that I used:
Reproduction
Here is a small snippet that reproduces the issue.
Compiler output
n/a
Program output
JSON parse failed: IncompleteInput
The text was updated successfully, but these errors were encountered: