[ensembl-dev] Ensembl REST API | GET xrefs/name/:species/:name
Kieron Taylor
ktaylor at ebi.ac.uk
Mon Oct 28 10:27:27 GMT 2019
Dear Ramiro,
You make a fair point. No results could be construed as a 404 not found. However, you not requesting a particular resource, you are running a speculative query (at least in terms of how it works). At time of development we thought consistency in returning a list was more valuable than changing the response, i.e. The search was successful, but no results were found.
I believe we as developers tend to lean too heavily onto response codes as a method of expression, as their purpose is fulfilling HTTP protocol rather than a crutch for business logic. We are endeavouring to harmonise our REST-ish behaviour for consistency and principle of least surprise, but you should expect the xrefs endpoints to continue operating as-is for now. Stability of the API is also an important concern.
Regards,
Kieron
Kieron Taylor PhD.
Ensembl Developer
EMBL, European Bioinformatics Institute
> On 21 Oct 2019, at 10:02, Ramiro Magno <ramiro.magno at gmail.com> wrote:
>
> Hi Devs,
>
> Still regarding this endpoint: https://rest.ensembl.org/documentation/info/xref_name
>
> Should not the responses return errors on not available genes?
>
> Example: Let's query for the human gene "EMBL":
> curl 'https://rest.ensembl.org/xrefs/name/human/EMBL?content-type=application/json' -i -H 'Accept: application/json'
> HTTP/1.1 200 OK
> Vary: Content-Type
> Content-Type: application/json
> Content-Length: 2
> X-Runtime: 0.015372
> X-RateLimit-Limit: 55000
> X-RateLimit-Reset: 123
> X-RateLimit-Period: 3600
> X-RateLimit-Remaining: 54999
> Vary: Origin
> Date: Mon, 21 Oct 2019 08:57:57 GMT
>
> []⏎
> Cheers!
> _______________________________________________
> Dev mailing list Dev at ensembl.org
> Posting guidelines and subscribe/unsubscribe info: https://lists.ensembl.org/mailman/listinfo/dev_ensembl.org
> Ensembl Blog: http://www.ensembl.info/
More information about the Dev
mailing list