Open vera opened 1 year ago
FWIW: That API (and the ORE export) suppresses using an array when there is only one value, but it does use an array when there is more than one value. The relevant line is https://github.com/IQSS/dataverse/blob/97310b3e33db4657e28cdffb89e55b6e9055a798/src/main/java/edu/harvard/iq/dataverse/util/bagit/OREMap.java#L440. To change it you'd need to keep track of whether the field allows multiple values or not (since single value fields still shouldn't use an array). Any PR for this should include a release note about the backward incompatibility being introduced.
I'm in favor of the predictability of the subject always being an array. We could always put this in new field (rather than changing the field that is sometimes a string an sometimes an array) for backward compatibility.
What steps does it take to reproduce the issue?
subject
in the citation blockGET /api/datasets/42/metadata
The multi-valued field values are not returned as arrays, e.g.
'subject': 'Medicine, Health and Life Sciences'
Side note, the non-experimental API https://guides.dataverse.org/en/latest/api/native-api.html#get-json-representation-of-a-dataset does not have this bug:
{'typeName': 'subject', 'multiple': True, 'typeClass': 'controlledVocabulary', 'value': ['Medicine, Health and Life Sciences']}
The multi-valued field values to be returned as arrays, e.g.
'subject': ['Medicine, Health and Life Sciences']
Which version of Dataverse are you using?
v5.13
Any related open or closed issues to this bug report?
/
Screenshots:
/