json 2.0 bug: array and object closed prematurely in json:parse

Bug #920719 reported by Sorin Marian Nasoi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Zorba
Fix Released
Medium
Paul J. Lucas

Bug Description

the items object and array are closed prematurely when json:parse is called.
Please see added tests:
- json-snelson-parse-array-06
- json-snelson-parse-array-07

For instance the result of test json-snelson-parse-array-06:

import module namespace json = "http://www.zorba-xquery.com/modules/converters/json";

json:parse('[
{
  "firstName": "John",
  "lastName": "Smith",
  "address": {
      "streetAddress": "21 2nd Street",
      "city": "New York",
      "state": "NY",
      "postalCode": 10021
  },
  "phoneNumbers": [
      "212 732-1234",
      "646 123-4567"
  ]
},
{
  "firstName": "John",
  "lastName": "Smith",
  "address": {
      "streetAddress": "21 2nd Street",
      "city": "New York",
      "state": "NY",
      "postalCode": 10021
  },
  "phoneNumbers": [
      "212 732-1234",
      "646 123-4567"
  ]
 }]')

is

<json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="array"><item type="object"></item> [...] </json>

instead of:

<json xmlns="http://john.snelson.org.uk/parsing-json-into-xquery" type="array"><item type="object"> [...] </item> [...] </json>

Changed in zorba:
status: New → Fix Committed
Changed in zorba:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.