Ajv: JSON Schema 2019-09 and JTD (v7)

Created on 27 Apr 2020  路  2Comments  路  Source: ajv-validator/ajv

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:

  • [x] simplify implementing custom applicator keywords
  • [ ] make validation functions serialisable more consistently than the current ajv-pack approach (PR #1332)
  • [ ] consider allowing schema parametrisation (#398)
  • [ ] reduce size of the validation function by refactoring error generation
  • [x] generate custom ajv bundles including only needed vocabularies or their subsets (#460)
  • [ ] JTD support can be implemented as a custom vocabulary with some extra options (#1161)

TODO

  • [ ] types to support new taxonomy of keywords
  • [ ] formalise reference resolution algorithm
  • [ ] formalise annotation collection algorithm
  • [x] formalise code generation algorithm
  • [x] split formats to a separate package
  • [x] implement in typescript
  • [x] drop draft4 support
  • [x] restructure docs
breaking feature refactoring typescript

Most helpful comment

v7.0.0-beta.0 release notes

All 2 comments

Please comment on the questions here: https://github.com/ajv-validator/ajv/issues/1247#issuecomment-660940093

1247 is the scope for the first release of v7-alpha.

v7.0.0-beta.0 release notes

Was this page helpful?
0 / 5 - 0 ratings