← Back to team overview

zorba-coders team mailing list archive

[Bug 920717] Re: json 2.0 bug: json:serialize(json:parse(VALID_JSON))

 

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

let $json := '{ "action": "GET /html/index", "public": true, "opt": [1, 2, {"foo": "bar"}]}'
let $json := json:parse($json)
return json:serialize($json)

Returns:
URI_PATH/com/zorba-xquery/www/modules/converters/json.xq>:196,3: JSON serialization error [zerr:ZJSE0006]: JSON type "number" can not have a child element node 
=================================================
json:serialize#1 <http://www.zorba-xquery.com/modules/converters/json> 

I think that this result is not correct.


** Changed in: zorba
       Status: Fix Committed => In Progress

** Changed in: zorba
     Assignee: Markos Zaharioudakis (markos-za) => Paul J. Lucas (paul-lucas)

** Changed in: zorba
    Milestone: None => 2.2

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

Title:
  json 2.0 bug: json:serialize(json:parse(VALID_JSON))

Status in Zorba - The XQuery Processor:
  In Progress

Bug description:
  Should be possible to call json:serialize(json:parse(VALID_JSON))
  where VALID_JSON is any valid JSON string
  see added failing test test/rbkt/zorba/json/json-snelson-serialize-parse:

  
  import module namespace json="http://www.zorba-xquery.com/modules/converters/json";;
  declare variable $json-value := '{"html":"<b>bold</b>"}';
  json:serialize(json:parse($json-value))

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


References