2.0.1 • Published 6 years ago

@korzio/djv-draft-04 v2.0.1

Weekly downloads
39,553
License
MIT
Repository
-
Last release
6 years ago

Build Status Join the chat at https://gitter.im/korzio/djv

@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.

References