diff --git a/ukwa_api/collections/router.py b/ukwa_api/collections/router.py index 1d5c34a..0ae6f6d 100644 --- a/ukwa_api/collections/router.py +++ b/ukwa_api/collections/router.py @@ -4,6 +4,7 @@ import os JSON_DIR = os.environ.get("JSON_DIR","test/data/collections/") +JSON_DIR = JSON_DIR.rstrip("/") + "/" # Setup a router: router = APIRouter( diff --git a/ukwa_api/mementos/router.py b/ukwa_api/mementos/router.py index d3b0e76..c811dbf 100644 --- a/ukwa_api/mementos/router.py +++ b/ukwa_api/mementos/router.py @@ -71,15 +71,21 @@ async def lookup_url( ), matchType: Optional[schemas.LookupMatchType] = Query( schemas.LookupMatchType.exact, - title='Type of match to look for.' - ), + # description unfortunately dupes the "Available values" list but I couldn't find a way to suppress the latter. + description="""Type of match to look for.

+ exact - return captures exactly matching input url
+ prefix - return captures beginning input path
+ host - return captures belonging to input host
+ domain - as host, but also return captures belonging to subdomains
+ """ + ), sort: Optional[schemas.LookupSort] = Query( schemas.LookupSort.default, - title='Order to return results.' - ), + description='Order to return results. Reverse order not recommended for large result sets.' + ), limit: Union[int, None] = Query( None, - title='Number of matching records to return.' + description='Number of matching records to return.' ), ): # Only put through allowed parameters: diff --git a/ukwa_api/mementos/schemas.py b/ukwa_api/mementos/schemas.py index 64fd339..0f631f3 100644 --- a/ukwa_api/mementos/schemas.py +++ b/ukwa_api/mementos/schemas.py @@ -12,11 +12,9 @@ class LookupMatchType(Enum): prefix = 'prefix' host = 'host' domain = 'domain' - range = 'range' class LookupSort(Enum): default = 'default' - closest = 'closest' reverse = 'reverse'