Skip to content

Conversation

@poikilotherm
Copy link
Contributor

What this PR does / why we need it:

Add datasetType to JSON serialization of DatasetVersion, saving an API call roundtrip to retrieve the type within client libs such as easyDataverse and others.

Which issue(s) this PR closes:

Special notes for your reviewer:
This is very minimalistic. There might be some debate necessary how we shall deal with stuff, as in theory the type of a dataset is not version specific but static like the identifier... The current JSON API is potentially not very well designed to handle all of this.

Suggestions on how to test this:

  1. Deploy Dataverse with the change
  2. Retrieve a dataset version
  3. Watch for the dataset type, it should be "dataset" (as by default, no other types are present)

Does this PR introduce a user interface change? If mockups are available, please link/include them here:
Nope.

Is there a release notes update needed for this change?:
I don't think so.

Additional documentation:
None.

THe reason to add this here is that some client tools might request
specific versions of a dataset, but need the information about the type,
too. For example some client might want to display a specific version of
a software instead of a dataset differently.

It is debatable if this should be included here, as so far there is no
consensus yet wether or not the type of a dataset should be allowed to
change between versions of it. On the other hand, the global ID should
also never change, but it is included anyway for the sake of getting
back to the dataset via the API if necessary.

This should be revisited as a JSON API design issue at a later point,
especially as when creating a dataset version, the type is at the root
level and the version itself is at a sublevel, rendering the API
inconsistent from the start.
@poikilotherm poikilotherm added the Size: 0.5 A percentage of a sprint. 0.35 hours label Jun 23, 2025
Copy link
Member

@pdurbin pdurbin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't test this but it looks reasonable.

@github-project-automation github-project-automation bot moved this to Ready for QA ⏩ in IQSS Dataverse Project Jun 23, 2025
@cmbz cmbz added the FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) label Jun 24, 2025
…PI guide IQSS#11573

Added a note explaining the constancy of `datasetId`, `datasetPersistentId`, and `datasetType` fields for all dataset versions in the API documentation.

The first two have been around since v4.18, see also issue IQSS#6397
@poikilotherm poikilotherm added this to the 6.7 milestone Jun 25, 2025
@poikilotherm
Copy link
Contributor Author

poikilotherm commented Jun 25, 2025

I added a unit test, merged the latest from develop and did add some docs.

Here's how the docs look like rendered (red box marks the changes):
image

@coveralls
Copy link

Coverage Status

coverage: 23.242% (+0.07%) from 23.171%
when pulling cce40c4 on poikilotherm:11573-print-datasettype
into 54f19d9 on IQSS:develop.

@ofahimIQSS ofahimIQSS self-assigned this Jun 25, 2025
@ofahimIQSS ofahimIQSS moved this from Ready for QA ⏩ to QA ✅ in IQSS Dataverse Project Jun 25, 2025
@ofahimIQSS
Copy link
Contributor

Looks good - merging!

@ofahimIQSS ofahimIQSS merged commit 2267ef0 into IQSS:develop Jun 25, 2025
16 checks passed
@github-project-automation github-project-automation bot moved this from QA ✅ to Merged 🚀 in IQSS Dataverse Project Jun 25, 2025
@ofahimIQSS ofahimIQSS removed their assignment Jun 25, 2025
@scolapasta scolapasta moved this from Merged 🚀 to Done 🧹 in IQSS Dataverse Project Jun 26, 2025
@poikilotherm
Copy link
Contributor Author

Thanks for merging as always @ofahimIQSS !

@poikilotherm poikilotherm deleted the 11573-print-datasettype branch June 26, 2025 16:33
@cmbz cmbz added the FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) label Aug 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

FY25 Sprint 26 FY25 Sprint 26 (2025-06-18 - 2025-07-02) FY26 Sprint 4 FY26 Sprint 4 (2025-08-13 - 2025-08-27) Size: 0.5 A percentage of a sprint. 0.35 hours

Projects

Status: Important
Status: Done 🧹

Development

Successfully merging this pull request may close these issues.

Feature Request: add datasetType to JSONPrinter of DatasetVersion

5 participants