Refget Sequences returning subsequences and choice of 200 vs 206 status code
- Dominant language
- No language data
- Stars
- 17
- Forks
- 10
- Avg merge
- 11m
- Merged PRs (30d)
- 1
Description
The “[Method: get sequence by ID](https://ga4gh.github.io/refget/sequences/#method-get-sequence-by-id)” section says
> If a sub-sequence is requested via a Range header, the response must be one of 206 and only contain the specified sub-sequence, **be 200 and contain the entire sequence** (thus ignoring the Range header), or 303 redirecting the client to where it can retrieve the sequence.
>
> If a sub-sequence is requested, the response **must only contain the specified sub-sequence**.
The first sentence's 200 response option and the second sentence are not consistent with each other.
----
The **Response** subsection of the same section says
> On success and either a whole sequence or sub-sequence is returned the server MUST issue a 200 status code if the entire sequence is returned. A server SHOULD return a 206 status code if a Range header was specified and the request was successful.
The first sentence is mostly incomprehensible. I _think_ what it's trying to say is
> When a successful request results in the entire sequence being returned, the server MUST return it with a 200 status code regardless of whether the request was for the whole sequence or a sub-sequence that covers the entire sequence.
However that is not obviously the best approach and it is not very consistent with the second sentence.
Contributor guide
Assessment
This issue has not been assessed yet.