-
Notifications
You must be signed in to change notification settings - Fork 316
Response not a valid JSON Object #255
Comments
Hi @johnseabird , top-level arrays currently not supported with VaRest (it'll be done with #245), but you can handle them like this: https://www.notion.so/ufna/HowTo-Read-top-level-arrays-5c6da7c25b044fb3b7de0c9e65d512f5 |
thanks for the quick reply. I think I'm not quite getting the solution in my case. just compared line 13: invalid:
valid:
|
It definitely will help you to read variables. For now you can't do it cause you have top-level array without name. I'll check the encoding at Sunday. |
thank you very much for the effort! I think I'm kinda blocked in my head how this helps me to read the variables. sorry for that. edit: getting it now -> but I compared the solution and it worked with the response from postman but not for VARest. the encoding / decoding seems to be the problem. It seems that the encoding is destroying the rest of the json file. quoation marks are not where they should be / objects do not get closed correctly. have a good weekend and thanks! edit: just a quick headsup. I get the same formatting / encoding problem with the c++ version. Deserialize does not finish successful. If I have a look at the Result as a String, I have the same problems. I already post processed and fixed some of the issues within blueprints. So I kinda fixed to formatting issue for one request. Now I'm dealing with having multiple root elements. the fix for the line break / paragraph break is the following: this replaces line strange formatting issues (html element stuff <>) as well as the breaks. |
Please have a look at some solved problems above. After having a processed clean JSON Object, with accessible fields, I started to request multiple tweets from the Twitter API. The response contains multiple JSON Root Elements (one per Tweet) which make the JSON invalid. Is there any way to handle this? You can check the gisthttps://gist.github.com/johnseabird/76b8e54ed6403ac12265170d5c4bbebd edit: If you want to, I can open a new issue for that one. |
u-chars fixed in latest develop |
Could you tell me what was the fix so I can confirm I have it as I am also getting this issue from the 4.24 version but I have downloaded the develop branch and compared the differences and dont notice anything |
@jonny2027 , please check that you have bUseChunkedParser = false |
The response I get via VaRest from Twitter API is not a valid JSON object and can not be parsed.
Postman generates a valid JSON Object.
Compared both via https://jsonlint.com/
Here you have the invaild JSON file first and afterwards the same request made with postman.
### INVALID JSON FILE - ANSWER FROM TWITTER API with VARest
https://gist.github.com/johnseabird/460faff61a0b821c2ffc4a712d1c45aa
### VALID JSON FILE - ANSWER FROM TWITTER API with POSTMAN
https://gist.github.com/johnseabird/ac39633b3e3300f491463c36668dbac2
VARest Log From Unreal:
SCREENSHOTS
The text was updated successfully, but these errors were encountered: