@korzio/djv-draft-04
v2.0.1
Published
JSON-Schema draft-04 plugin for djv package
Downloads
205,493
Maintainers
Readme
@korzio/djv-draft-04
Dynamic JSON-Schema Validator Plugin to support draft-04 version of JSON-Schema specification.
Currently the djv package supports JSON-Schema v6 and v4. Since version 2.0.0 it uses v6 by default. @korzio/djv-draft-04 package intent is to provide support for v4 for the djv package.
Please check the main package documentation.
Version of the plugin is syncronized with the djv, as any major change in the main repo should point to plugin upgrade.
Table of contents
Install
npm install @korzio/djv-draft-04
or
<script src="@korzio/djv-draft-04.js"></script>
Usage
To use the v4 directly in the djv package specify version
option when creating environment.
const env = new djv({ version: 'draft-04' });
It is also possible to use useVersion
method.
env.useVersion('draft-04');
The djv will require draft-04 plugin implicitly. Be careful as once the environment is modified, it will not be able to validate different versions of JSON-Schema.