-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Bug] Error during programmatic validation: graphRestriction
and allOf
#53
Comments
@M-casado, we had some problems regarding the use of |
@theisuru Should I then get rid of the |
I cloned the If with your comment you meant another solution, please let me know and I'll test it again. |
Hi @theisuru, new findings: while doing other changes to our schemas and trying to validate with Biovalidator I noticed that unresolved references prompt the same error. For example, when a
I believe it may be related to the issue described here. Even if it was not, I think this behaviour should change, and the error message should display that a reference (and which one) was not correctly resolved, both to the user and the developer. More related to this issue, I also found out that it is very likely the reference to a pattern ( So, below, I tested four cases within our schemas (not the UI, but the POST endpoint). It's not important what is within the JSON document to be validated (error happens at the schema level), so I will focus on the schema directly.
Based on these four cases, what I think that happens is:
|
Thanks @M-casado |
For it to be easily traced I would comment this issue in the PR to |
Summary
I found a bug that causes validation to fail when an
allOf
contains agraphRestriction
keyword and another item, sharing a property, and the validation is executed programmatically. The validation is not executed, as it fails, presumably, when collecting all referenced schemas.Technical details and context
main
branch.localhost:3020/
), the local server endpoint (localhost:3020/validate
) and EGA's server endpoint (biovalidator.ega.ebi.ac.uk/
).Expected behaviour
For JSON keywords to be combined without issues and validation to be executed accordingly.
Observed behaviour
{}
) instead of the list with the validation output; (3) the terminal and logs show little to no information as to what was the issue. This happened both when deploying the server locally or through EGA's API.allOf
oranyOf
were arranged withgraphRestriction
. See image below for an example.To reproduce
allOf
, containing an element that is notgraphRestriction
alone, and alsographRestriction
, exist within a single property. In the following example fileA
is the one we send to the validator; and fileA
references fileB
within it, which contains the JSON structure above described:localhost:3020/validate
). In our case we used curl in the CLI:Tested cases
The above cited chunks of JSON schemas are just one of the cases in which I found the issue. Below I will compile some of the scenarios in which validation passed or not using the programmatic calls to the localhost server. I will try to also summarize what changes between tries.
It's important to notice that whether the JSON document ("data") was valid or not against the schemas is not important here, since the bug appears before the validation starts. Therefore, whatever outcome of the validation, I took it as a successful run without this bug.
organism-part-entity
that was crashing the validation. It did not work.allOf
clause. It did work.allOf
and thegraphRestriction
keyword. It did not work.$ref
within file B. It did not work: it's not because the other item in theallOf
is a reference.graphRestriction
within theallOf
keyword. It did workallOf
toanyOf
and having multiple elements (one of which would not be met, so thegraphRestriction
would have to be) within it. It did work.The text was updated successfully, but these errors were encountered: