Hi Tom,
The error is caused by your intent to serialize the map as JSON. You should get a successful response if you replace 'json' with 'basex' or 'adaptive'.
If you want to output data as JSON, it is handy indeed if value lists are represented as arrays. However, most features of XQuery treat sequences as first-class citizens, and JSON serialization is just one use case.
Hope this helps, Christian
____________________________________
Dr. Christian Grün, BaseX GmbH, basexgmbh.dehttp://basexgmbh.de/ |-- Firmensitz: Obere Laube 73, 78462 Konstanz |-- Registergericht Freiburg, HRB: 708285, Geschäftsführer: | Dr. Christian Grün, Dr. Alexander Holupirek, Michael Seiferle `-- Phone: +49 7531 28 28 676, Mail: info@basexgmbh.demailto:info@basexgmbh.de https://aka.ms/AAb9ysg ________________________________ From: Tom De Herdt via BaseX-Talk basex-talk@mailman.uni-konstanz.de Sent: Saturday, November 15, 2025 5:50:27 PM To: BaseX basex-talk@mailman.uni-konstanz.de Subject: [basex-talk] Issue with request:parameter-map and repeated query parameters
Hello,
I’ve encountered an issue with the new request:parameter-map function in BaseX. It throws an error when called with a query string that contains repeated parameters, such as ?a=1&a=2:
[SERE0023] Value has more than one item.
Is this behavior expected? As far as I know, query parameters may be repeated. For example, this can occur when submitting a form with checkboxes using the GET method. Additionally, JavaScript provides the URLSearchParams.getAll(<name>) method, which returns an array of values for a given parameter <name>.
Wouldn't it be more logical for request:parameter-map to also return an array in such cases?
I’ve tested this issue with BaseX 12 on Windows, using the following RESTXQ function:
declare %rest:GET %rest:path("test") %output:method("json") function page:test() { request:parameter-map() };
Any insights are appreciated.
Regards, Tom De Herdt