Open jratike80 opened 1 year ago
As pointed out by Even, the behavior will depend on the style
and explode
values.
If style
is form
and explode
is true
for a custom query parameter, then foo=bar&foo=baz
is mapped to an array [ 'bar', 'baz' ]
for foo
.
If explode
is false
, which is used for all query parameters in the standards, then AFAIK there are no provisions in OpenAPI or any other standard how to handle this. The server could throw an error or pick a value (which is what pygeoapi seems to do).
If clients are expected to submit foo=bar&foo=baz
, then you should set explode
to false
. Or use explode
as false
and submit foo=bar,baz
. This is what is done, e.g., with the bbox
parameter. Note that multiple values for a parameter imply that the type is array
.
I ask because I saw this MapServer discussion in GitHub https://github.com/MapServer/MapServer/pull/6893#discussion_r1224356484 about what to do if a request happens to contain for example &crs= or &bbox-crs= many times
@rouault commented
The question is relevant to core as well. By some tests made against PyGeoAPI demo site this server picks the first key-value pair and discards the next ones.
This returns a feature with gid=15 https://demo.pygeoapi.io/stable/collections/ogr_gpkg_poi/items?gid=15&gid=24 This returns a feature with gid=24 https://demo.pygeoapi.io/stable/collections/ogr_gpkg_poi/items?gid=24&gid=15 This does not find anything because feature with gid=16 does not exist https://demo.pygeoapi.io/stable/collections/ogr_gpkg_poi/items?gid=16&gid=15