golo-lang icon indicating copy to clipboard operation
golo-lang copied to clipboard

Arrays within Arrays not parsed properly when converting Json to Dynamic Object

Open gcameo opened this issue 6 years ago • 2 comments

Given this json

  {
    "id": "customerContacts",
    "value": [["east","west"],["north","south"]]
  }

The following code returns empty value for the value()

let dyno = JSON.toDynamicObjectFromJSONString( str )

dyno:value()

I looks like in parse method in the JSON module, an array within an array is not catered for.

The attached trimmed version fixes it but it doesn't cater for infinite nesting of arrays. Please review json.golo.zip

gcameo avatar Jun 21 '18 22:06 gcameo

Can you please open a pull-request rather than posting a zip archive?

jponge avatar Jun 22 '18 21:06 jponge

Sure. Can do that. no probs

gcameo avatar Jun 22 '18 23:06 gcameo