datacite / bolognese

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

nameIdentifier ORCID identifiers ending with a `/` are not rendered in JSON when converting from XML #188

Closed codycooperross closed 6 months ago

codycooperross commented 6 months ago

Describe the bug

nameIdentifier ORCID identifiers ending with a / are not rendered in JSON when converting from XML.

Expected Behaviour

ORCID identifiers ending with a / appear in JSON when converting from XML.

Current Behaviour

nameIdentifier ORCID identifiers ending with a / do not appear in JSON at all.

Steps to Reproduce

Submit the following XML via API:

    <contributors>
        <contributor contributorType="ContactPerson">
            <contributorName nameType="Personal">ExampleFamilyName, ExampleGivenName</contributorName>
            <givenName>ExampleGivenName</givenName>
            <familyName>ExampleFamilyName</familyName>
            <nameIdentifier nameIdentifierScheme="ORCID" schemeURI="https://orcid.org">https://orcid.org/0000-0001-5727-2427/</nameIdentifier>
            <affiliation/>
        </contributor>

The attribute will appear as the following in the REST API and DataCite JSON:

  "contributors": [
    {
      "name": "ExampleFamilyName, ExampleGivenName",
      "nameType": "Personal",
      "givenName": "ExampleGivenName",
      "familyName": "ExampleFamilyName",
      "contributorType": "ContactPerson",
      "nameIdentifiers": [
        {
          "schemeUri": "https://orcid.org",
          "nameIdentifierScheme": "ORCID"
        }
      ]
    },

Context (Environment)

Screenshots

Further details

Proposal

Hypothesis

The validate_orcid method in bolognese does not allow a trailing slash in the regex.

Possible Implementation