Merge pull request #1113 from geopython/items-id-path

support paths in item IDs
This commit is contained in:
Tom Kralidis
2023-01-23 10:30:56 -05:00
committed by GitHub
4 changed files with 11 additions and 3 deletions
@@ -378,4 +378,8 @@ Data access examples
``.../items`` queries which return an alternative representation to GeoJSON (which prompt a download)
will have the response filename matching the collection name and appropriate file extension (e.g. ``my-dataset.csv``)
.. note::
provider `id_field` values support slashes (i.e. ``my/cool/identifier``). The client request would then
be responsible for encoding the identifier accordingly (i.e. ``http://localhost:5000/collections/foo/items/my%2Fcool%2Fidentifier``)
.. _`OGC API - Features`: https://www.ogc.org/standards/ogcapi-features
@@ -96,5 +96,9 @@ Metadata search examples
* fetch a specific record
* http://localhost:5000/collections/my-metadata/items/123
.. note::
provider `id_field` values support slashes (i.e. ``my/cool/identifier``). The client request would then
be responsible for encoding the identifier accordingly (i.e. ``http://localhost:5000/collections/my-metadata/items/my%2Fcool%2Fidentifier``)
.. _`OGC API - Records`: https://www.ogc.org/standards/ogcapi-records
.. _`OGC API - Records GeoJSON Features`: https://raw.githubusercontent.com/opengeospatial/ogcapi-records/master/core/openapi/schemas/recordGeoJSON.yaml
+1 -1
View File
@@ -180,7 +180,7 @@ def collection_queryables(collection_id=None):
@BLUEPRINT.route('/collections/<path:collection_id>/items',
methods=['GET', 'POST'])
@BLUEPRINT.route('/collections/<path:collection_id>/items/<item_id>',
@BLUEPRINT.route('/collections/<path:collection_id>/items/<path:item_id>',
methods=['GET', 'PUT', 'DELETE'])
def collection_items(collection_id, item_id=None):
"""
+2 -2
View File
@@ -244,9 +244,9 @@ async def get_collection_items_tiles(request: Request, collection_id=None,
@app.route('/collections/{collection_id:path}/items', methods=['GET', 'POST'])
@app.route('/collections/{collection_id:path}/items/', methods=['GET', 'POST'])
@app.route('/collections/{collection_id:path}/items/{item_id}',
@app.route('/collections/{collection_id:path}/items/{item_id:path}',
methods=['GET', 'PUT', 'DELETE'])
@app.route('/collections/{collection_id:path}/items/{item_id}/',
@app.route('/collections/{collection_id:path}/items/{item_id:path}/',
methods=['GET', 'PUT', 'DELETE'])
async def collection_items(request: Request, collection_id=None, item_id=None):
"""