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

Audit the validation schemas #11

Open
mattcollier opened this issue Sep 14, 2018 · 2 comments
Open

Audit the validation schemas #11

mattcollier opened this issue Sep 14, 2018 · 2 comments

Comments

@mattcollier
Copy link
Contributor

Reminder to reevaluate the validation schemas after all the signature and PoW algorithms are finalized.

@mattcollier
Copy link
Contributor Author

This is still outstanding. There are numerous TODOs and FIXMEs in the schema document as well as some very lax placeholder validation that needs to be tightened up.

https://github.com/veres-one/veres-one-validator/tree/master/schemas

@mattcollier
Copy link
Contributor Author

We are using ajv@6 which support JSON schema draft 7 which includes conditionals:

https://json-schema.org/understanding-json-schema/reference/conditionals.html

It appears that in combination with allOf as shown in the example on this page, we can see great benefit by doing conditionals based on the JSONLD type of documents.

We are likely to see a performance benefit vs our current usage of anyOf for validating multiple document types and I expect that the resulting validation errors will be much more concise and to the point instead of telling us why a document failed against each and every one of the schemas in the anyOf array.

I note also that there may be opportunities to use the const keyword in place of enum with a single value: https://json-schema.org/understanding-json-schema/reference/generic.html#constant-values

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