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

allow retrieving validation errors #1206

Closed
satra opened this issue Feb 7, 2023 · 8 comments · Fixed by #1210
Closed

allow retrieving validation errors #1206

satra opened this issue Feb 7, 2023 · 8 comments · Fixed by #1210
Labels

Comments

@satra
Copy link
Member

satra commented Feb 7, 2023

thank you @jwodder for #1205 (comment).

opening a new issue here to allow retrieving validation errors in the call. since the endpoint returns it, i'm assuming it's discarded. let's add a parameter to not discard it.

@jwodder
Copy link
Member

jwodder commented Feb 7, 2023

It's not explicitly discarded; the returned Version pydantic structure simply doesn't have fields for it. The appropriate solution would be to add the fields to Version instead of adding a parameter; however, this would lead to inconsistencies, as other endpoints that return version information (i.e., /dandisets/:id/ and /dandisets/:id/versions/) do not include validation error fields.

@satra
Copy link
Member Author

satra commented Feb 8, 2023

It's not explicitly discarded

but the bytes are downloaded, right? as in the info endpoint is called as opposed to those other endpoints that return version information. if that is the case, then adding that makes sense or using a specific Info object which shares and extends the Version model.

if on the other hand, the info endpoint is not called, then adding a function to Dandiset class to call and return the contents of that endpoint would be good (more generally this can be something that returns the raw json as pydantic model for any API endpoint).

@jwodder
Copy link
Member

jwodder commented Feb 8, 2023

@satra

but the bytes are downloaded, right? as in the info endpoint is called

Yes.

@satra
Copy link
Member Author

satra commented Feb 8, 2023

in that case, please create an extended Info model that is exposed for the Dandiset.

@jwodder
Copy link
Member

jwodder commented Feb 8, 2023

@satra @AlmightyYakob Are the asset_validation_errors and version_validation_errors fields always of the type List[ValidationError] where ValidationError has field: str and message: str fields? The Swagger docs seem to be both wrong and incomplete on this point.

@jjnesbitt
Copy link
Member

@satra @AlmightyYakob Are the asset_validation_errors and version_validation_errors fields always of the type List[ValidationError] where ValidationError has field: str and message: str fields? The Swagger docs seem to be both wrong and incomplete on this point.

It's always that type, yes. The reason that's not detailed in swagger is that the field is technically just a JSON field, although we only write to it in that form. If having that documented in swagger is important, please file an issue in the API for it.

yarikoptic added a commit that referenced this issue Feb 8, 2023
Make `RemoteDandiset.get_version()` return a `VersionInfo` instance with validation error fields
@yarikoptic
Copy link
Member

... If having that documented in swagger is important, please file an issue in the API for it.

dandi/dandi-archive#1487

@github-actions
Copy link

🚀 Issue was released in 0.49.0 🚀

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