-
Notifications
You must be signed in to change notification settings - Fork 493
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
Extend 'metadatablocks/{block_id}' endpoint JSON output #9091
Conversation
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.
Thanks! This should be useful for api users. Seems straight forward. The one technical comment that I have is that sending all of the controlledvocab values with every call is not very scalable, versus having a separate api call for that, but I'm happy to push that to 'future work' - we don't have any internal vocabs that are so large this is going to be a big issue.
One more general comment - it would be good to check the docs to see if there is somewhere the format here is described, i.e. in the api section, and to update that appropriately. With that, this seems OK to move forward.
Thanks @qqmyers for the feedback! I see including the vocab values might not scale well for big sets. Would it be an option to get these only when specifically requested by a "complete" endpoint? Having all vocab values where the fields are would be very helpful and could reduce additional code to get them back together. Thought of something like:
where the corresponding endpoint would be implemented like so @Path("{identifier}/complete")
@GET
public Response getCompleteBlock( @PathParam("identifier") String idtf ) {
MetadataBlock b = findMetadataBlock(idtf);
return (b != null) ? ok(json(b, complete=true)) : notFound("Can't find metadata block '" + idtf + "'");
} This would require the additional argument Regarding the documentation, I will revise it and add changes to accommodate for the additions from this PR 🙂 |
@JR-1991 - adding /complete seems reasonable to me. It's possible that someone will have a preference for a QueryParam but I'd suggest just going ahead - easy enough to change later if that's requested. |
@JR-1991 forgive me being encroaching and converting this to a draft. Doing this to reflect the nature of this PR not being ready for valuation and being sent into the funnel. Trying to play with a better view of what is happening with community contributions and how to get them merged faster. See also https://github.com/orgs/IQSS/projects/36/views/1 |
@JR-1991 I haven't had a chance to add a review yet but once we figure out the code, we'll want to add docs, of course. And a release note snippet. We'll help when the time comes. Tests would be nice too but aren't absolutely required! 😄 |
The code change is small and looks good. Should look closer at feedback from @qqmyers. Needs docs and a release note. Gave it a 33 as a size. p.s. Tests are failing. Investigate. |
Please excuse my late reply, been on vacation until now. First of all, thanks a lot for your review. @pdurbin going to add release notes and docs asap. Shall I also commit the proposed changes from my previous comment? |
@JR-1991 can you please take a look at 9e9edd3 ? I think it's more what we want though I'm not sure about non-English values. There's a method called Also, it's somewhat inconvenient when PRs come in with the branch name "develop". If you don't mind, it would be nice to have a fresh PR with a new name (8944-metadatablocks-api or something). @qqmyers I'm not too worries about performance. It seems fast enough. @JR-1991 I'm happy to chat about all this! It could be a zoom call or https://chat.dataverse.org . Thanks for the pull request! It's great stuff! |
Daily discussion
|
Daily:
|
Closing in favor of #9213. |
What this PR does / why we need it:
This PR extends the API endpoint
/api/metadatablocks/{block_id}
to include the following fields:multiple
: Whether or not multiple instances of this field can existisControlledVocabulary
: Whether or not this field has a controlled vocabulary. Important to derive thetypeClass
later oncontrolledVocabularyValues
- If a vocabulary is given, includes all possible values.With this extension it is possible to build compatible Dataverse JSON files for upload and download from any installation without having access to the TSV files. EasyDataverse would greatly benefit from this and allow users to "connect" to a Dataverse installation without the need of generating specific code.
Which issue(s) this PR closes:
Closes #8944
Special notes for your reviewer:
None
Suggestions on how to test this:
Add or extend a fixture to test if the new fields are given upon execution.
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?:
The API endpoint
/api/metadatablocks/{block_id}
has been extended to include the following fields:multiple
: Whether or not multiple instances of this field can existisControlledVocabulary
: Whether or not this field has a controlled vocabulary. Important to derive thetypeClass
later oncontrolledVocabularyValues
- If a vocabulary is given, includes all possible values.Additional documentation:
None