-
Notifications
You must be signed in to change notification settings - Fork 500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added new option in getDataverse endpoint for optionally retrieving child count #11259
Conversation
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
📦 Pushed preview images as
🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
@GPortas do we need to account for published/unpublished based on the user making the call? Also do we need to go more than one layer in (get the objects owned by the collections owned by the given collection)? |
For the purpose of this extension, we do not need to differentiate between published and unpublished states based on the user. FWIW, this endpoint uses the same database query as the JSF logic we are replicating in the SPA to determine whether a Dataverse has data (see Dataverse.java#L49). The key difference is that, for the API, instead of simply returning whether the Dataverse has data or is empty, I found it more useful for other use cases to return the child count, so the SPA only needs to check if the value is greater than 0. Additionally, we only need to return the direct child count, not multiple layers. Would it be helpful to clarify these points further in the field naming or documentation to avoid confusion? |
Thanks @GPortas. That's what I figured. I just wanted to make sure it was considered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. moving on.
no issues found with this PR - merging |
@GPortas @sekmiller @ofahimIQSS are these direct children only? Or does it count children, grandchildren, great-grandchildren, etc? I'm asking because we might we might want to clarify the guides and release note. |
@pdurbin it is only direct children |
What this PR does / why we need it:
Adds a new query param, returnChildCount, to getDataverse endpoint for optionally retrieving the child count, which represents the number of dataverses, datasets, or files within the dataverse.
Which issue(s) this PR closes:
Special notes for your reviewer:
Suggestions on how to test this:
If you want to obtain the child count of a Dataverse, you must set
returnChildCount
query parameter totrue
. Example:curl "https://demo.dataverse.org/api/dataverses/root?returnChildCount=true"
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?:
Yes, attached.
Additional documentation:
N/A