You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ask because I saw this MapServer discussion in GitHub MapServer/MapServer#6893 (comment) about what to do if a request happens to contain for example &crs= or &bbox-crs= many times
I've had a bit of trouble to figure out what we should do in that situation, but I believe the answer comes indirectly from the fact that the OpenApi query parameters defined in the OGC API spec use "style: form" and "explode: false". Looking at https://swagger.io/docs/specification/serialization/, it means that if "foo=bar&foo=baz" was synthetized, then foo should be interpreted as an array [bar, baz] which doesn't make sense for the requests we are interested in.
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.
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 MapServer/MapServer#6893 (comment) 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
The text was updated successfully, but these errors were encountered: