gdcc/pyDataverse

error: {'status': 'ERROR', 'message': 'Error parsing Json: incorrect typeClass for field kindOfData, should be controlledVocabulary'}

Opened this issue · 2 comments

Hi, recently our institution updated Dataverse Version to '5.11.1'.
Previously, the metadata Kind of Data wasn't mandatory for our institution, but now it is, and it appears with and dropdow with some options.

I am trying to create a dataset with Pydataverse with this code:

from pyDataverse.models import Dataset
ds = Dataset()
ds_filename = "dataset.json"
ds.from_json(read_file(ds_filename))
ds.validate_json()
resp = api.create_dataset("pyDataverse_user-guide", ds.json())
resp.json()

But i got this error: {'status': 'ERROR', 'message': 'Error parsing Json: incorrect typeClass for field kindOfData, should be controlledVocabulary'}

I attached the json I am using

FWIW: kindOfData is not a controlled vocabulary value in the v5.11.1 release. It may be that your institution has changed the citation metadatablock to make kindOfData controlled. AFAIK, pyDataverse doesn't support such changes currently.

AFAIK, pyDataverse doesn't support such changes currently.
Not out of the box, but this can be easily adapted by adding/changing/removing the variables in the models module.