Hi,
I am trying to parse a JSON string containing arrays, objects, and arrays inside of objects, but once when I get array, the quotes to parameters are removed.
A sample code is:
After json.NextArray I get:
A json string without quotation marks, so when I process the json with this new string, I get error:
I am trying to parse a JSON string containing arrays, objects, and arrays inside of objects, but once when I get array, the quotes to parameters are removed.
A sample code is:
B4X:
galaxy.json.Initialize($"[{"id":"23","parameters":{"post_date":"2018-01-21 18:30:10","post_contents":"<img class="size-medium wp-image-24" src="https:\/\/www.islamicinfo.net\/wp\/wp-content\/uploads\/2018\/01\/IMG_20180122_022711-300x116.jpg" alt="" width="300" height="116" \/>","post_title":"Sana","post_excerpt":"","post_status":"publish","post_name":"sana","post_modified":"2018-01-21 18:30:10","post_modified_gmt":"2018-01-21 18:30:10","post_parent":"0","guid":"","post_type":"post","post_mime_type":"","number_attachments":1,"author":"Info786"}}]"$)
Dim list2 As List = galaxy.json.NextArray
Log("B" & CRLF)
galaxy.json.Initialize(list2.Get(0))
Log("Next Object: " & galaxy.json.NextObject & CRLF)
After json.NextArray I get:
B4X:
(ArrayList) [{id=23, parameters={post_date=2018-01-21 18:30:10, post_contents=<img class="size-medium wp-image-24" src="https://www.islamicinfo.net/wp/wp-content/uploads/2018/01/IMG_20180122_022711-300x116.jpg" alt="" width="300" height="116" />, post_title=Sana, post_excerpt=, post_status=publish, post_name=sana, post_modified=2018-01-21 18:30:10, post_modified_gmt=2018-01-21 18:30:10, post_parent=0, guid=, post_type=post, post_mime_type=, number_attachments=1, author=Info786}}]
A json string without quotation marks, so when I process the json with this new string, I get error:
B4X:
org.json.JSONException: Unterminated object at character 42 of {id=23, parameters={post_date=2018-01-21 18:30:10, post_contents=<img class="size-medium wp-image-24" src="https://www.islamicinfo.net/wp/wp-content/uploads/2018/01/IMG_20180122_022711-300x116.jpg" alt="" width="300" height="116" />, post_title=Sana, post_excerpt=, post_status=publish, post_name=sana, post_modified=2018-01-21 18:30:10, post_modified_gmt=2018-01-21 18:30:10, post_parent=0, guid=, post_type=post, post_mime_type=, number_attachments=1, author=Info786}}