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
Validation of 'structures' type crashes #397
Comments
Will look into this too! |
I've fixed the validator crash, but I'm not entirely sure what to do about the actual validation... the problem here is that your example structure contains a responds with a relationship to just one other structure as below: "relationships": {
"references": {
"data": {
"id": "1000000",
"type": "references"
} whereas we are expecting "relationships": {
"references": {
"data": [
{
"id": "1000000",
"type": "references"
}
] Following the spec and relevant part of JSON:API, it looks like we should allow both. Do you agree with this summary @merkys? |
Yes, I have the same opinion. |
* Give validator patched `included` a default value to make it really optional (closes #393) * Validate relationships data as a list before testing type (closes #397) * Improve --verbosity help string for validator (closes #396) * Add concept of InternalErrors to validator These errors should be handled differently to ValidationError and ResponseError as they indicate a problem with the validator itself. * Added validator flags --fail_fast and --skip_optional_tests * Improvements to pagination validation - Allow links objects to be passed in pagination - Enforced maximum recursion depth (5) for pagination tests * Reduce set of example queries from the specification, pending future improvements (#357) * Improve error message for single entry endpoint if deserialization fails * Implemented suggestions from code review Co-authored-by: Casper Welzel Andersen <CasperWA@users.noreply.github.com> * Renamed entrypoint optimade_validator->optimade-validator * Flip arg options the "standard" way around Use -t for --as-type (instead of -a). Co-authored-by: Casper Welzel Andersen <casper.andersen@epfl.ch> Co-authored-by: Andrius Merkys <andrius.merkys@gmail.com>
I confirm this is fixed as of v0.10.0. |
I am trying to validate COD implementation (in development) using
optimade-python-tools
v0.9.8. I experience a crash, although I assume the validator should be crash-free, even in dealing with weirdest responses:The text was updated successfully, but these errors were encountered: