Hi, I am working on some REST API code and I'm struggling with POSTing of JSON.
What I want to achieve is to have the function receive an XDM map (from JSON using fn:parse-json). I also want to output from such a map (in effect roundtripping some JSON). The test POST body I'm using is: {"foo": "bar"} When reading the docs I'm led to believe that this should achieve it: declare %rest:POST("{$body}") %rest:path("/json") %rest:consumes("application/json;lax=yes;format=map") %rest:produces("application/json;format=map") function api:json($body) { $body }; No matter what I do I always get this as response: <json type="object"> <foo>bar</foo> </json> Somehow I cannot force the function to receive a map(*) as $body argument. When I wrap $body in a trace() I see that it gets XML and not a map(*). What am I missing? Or do I really have to go JSON > XML > map {....}? -- --Marc