<div dir="ltr">Hi Kieron,<br><div><br></div><div>Thank you for the explanation, now I understand the rationale behind the design choices!</div><div><br></div><div>Regards, </div><div><br></div><div>Ramiro</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, 28 Oct 2019 at 10:28, Kieron Taylor <<a href="mailto:ktaylor@ebi.ac.uk">ktaylor@ebi.ac.uk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Dear Ramiro,<br>
<br>
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.<br>
<br>
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.<br>
<br>
Regards,<br>
<br>
Kieron<br>
<br>
<br>
Kieron Taylor PhD.<br>
Ensembl Developer<br>
<br>
EMBL, European Bioinformatics Institute<br>
<br>
<br>
<br>
<br>
<br>
<br>
> On 21 Oct 2019, at 10:02, Ramiro Magno <<a href="mailto:ramiro.magno@gmail.com" target="_blank">ramiro.magno@gmail.com</a>> wrote:<br>
> <br>
> Hi Devs,<br>
> <br>
> Still regarding this endpoint: <a href="https://rest.ensembl.org/documentation/info/xref_name" rel="noreferrer" target="_blank">https://rest.ensembl.org/documentation/info/xref_name</a><br>
> <br>
> Should not the responses return errors on not available genes?<br>
> <br>
> Example: Let's query for the human gene "EMBL":<br>
> curl '<a href="https://rest.ensembl.org/xrefs/name/human/EMBL?content-type=application/json" rel="noreferrer" target="_blank">https://rest.ensembl.org/xrefs/name/human/EMBL?content-type=application/json</a>' -i -H 'Accept: application/json'<br>
> HTTP/1.1 200 OK<br>
> Vary: Content-Type<br>
> Content-Type: application/json<br>
> Content-Length: 2<br>
> X-Runtime: 0.015372<br>
> X-RateLimit-Limit: 55000<br>
> X-RateLimit-Reset: 123<br>
> X-RateLimit-Period: 3600<br>
> X-RateLimit-Remaining: 54999<br>
> Vary: Origin<br>
> Date: Mon, 21 Oct 2019 08:57:57 GMT<br>
> <br>
> []⏎<br>
> Cheers!<br>
> _______________________________________________<br>
> Dev mailing list    <a href="mailto:Dev@ensembl.org" target="_blank">Dev@ensembl.org</a><br>
> Posting guidelines and subscribe/unsubscribe info: <a href="https://lists.ensembl.org/mailman/listinfo/dev_ensembl.org" rel="noreferrer" target="_blank">https://lists.ensembl.org/mailman/listinfo/dev_ensembl.org</a><br>
> Ensembl Blog: <a href="http://www.ensembl.info/" rel="noreferrer" target="_blank">http://www.ensembl.info/</a><br>
<br>
<br>
_______________________________________________<br>
Dev mailing list    <a href="mailto:Dev@ensembl.org" target="_blank">Dev@ensembl.org</a><br>
Posting guidelines and subscribe/unsubscribe info: <a href="https://lists.ensembl.org/mailman/listinfo/dev_ensembl.org" rel="noreferrer" target="_blank">https://lists.ensembl.org/mailman/listinfo/dev_ensembl.org</a><br>
Ensembl Blog: <a href="http://www.ensembl.info/" rel="noreferrer" target="_blank">http://www.ensembl.info/</a><br>
</blockquote></div>