sckott / serrano

Low level Ruby client for Crossref
https://rubydoc.info/gems/serrano
MIT License
31 stars 3 forks source link

Not found returned as valid data #169

Closed LocoDelAssembly closed 2 years ago

LocoDelAssembly commented 2 years ago

When using Serrano.content_negotiation(ids: ["doi:10.5281/zenodo.4406210"], format: "citeproc-json") it returns Resource not found as response which is not valid JSON.

This small pull request fixes the problem by returning nil if the response was not successful. I also added console task to facilitate testing the gem inside irb.

sckott commented 2 years ago

Thanks - LGTM