Skip to content
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

validate API endpoint doesn't enforce DataCite requirements #6586

Closed
donsizemore opened this issue Jan 28, 2020 · 7 comments
Closed

validate API endpoint doesn't enforce DataCite requirements #6586

donsizemore opened this issue Jan 28, 2020 · 7 comments

Comments

@donsizemore
Copy link
Contributor

Possibly related to #6380 though the Dataverse instance in question is still on 4.16. It is possible to create a dataset with metadata which passes validation via endpoint:

$ curl -H "X-Dataverse-key:" "http://localhost:8080/api/admin/validate/dataset/556?variables=true"
{"status":"OK","data":{"message":"valid"}}

but lacks certain fields required by DataCite:

Response code: 422, [facet 'minLength'] The value has a length of '0'; this underruns the allowed minimum length of '1'. at line 31, column 0]]

In our case this turned out to be a producer URL not being accompanied by a producer name, but with only the above to go on from DataCite, this took a while to find.

If catching such a condition is outside the scope of the validate endpoint and/or I'm comparing tangerines to clementines, feel free to close this issue.

@jggautier
Copy link
Contributor

Hi Don. Your mention of producer URL makes me think you're referring to the Producer Name and URL fields in the Citation metadata block:

Screen Shot 2020-01-29 at 2 25 20 PM

Is that right?

@pdurbin
Copy link
Member

pdurbin commented Jan 29, 2020

@jggautier sounds right but let's let @donsizemore confirm. 😄

@donsizemore I assume that minLength error is on publish?

@donsizemore
Copy link
Contributor Author

@jggautier @pdurbin correct on both points.

@jggautier
Copy link
Contributor

Thanks. This sounds like the problem described in this GitHub issue. It still happens in Dataverse 4.19, but I'm guessing it hasn't come up often because people haven't been trying to publish datasets where the Producer URL field has a value but the Producer Name field does not.

@qqmyers
Copy link
Member

qqmyers commented Apr 1, 2020

FWIW - I think I played around at one point with the idea of being able to make a metadatablock child entry 'required' with the parent 'optional', so one could potentially require a producer name and url if one is entered (if I understand the structure of producer). If that's useful, let me know. (I think I had code - it may even be in qdr's fork.)

@landreev
Copy link
Contributor

landreev commented Apr 1, 2020

I agree it would be useful to be able to validate for things like this - but should it be a different API? This "admin/validate/dataset" API was only meant for database constraints; all it does it tries to instantiate entities and checks for ConstraintViolationExceptions.

@djbrooke
Copy link
Contributor

Closing in favor of #7551

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants