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

Validation of DBconfig doesn't seem to take place #315

Closed
MJochim opened this issue Mar 21, 2022 · 1 comment
Closed

Validation of DBconfig doesn't seem to take place #315

MJochim opened this issue Mar 21, 2022 · 1 comment

Comments

@MJochim
Copy link
Contributor

MJochim commented Mar 21, 2022

Follow-up to #296.

In commits 786ef8c~2 through 786ef8c (recently) and 74af424 (years ago), additions were made to the DBconfig.json regarding the EMU-webApp config and y-axis limits. However, they were never added to the JSON schema.

I expected the web app to throw a validation error when loading a database with such a config, but it doesn't. Maybe it only validates _annot.json files, but not _DBconfig.json? Is that intentional? Is that a problem?

It may have to do with the fact that this reference is wrong:

"EMUwebAppConfig": { "$ref": "https://raw.githubusercontent.com/IPS-LMU/EMU-webApp/master/app/schemaFiles/emuwebappConfigSchema.json"}

The URL yields a 404 error, because it contains /app/ instead of /src/.

@MJochim
Copy link
Contributor Author

MJochim commented Mar 22, 2022

@samgregory noted in #296 that the emuwebappConfigScheme allows for additionalProperties in the signalCanvases object:

"additionalProperties": true

Which is true, although I suppose we had better change that. We hardly ever set additionalProperties: true in any of our schemas and I don’t see a reason why we should have an exception here.

Anyway, one problem exists apart from that: I have found out now that the DBconfig is passed through the validator (tv4), but the EMUwebAppConfig part of it is ignored. Also, changing /app/ to /src/ in the $ref URL, as I mentioned in my previous comment, does not fix the issue. While the validator function tv4.validate() can handle the quoted $ref, it does not download the URL by itself. We have to do that actively, and I have yet to figure out how.

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

1 participant