CrossRef / rest-api-doc

Documentation for Crossref's REST API. For questions or suggestions, see https://community.crossref.org/
Other
721 stars 270 forks source link

Nullpointer exception at /works?query.author #552

Open marquesarthur opened 3 years ago

marquesarthur commented 3 years ago

When going over the README.md and doing a couple of examples, I got a null pointer exception (see JSON attachment)

My input query was:

https://api.crossref.org/works?query.author:ali+ameli&mailto=<my university email>

Note that I omitted my institution email on this issue due to privacy reasons. replace it with an email of your choice null_pointer.zip

ppolischuk commented 3 years ago

Hi, it looks like your query was incorrectly formatted. query.author should be followed by a = rather than a :

https://api.crossref.org/works?query.author=ali+ameli&mailto=<your email address> returns a valid response.

marquesarthur commented 3 years ago

Thanks @ppolischuk

Shouldn't it return a 404 bad request instead of exposing the server stack?