Status code, when a level is not available in the navigation endpoint
ingoboerner opened this issue · 2 comments
What would be the best http status code to return, when someone requests a level
that is not available, e.g. exceeds the maximum cite depth?
Example in the documentation:
https://distributed-text-services.github.io/specifications/Navigation-Endpoint.html#example-2-requesting-all-descendants-of-a-textual-resource-at-a-specified-level
What should be returned, when the request would have been:
/api/dts/navigation/?id=urn:cts:greekLit:tlg0012.tlg001.opp-grc5&level=5
404 – Not found? or 400 Bad Request? or some other custom status code?
It's a good question, we'll need to address this in the meeting.
Right now, I would lean towards 404. Or 412 but I am not sure I understand it quite well.
From the 1-alpha1 release docs:
A
Navigation
endpoint request may specify a level in aResource
'sCitationTree
that does not exist. One may, e.g., provide adown
value of3
when only1
lower level exists in theResource
'sCitationTree
. In this case themember
array will simply include anyCitableUnit
s that do satisfy the parameters.If there are no
CitableUnit
s at all that satisfy the parameters of aNavigation
endpoint request:
- the request must not raise an error
- the
Navigation
objectmember
property must be an empty array.For example, if the
ref
is at the bottom level of the queriedCitationTree
, and adown
of 2 is provided in the request, the response will provide an empty array as itsmember
value.
We published the resolution of this issue during the tech committee meeting on 2024-03-08
commit a0db8ca
release https://github.com/distributed-text-services/specifications/releases/tag/1-alpha1
This is an alpha release and we are looking for feedback!