Closed rokdevil closed 4 years ago
Hi. Hum... This is strange. I'll check it soon.
Btw, are you running the latest version?
"Me too"! I have a multirow database table dumped on me as JSON, and your code sees the first column "Id" twice and stops. I like the rest of it, though. But most of all I'd like something to put the JSON table into a database table.
I see that the propertynames are stored in the array i_properties in JSONobject. This requires that each table row (with of course repeated property names) be a separate JSONobject with its own i_properties array, though the parsing is a JSONobject method, not a jsonArray method, so maybe it's a "scope" thing. (Hope this helps).
Hi. When you parse a JSON array, the resulting object contains a JSON array property that holds each array value. The properties array is specific for each object and should work as expected, unless you have invalid JSON with repeated property names in a single object. Can you share a simple copy or example of what you are trying to parse?
Also, can you please try older versions to see if this works? I'm suspecting this was introduced in one of the last 5 releases.
Unless I'm missing something... jsonString = "[{ ""strings"" : ""valorTexto"", ""numbers"": 123.456, ""arrays"": [1, ""2"", 3.4, [5, 6, [7, 8]]], ""objects"": { ""prop1"": ""outroTexto"", ""prop2"": [ { ""id"": 1, ""name"": ""item1"" }, { ""id"": 2, ""name"": ""item2"", ""teste"": { ""maisum"": [1, 2, 3] } } ] } }]"
will fail on: set js = new JSONObject js.parse(jsonString)
Output:
-- |