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
{{ message }}
Repository navigation
[ogcapi-features] routing error if identifier contains '/' #7422
In case the value of an identifier property of a feature includes a '/', the routing fails
Url-encoding the value doesn't seem to improve the case (Apache decodes the URL before launching CGI, unless apache is configured to keep slashes; AllowEncodedSlashes NoDecode)
Same probably applies to special characters such as "?/&"
As far as I know, "/" in url is a path separator and cannot appear in the "filename" part. As url-encoded "%2F" it could work in theory, but as you noticed, servers may not agree.
The OGC API Features working group has discussed about the topic in opengeospatial/ogcapi-features#156. I think that the consensus was that special characters are allowed as percent encoded, but not recommended.
The featureId in the response comes from the source data, I guess "id": "KE104/2-149". User or client should know to convert it into ...items/KE104%2F-149. But if Apache and others by default decodes the values then nothing helps.
I believe I would take a safe way, edit the data and create new URL-friendly featureids that would work with any OGCFeat server without tricks. Another option would be to query the id field with query or with cql2 but I must admit that I have never used MapServer OGC API Features myself. Is it so that we do not support any kind of queries/filters?
I presume this means MapServer should do the encoding/decoding, rather than have Ids in a dataset with encoded values?
Actually in my case Apache decodes before passing to cgi, let me give a try to the AllowEncodedSlashes directive in https.conf
Setting this parameter seems quite common when hosting rest api’s
Activity
jratike80 commentedon Feb 3, 2026
As far as I know, "/" in url is a path separator and cannot appear in the "filename" part. As url-encoded "%2F" it could work in theory, but as you noticed, servers may not agree.
The OGC API Features working group has discussed about the topic in opengeospatial/ogcapi-features#156. I think that the consensus was that special characters are allowed as percent encoded, but not recommended.
geographika commentedon Feb 3, 2026
@jratike80 - I presume this means MapServer should do the encoding/decoding, rather than have Ids in a dataset with encoded values?
jratike80 commentedon Feb 3, 2026
I don't know how it could ever work really. Consider the default JSON output
https://kenya.lsc-hubs.org/ows/vector/ogcapi/collections/Potato_suitability/items?f=json&limit=1&offset=0
The featureId in the response comes from the source data, I guess
"id": "KE104/2-149". User or client should know to convert it into...items/KE104%2F-149. But if Apache and others by default decodes the values then nothing helps.@pvgenuchten , does
KE104/2-149work with pygeoapi or geoserver? If the issue is critical for you, please create a ticket at https://github.com/opengeospatial/ogcapi-features/issues/ and ask the standardization folks how the support for slashes in featureId should be implemented. For collectionIds it feels easier to implement because the links https://kenya.lsc-hubs.org/ows/vector/ogcapi/collections?f=json could be made to show the correct percent encoding.I believe I would take a safe way, edit the data and create new URL-friendly featureids that would work with any OGCFeat server without tricks. Another option would be to query the id field with query or with cql2 but I must admit that I have never used MapServer OGC API Features myself. Is it so that we do not support any kind of queries/filters?
pvgenuchten commentedon Feb 3, 2026
Thanx for your thoughts, I agree it’s not optimal from general web perspective
Pygeoapi (and underlying flask) has support for parameters of type path (with slashes) https://testdriven.io/tips/24431240-a8bf-437d-82ba-72507d4fb5a0/
But fully understand if we neglect the case, maybe add a note in docs
pvgenuchten commentedon Feb 3, 2026
Actually in my case Apache decodes before passing to cgi, let me give a try to the AllowEncodedSlashes directive in https.conf
Setting this parameter seems quite common when hosting rest api’s