xcube-dev / xcube

xcube is a Python package for generating and exploiting data cubes powered by xarray, dask, and zarr.
https://xcube.readthedocs.io/
MIT License
201 stars 20 forks source link

Web API: add "slash" parameter for routes #1018

Closed pont-us closed 4 months ago

pont-us commented 5 months ago

Add an optional slash parameter to the server.api.Api.route decorator, a corresponding constructor parameter and field to ApiRoute, and code to handle this field to TornadoFramework.add_routes. Passing slash=True causes the framework to handle the specified route both with and without an additional trailing / character.

Update STAC and Coverages implementations to use this feature, which gets rid of the duplicate entries in their generated OpenAPI documentation

Fixes #965.

Checklist:

pont-us commented 4 months ago

@forman For some reason Codecov is ignoring this branch, but I've run coverage.py locally to confirm that test coverage has not decreased.