Hi team,

Found one "issue" with key ordering in the resulting map. Need to clarify, is it normal behavior or a bug.

json:parse('{"b":1, "a":3}',  { 'format': 'xquery' }) returns
{"a":3.0e0,"b":1.0e0}

but
json:parse('{"b":1, "a":3}')
<json type="object"><b type="number">1</b><a type="number">3</a></json>

As you see, the standard function returns keys not in the order as it was set in the original JSON string. I didn't find any requirement in xQuery spec that the resulting map entries should be sorted by the key name.

Is it a bug or a feature?
If a feature I would be really happy to see one additional param to preserve key ordering.

Thanks!

--
s0rr0w