Skip to content

Commit

Permalink
docs: note on readme of v10 and v9
Browse files Browse the repository at this point in the history
  • Loading branch information
sagold committed Jun 28, 2024
1 parent 2772e09 commit 689311f
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
<a href="#draft-methods">draft methods</a> | <a href="#draft-extensions">draft extensions</a> | <a href="#draft-customization">draft customization</a> | <a href="#breaking-changes">breaking changes</a>
</p>

> ⚠️ This documentation refers to the upcoming release version 10, which can be insalled by `npm install json-schema-library@10.0.0-rc1`. For the latest release please refer to the [documentation of version 9.3.5](https://github.com/sagold/json-schema-library/tree/v9.3.5)
**install**

`yarn add json-schema-library`
Expand All @@ -35,7 +37,6 @@ const errors: JsonError[] = jsonSchema.validate(myData);

What follows is a description of the main draft methods.


## Draft support

`json-schema-library` supports almost all draft features. This sections lists currently unsupported features for each draft
Expand All @@ -44,13 +45,12 @@ What follows is a description of the main draft methods.

**Currently unsupported core features:**

- `$vocabulary` - meta-schemas are not parsed for enabled features
- `unevaluatedItems: uncle-schema` - evaluation of uncle-schemas is not supported. Properties will be return as evaluated
- `unevaluatedProperties: uncle-schema` - evaluation of uncle-schemas is not supported. Properties will be return as evaluated
- `$vocabulary` - meta-schemas are not parsed for enabled features
- `unevaluatedItems: uncle-schema` - evaluation of uncle-schemas is not supported. Properties will be return as evaluated
- `unevaluatedProperties: uncle-schema` - evaluation of uncle-schemas is not supported. Properties will be return as evaluated

</details>


## Draft methods

- [validate](#validate)
Expand Down Expand Up @@ -309,7 +309,6 @@ expect(myData).to.deep.equal([]);

</details>


### each

`each` iterates over each data-item (_object_, _array_ and _value_) and emits the data-item, schema and location to a callback.
Expand Down Expand Up @@ -1006,8 +1005,7 @@ With version `v10.0.0` _draft 2019-09_ is supported and can be used with `import

_Draft 2019-09_ requires collection of previous resolved sub-schemas. Thus, an additional type `SchemaNode` had to be introduced, which is used in almost all draft methods defined for draft-configs. The api in draft-instances mostly stayed the same with the following exceptions:

- `step` and resolvers work on and return a `schemaNode`, containing the requested schema

- `step` and resolvers work on and return a `schemaNode`, containing the requested schema

### v9.0.0

Expand All @@ -1020,7 +1018,6 @@ _Draft 2019-09_ requires collection of previous resolved sub-schemas. Thus, an a

- _getSchema_ consistently returns errors and can return errors for empty schema using `withSchemaWarning` option


### v8.0.0

With version `v8.0.0`, _getTemplate_ was improved to better support optional properties and utilize existing core logic, making it more reliable. Breaking changes:
Expand All @@ -1040,7 +1037,6 @@ With version `v8.0.0`, _getTemplate_ was improved to better support optional pro

</details>


### v7.0.0

With version `v7.0.0`, library export and Draft API has changed heavily. The API is now more consistent across draft-versions and offers a simple and consistent configuration interface for existing and custom drafts. In addition, most standalone functions are no longer exposed separately, but under its current _draftConfigs_ and mainly on each draft-instance. This will help to reduce confusion when consuming this API.
Expand All @@ -1060,17 +1056,14 @@ The above documentation reflects all these changes. Just reach out if you have t

</details>


### v6.0.0

With version `v6.0.0` supported json schema drafts are exported directly as `Draft04`, `Draft06`, `Draft07`. Example use: `import { Draft07 } from "json-schema-library"`.


### v5.0.0

With version `v5.0.0` the API has changed to es6 modules, where there is no `default` export, only named exports. Additionally all code has been rewritten in TypeScript. When directly accessing files, switch to `dist/module/*.js`-files for plain js-modules.


### v4.0.0

With version `v4.0.0` the API has changed in order to use the defined (root) schema in draft as default where possible. This means most methods have a changed signature, where `data` is passed before an optional `schema` argument.

0 comments on commit 689311f

Please sign in to comment.