datacite / bolognese

Ruby gem and command-line utility for conversion of DOI metadata
MIT License
40 stars 14 forks source link

A blank `nameIdentifier` property in DataCite XML causes errors when reading #177

Closed codycooperross closed 9 months ago

codycooperross commented 9 months ago

Describe the bug

A blank nameIdentifier property in DataCite XML causes errors when reading. This causes downstream issues in other systems; for example, datacite/datacite#1970

Expected Behaviour

Blank nameIdentifier properties do not return an error when reading from DataCite XML. The nameIdentifier is excluded in bolognese Metadata object and thus DataCite JSON, CrossCite, etc.

Current Behaviour

Bolognese throws an error when reading a blank nameIdentifier value from DataCite XML.

Steps to Reproduce

Try to contribute an XML document with a blank nameIdentifier property to the REST API. See datacite/datacite#1970

Context (Environment)

Screenshots

Further details

Proposal

Hypothesis

The ni["__content__"] value may be nil, resulting in a NoMethodError when strip is called: https://github.com/datacite/bolognese/blob/a474fd4e0c3e40efaed870946946fb4e91290bbe/lib/bolognese/author_utils.rb#L33

Possible Implementation

Front logo Front conversations

sentry-io[bot] commented 9 months ago

Sentry issue: LUPO-2YM