improve the linked dataverse listing API#9665
Conversation
pdurbin
left a comment
There was a problem hiding this comment.
I like the structure! However, what about backward compatibility? 🤔
| dataversesThatLinkToThisDatasetIdBuilder.add(entry); | ||
| } | ||
| JsonObjectBuilder response = Json.createObjectBuilder(); | ||
| response.add("dataverses that link to dataset id " + datasetId, dataversesThatLinkToThisDatasetIdBuilder); |
There was a problem hiding this comment.
Should we keep this line in for backward compatibility?
There was a problem hiding this comment.
@pdurbin Sorry, do you mean the key of the object ("dataverses that link to dataset id X") or the value (e.g. "crc990 (id 18802)")?
There was a problem hiding this comment.
Well, I think you need both for backward compatibility. We'd want dataversesThatLinkToThisDatasetIdBuilder to have whatever value it has always had.
There was a problem hiding this comment.
It was decided today that there is no need for backward compatibility since the api was never documented
There was a problem hiding this comment.
@pkiraly can you please add a release note snippet?
You can put it here:
/doc/release-notes/9650-5-improve-list-linked-dataverses-API.md
|
If you are still interested in this PR, can you please merge and resolve any merge conflicts with the latest from develop? If so, we can prioritize reviewing and QAing the changes. If we don’t hear from you by May 22, 2024, we’ll go ahead and close this PR (it can always be reopened after that date, if there is still interest). |
|
I will do it. |
|
This is a nice, small API improvement that I think is a good candidate for 6.4. |
3972a4d to
494c31b
Compare
pdurbin
left a comment
There was a problem hiding this comment.
Please update the API changelog.
| curl -H "X-Dataverse-key: $API_TOKEN" http://$SERVER/api/datasets/$linked-dataset-id/links | ||
|
|
||
| It returns a list in the following format: | ||
| It returns a list in the following format (new format as of v6.4): |
There was a problem hiding this comment.
"It was decided today that there is no need for backward compatibility since the api was never documented"
Yes, we rarely document the output JSON, but clients can still rely on it.
Since the change is backward-incompatible, please update the API changelog ( https://guides.dataverse.org/en/latest/api/changelog.html ).
pdurbin
left a comment
There was a problem hiding this comment.
I didn't run the code but tests are passing and it looks good to me. Approved.
196ac01 to
54fad55
Compare
changes made in #9665 belong in API changelog for 6.5, not 6.4


What this PR does / why we need it:
This PR makes the response of the linked dataverse listing API more structured. Instead of returning a formatted string, it returns a structured JSON, where the individual data pieces are separated.
Which issue(s) this PR closes:
Closes #9650
Special notes for your reviewer:
Right now the API can be executed only by administrator. I think it might be changed so that the owner of the dataset is also able to execute it.
Suggestions on how to test this:
curl -s -H "X-Dataverse-key:$API_TOKEN" $SERVER_URL/api/datasets/$DATASET_ID/linksit will returns something like this:
{ "status": "OK", "data": { "id": 5, "identifier": "FK2/OTCWMM", "linked-dataverses": [ { "id": 2, "alias": "dataverse1", "displayName": "Lab experiments 2023 June" } ] } }Does this PR introduce a user interface change? If mockups are available, please link/include them here:
No
Is there a release notes update needed for this change?:
It might be worth to mention about this API, which previously was not documented.
Additional documentation:
There were a previous PR about the documentation of the API.