This JSON cannot be parsed in B4i v5.50.
The first step is concluded successfully but if you try to get the list you 're toasted for good (check the attached project). Any ideas anyone?
Looks like correct JSON and works without problems
B4X:
Dim sJSON As String = $"{"root":[{"VersionID":18,"SelectedVersion":1},{"VersionID":20,"SelectedVersion":2}]}"$
Dim parser As JSONParser
parser.Initialize (sJSON)
Dim map As Map = parser.NextObject
Dim list As List = map.Get("root")
For Each colroot As Map In list
Log ("SelectedVersion = " & colroot.Get ("SelectedVersion"))
Log ("VersionID = " & colroot.Get ("VersionID"))
Next
I do not understand. The code by Semen works with me too. My code in the attached project does not work in b4i but works perfect in b4a as it is copied from the same project in b4a which works.