-
Notifications
You must be signed in to change notification settings - Fork 535
Description
Similar to recent changes in Edit Dataset Metadata, we need to update Edit File Metadata so that it clears fields correctly. As part of this change, the API endpoint should also include a version param, to make sure that the user is editing the correct version of the file metadata.
What steps does it take to reproduce the issue?
Try to clear out a file metadata field by passing an empty string, for example, to clear the description field. The result is that the description field is unchanged.
curl -H "X-Dataverse-key:$API_TOKEN" -X POST \
-F 'jsonData={"description":"","label":"myname.tab", "directoryLabel": "",
"provFreeform":"Test prov freeform","categories":["Data"],"dataFileTags":["Survey"],"restrict":false}' \
"$SERVER_URL/api/files/$ID/metadata"
File Metadata update has been completed: {"label":"myname.tab","directoryLabel":"updated/path","description":"My description aaa.","restricted":false,"categories":["Data"],"dataFileTags":["Survey"],"id":2}
-
When does this issue occur?
API user -
Which page(s) does it occurs on?
-
What happens?
The metadata field is unchanged. -
To whom does it occur (all users, curators, superusers)?
all API users -
What did you expect to happen?
The metadata field should be cleared.
Which version of Dataverse are you using?
Any related open or closed issues to this bug report?
We had a similar issue with Edit Metadata.
#11243
Screenshots:
No matter the issue, screenshots are always welcome.
To add a screenshot, please use one of the following formats and/or methods described here:
Are you thinking about creating a pull request for this issue?
Help is always welcome, is this bug something you or your organization plan to fix?