cffconvert icon indicating copy to clipboard operation
cffconvert copied to clipboard

License field in Zenodo export violates schema

Open sim642 opened this issue 3 years ago • 3 comments

When converting CITATION.cff containing

license: MIT

to .zenodo.json, the resulting file contains

"license": {
  "id": "MIT"
}

According to Zenodo documentation about the file:

According to both, it should be

"license": "MIT"

sim642 avatar Aug 11 '22 14:08 sim642

Hi @sim642

It looks like both are valid. If I test with zenodraft from npm (link),

# add access token for sandbox.zenodo.org to environment variables
source ~/tokens/sandbox.zenodo.org

# show version for future reference
zenodraft --version
0.12.0

# create new concept on Zenodo sandbox
zenodraft deposition create concept --sandbox
1092934

# prepare a dummy file to be uploaded
echo "some text" > file.txt

# upload the file
zenodraft file add --sandbox 1092934 file.txt

# I can see the deposition (requires login to Zenodo Sandbox as the deposition is unpublished)

# If I then make .zenodo-string.json and .zenodo-object.json with content:
cat .zenodo-string.json
{
  "creators": [
    {
      "name": "Lastname, Firstname"
    }
  ],
  "title": "My deposition",
  "license": "MIT"
}
cat .zenodo-object.json
{
  "creators": [
    {
      "name": "Lastname, Firstname"
    }
  ],
  "title": "My deposition",
  "license": {
    "id": "MIT"
  }
}

# I can update the metadata successfully with either of those metadata files:
zenodraft metadata update --sandbox 1092934 .zenodo-string.json
zenodraft metadata update --sandbox 1092934 .zenodo-object.json

jspaaks avatar Aug 11 '22 16:08 jspaaks

I suppose that's why it was implemented as an object here, but it might not be wise to depend on some undocumented behavior.

sim642 avatar Aug 11 '22 16:08 sim642

In principle I agree but there is some discussion how (if) the published schemas are used, e.g.

https://github.com/zenodo/zenodo/issues/2294#issue-1148049228

And additionally some people start their metadata from downloading the JSON for an existing record, which shows e.g.:

image

So, a bit of a conundrum I guess

jspaaks avatar Aug 11 '22 17:08 jspaaks