Skip to content

Commit

Permalink
ukwa#42 improve cdx param docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ldbiz committed Jan 20, 2023
1 parent 0812dca commit 81a8f14
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions ukwa_api/collections/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
16 changes: 11 additions & 5 deletions ukwa_api/mementos/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br><br>
exact - return captures exactly matching input url<br>
prefix - return captures beginning input path<br>
host - return captures belonging to input host<br>
domain - as host, but also return captures belonging to subdomains<br>
"""
),
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:
Expand Down
2 changes: 0 additions & 2 deletions ukwa_api/mementos/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ class LookupMatchType(Enum):
prefix = 'prefix'
host = 'host'
domain = 'domain'
range = 'range'

class LookupSort(Enum):
default = 'default'
closest = 'closest'
reverse = 'reverse'


Expand Down

0 comments on commit 81a8f14

Please sign in to comment.