Closed
Description
Problem
2019-09 introduced two extensions to draft-07 validation process, that are very difficult / impossible to implement in the current Ajv design, specifically:
- unevaluatedKeyword that depends on annotation collection (specifically, collection of "evaluated" properties in visited and successfully validated branches), and requires validation of all dependent branches without short-circuiting.
- recursiveRef that depends on dynamic ref scoping
In addition to that, it would help rethinking the definition of "keyword" in Ajv and eliminating the difference between "standard" and "custom" keyword (Ajv taxonomy) and replacing it with "applicators" and "vocabularies" of "assertions" and "annotations" (JSON Schema taxonomy).
Some other challenges that can be addressed:
- simplify implementing custom applicator keywords
- make validation functions serialisable more consistently than the current ajv-pack approach (PR Generation of standalone validation code #1332)
-
consider allowing schema parametrisation ($param(s) to allow parametrized schemas #398) -
reduce size of the validation function by refactoring error generationthe solution is to use the optionmessages: false
together with ajv-i18n. - generate custom ajv bundles including only needed vocabularies or their subsets (Script to generate bundle including subset of keywords #460)
- JTD support can be implemented as a custom vocabulary with some extra options (Support for JSON Type Definition #1161)
TODO
- types to support new taxonomy of keywords
-
formalise reference resolution algorithmsimplify reference resolution implementation -
formalise annotation collection algorithmonly implemented to support unevaluatedProperties/Items - formalise code generation algorithm
- split formats to a separate package
- implement in typescript
- drop draft4 support
- restructure docs