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

Reply via email to