** Changed in: zorba
       Status: New => Fix Committed

-- 
You received this bug notification because you are a member of Zorba
Coders, which is the registrant for Zorba.
https://bugs.launchpad.net/bugs/900462

Title:
  json:serialize returns invalid json

Status in Zorba - The XQuery Processor:
  Fix Committed

Bug description:
  The json:serialize function returns syntactically incorrect json.

  For example, the existing test query serialize_json_18.xq fails
  because it's missing an ending curly '}' as follows:

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

  declare variable $tmp := <json type="object"><pair name="phoneNumbers" 
type="array"><item type="string">212 732-1234</item><item type="string">646 
123-4567</item></pair><pair name="firstName" type="string">John</pair><pair 
name="lastName" type="string">Smith</pair><pair name="address" 
type="object"><pair name="postalCode" type="number">10021</pair><pair 
name="city" type="string">New York</pair><pair name="streetAddress" 
type="string">21 2nd Street</pair><pair name="state" 
type="string">NY</pair></pair></json>;
   
  json:serialize($tmp)

  Actual:   <<root>{"phoneNumbers": ["212 732-1234", "646 123-4567"],
  "firstName": "John", "lastName": "Smith", "address": {"postalCode":
  10021, "city": "New York", "streetAddress": "21 2nd Street", "state":
  "NY"}</root>>

  Expected: <<root>{"phoneNumbers": ["212 732-1234", "646 123-4567"],
  "firstName": "John", "lastName": "Smith", "address": {"postalCode":
  10021, "city": "New York", "streetAddress": "21 2nd Street", "state":
  "NY"}}>

To manage notifications about this bug go to:
https://bugs.launchpad.net/zorba/+bug/900462/+subscriptions

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to     : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp

Reply via email to