crosscite / content-negotiation

DOI content negotiation
https://data.crosscite.org
MIT License
3 stars 4 forks source link

JSON::GeneratorError: only generation of JSON objects or arrays allowed #88

Closed sentry-io[bot] closed 5 years ago

sentry-io[bot] commented 5 years ago

Sentry Issue: CONTENT-NEGOTIATION-1

JSON::GeneratorError: only generation of JSON objects or arrays allowed
  app/models/metadata.rb:24:in `initialize'
    Rails.cache.write("crosscite/#{input}", self.crosscite, raw: true)
  app/controllers/index_controller.rb:27:in `new'
    @metadata = Metadata.new(input: @id, from: from, format: format, sandbox: !Rails.env.production?)
  app/controllers/index_controller.rb:27:in `show'
    @metadata = Metadata.new(input: @id, from: from, format: format, sandbox: !Rails.env.production?)
...
(57 additional frame(s) were not displayed)

JSON::GeneratorError: only generation of JSON objects or arrays allowed
mfenner commented 5 years ago

The underlying issue are requests for DOIs not from DataCite or Crossref, the supported DOI registration agencies.

CONTENT-NEGOTIATION-1-url.txt

mfenner commented 5 years ago

Fixed via a change that returns a 404 not found error if DOI registration agency is not DataCite or Crossref.