Commit 9aed0f6
authored
fix(dataset): prevent duplicate metadata keys when renaming (#2547)
## Description
This PR fixes an issue where renaming scientific metadata keys in the V4
dataset would create duplicate metadata key records instead of updating
the existing one.
The problem occurred because the default content-type was set to
"application/merge-patch+json", which merges new keys with existing ones
rather than replacing them. By changing the default content-type to
"application/json", users must now provide all the metadata keys for the
specific dataset when updating, as the new metadata will replace the old
ones completely.
Users can still use "application/merge-patch+json" by explicitly setting
the content-type header if they need merge behavior.
## Motivation
<!-- Background on use case, changes needed -->
## Fixes
<!-- Please provide a list of the issues fixed by this PR -->
* Bug fixed (#X)
## Changes:
<!-- Please provide a list of the changes implemented by this PR -->
* changes made
## Tests included
- [ ] Included for each change/fix?
- [ ] Passing? <!-- Merge will not be approved unless tests pass -->
## Documentation
- [ ] swagger documentation updated (required for API changes)
- [ ] official documentation updated
### official documentation info
<!-- If you have updated the official documentation, please provide PR #
and URL of the updated pages -->1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
769 | 769 | | |
770 | 770 | | |
771 | 771 | | |
772 | | - | |
| 772 | + | |
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
| |||
0 commit comments