Hi BaseX folks,
I'm encountering a problem in updating to BaseX 11.6 from 11.3
I have a RESTXQ function defined like this:
declare
%rest:POST("{$body}")
%rest:path("/my/function")
%rest:consumes('application/json')
%input:json('format=xquery')
function my:function (
$body
) as element(rest:forward) {
let $items as xs:string* := array:flatten($body?items)
(: omitted logic :)
return web:forward()
}
Everything works as expected using BaseX versions 11.3 up to 11.5, but with
11.6 an error occurs with the lookup operator and produces this error message:
err:XPTY0004 Input of lookup must be map or array
I did an experiment to try isolating the problem:
let $json := '{ "items": [ ["item 1", "item 2", "item 3"] ] }'
return array:flatten(json:parse($json, map{'format': 'xquery'})?items)
but this produced the expected list of items without error.
Has something changed in BaseX version 11.6 specifically in JSON parsing in
RESTXQ?
Thanks,
Vincent
______________________________________________
Vincent M. Lizzi
Head of Information Standards | Taylor & Francis Group
530 Walnut St., Suite 850, Philadelphia, PA 19106
E-Mail:
[email protected]<mailto:[email protected]>
Web: www.tandfonline.com<http://www.tandfonline.com>
Taylor & Francis is a trading name of Informa UK Limited,
registered in England under no. 1072954
"Everything should be made as simple as possible, but not simpler."
Information Classification: General