DDI import, fix for collectionMode #8491
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
This is a followup PR for #8473 where collectionMode was made a multiples-allowed field. There was still a place in the code, in the DDI import, where the field was treated as a single-primitive.
Please note that the DDI import overall is still broken (#8210), and will still be broken after this PR! However, this PR will make it possible to fix it (as part of Victoiria's #8483).
The PR also includes an updated example json file (
dataset-create-new-all-default-fields.json
) reflecting the change in #8473.Which issue(s) this PR closes:
Closes #8489
Special notes for your reviewer:
Please note that the DDI import overall is still broken (#8210), and will still be broken after this PR! However, this PR will make it possible to fix it (as part of Victoiria's #8483).
Suggestions on how to test this:
See the above, about ddi import still being broken, for reasons outside of this issue/this PR.
You can kinda test it, by attempting to import the example ddi (see attached, as a .txt file):
curl -H "X-Dataverse-key:xyz" -X POST http://localhost:8080/api/dataverses/root/datasets/:importddi --upload-file ddi_dataset.txt
before this PR, it'll be failing with
Error parsing data as Json: incorrect multiple for field collectionMode
after this PR, it'll be failing with the expected
Validation Failed: Subject is required. (Invalid value:edu.harvard.iq.dataverse.DatasetField...
ddi_dataset.txt
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Is there a release notes update needed for this change?:
Additional documentation: