You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This lib uses the JSON schema standard (which allow to describe the structure of a JSON) to validate data retrieved from local storage.
As the goal is to validate data, this lib always supported only a subset of the JSON schema standard. But while not supporting all the features of the standard, this lib has tried until now to:
stay compatible with a full JSON schema (so people can use it for other purposes if needed) ;
be as simple as possible, for example by making type: 'object' optional when the schema already has properties.
Unfortunately, due to differences and/or limitations of TypeScript, this has lead to a mess with the JSONSchema interface in this lib:
autocompletion is not accurate (for example, TypeScript will propose you maxItems in any schemas, while it should be only proposed for arrays) ;
For v8, it is planned to resolve these problems once and for all. Investigation is needed, but here what is being considered:
assume a limited subset of the JSON schema standard = drop support for full JSON schemas (it is very likely that the current interface is already not compatible with all the JSON schema standard, as the standard is becoming more and more complex ; also, I don't think it's a feature widely used)
if we want TypeScript to be OK, a discrimitated union type must have a common required property, meaning type will become required even for objects and arrays (which is the common usage by the way).
The text was updated successfully, but these errors were encountered:
This lib uses the JSON schema standard (which allow to describe the structure of a JSON) to validate data retrieved from local storage.
As the goal is to validate data, this lib always supported only a subset of the JSON schema standard. But while not supporting all the features of the standard, this lib has tried until now to:
type: 'object'
optional when the schema already hasproperties
.Unfortunately, due to differences and/or limitations of TypeScript, this has lead to a mess with the
JSONSchema
interface in this lib:maxItems
in any schemas, while it should be only proposed for arrays) ;For v8, it is planned to resolve these problems once and for all. Investigation is needed, but here what is being considered:
assume a limited subset of the JSON schema standard = drop support for full JSON schemas (it is very likely that the current interface is already not compatible with all the JSON schema standard, as the standard is becoming more and more complex ; also, I don't think it's a feature widely used)
if we want TypeScript to be OK, a discrimitated union type must have a common required property, meaning
type
will become required even for objects and arrays (which is the common usage by the way).The text was updated successfully, but these errors were encountered: