CHANGELOG.md
April 12, 2026 · View on GitHub
Changelog
v11.4.0
- added schema annotation on
compileSchemafor unknown format - replaced option
withSchemaAnnotationsin favor of always creating all annotations
Breaking change: Moved some large format-validators to separate entry point:
- the following format-validators have been moved to a separate entry point "json-schema-library/formats":
hostname,idn-email,ipv4,ipv6,uri,uri-reference,uri-template - the following additional format-validators are available through "json-schema-library/formats":
iri,iri-reference,idn-hostname
Use the following to add the additional format validators to drafts per default:
import { addFormats } from "json-schema-library/formats";
import { draft04, draft06, draft07, draft2019, draft2020 } from "json-schema-library";
// add additional formats to the following drafts
addFormats([draft04, draft06, draft07, draft2019, draft2020]);
v11.3.0
- added option
draftas fallback for a missing$schemaid - added setting for properties to merge when resolving a
$reftosettings.PROPERTIES_TO_MERGE
v11.2.0
- introduced
throwOnInvalidRefto abort validation when a $ref cannot be resolved - added export of meta-schema for all drafts using
import "json-schema-library/remotes" - added support for format validations:
idn-hostname,iri,iri-reference
v11.1.0
- introduced upcoming keyword
propertyDependenciesKeywordto package export - added support for keyword
deprecatedMessage - introduced schema validation
v11.0.4, v11.0.5
- removed enforcing packageManager as this failed build-jobs
v11.0.3
- fixed type of main input-schema to support boolean
- enforced yarn as a package manager
v11.0.2
- fixed
getNodeto always return a reduced JSON schema - fixed issues using reduce with
oneOfProperty
v11.0.1
- improved error reporting when using oneOfProperty-declarator
v11.0.0
- introduced annotations
- added node.createAnnotation helper
- changed typing to strict
- added annotations-list to
validate()result - added keyword support for
deprecated: truewhich returns adeprecated-warningannotation
breaking changes:
- Return type of validators is now
ValidationReturnTypeinstead ofValidationResult - type
AnnotationDatareplacesErroData
v10.5.0
- added support for ref resolution in getSchemaType
v10.4.0
- introduced esm module export
- fixed typo in argument
disableRecusionLimitdisableRecursionLimit - added settings to exports for global changes of settings
v10.3.0
- introduce setting
REGEX_FLAGSand schema-propertyregexFlagsto customize regex flags to use evaluating regex - fixed an issue resolving non-URI compatible $ref-targets containing
#/definitions
v10.2.0
- introduce getData setting
useTypeDefaults - introduce support to merge meta-properties using $ref-resolution
v10.1.0
- replaced
node.additionalItemsbynode.itemsfor drafts below 2020-12 - fixed
additionalItemsbehaviour to be ignored whenschema.itemsis not an array
v10.0.0
This update involves some significant changes in how you work with the library, so please carefully review the migration guide and adjust your implementation accordingly.
In version v10.0.0, we've made significant changes to the library’s API, particularly in how we handle drafts and schemas. These changes are required to support features like dynamicAnchor, unevaluatedItems, and oneOfIndex and to integrate with the headless-json-editor. The previous approach of directly working with JSON schema objects lacked the flexibility needed for more advanced features and extensibility.
The new implementation revolves around compiling schemas into a SchemaNode tree. This change offers a more fitting, simpler, and extensible approach to working with JSON schemas.
Key Changes:
- Compile Schema: The
compileSchemafunction now replaces the previous Draft-Class approach. - SchemaNode Representation: All schemas are now represented as
SchemaNode, which holds the schema and provides an easier way to work with them.
Breaking Changes:
compileSchema is now a standalone function and replaces the Draft class. All return values for JSON Schema are now SchemaNode objects that contain a schema property.
// PREVIOUSLY
const draft = new Draft(schema);
// NOW
const node = compileSchema(schema);
Changed Methods:
draft.createSchemaOf(schema)→node.createSchema(schema)draft.each(data, callback)→const nodes = node.toDataNodes(data)draft.eachSchema(callback)→const nodes = node.toSchemaNodes()draft.getChildSchemaSelection(property)→node.getChildSelection(property)draft.getNode(options)→node.getNode(pointer, data, options)draft.getTemplate(inputData)→node.getData(inputData)draft.isValid(data)→node.validate(data).validdraft.step(property, data)→node.getNodeChild(property, data)
Renamed Properties: templateDefaultOptions → getDataDefaultOptions
Draft Customization: Customizing drafts has changed completely. The previous methods of extending drafts are no longer valid, and draft handling is now centered around SchemaNode.
Removed Error Property name: Error property name has been removed from JsonError in favor of code.
Removed Configuration Option: The templateDefaultOptions property has been removed from the global settings object. You should now configure it using the compileSchema options:
compileSchema(schema, {
getDataDefaultOptions: {
addOptionalProps: false,
removeInvalidData: false,
extendDefaults: true
}
});
**Changed remote id` has to be a valid url (previously any value was accepted)
v9.0.0
breaking changes:
- getSchema signature changed in favour of an options object. Instead of
draft.getNode(pointer, data)arguments have to be passed as an objectdraft.getNode({ pointer, data }). This removes setting unwanted optional arguments and keeps the api more stable in the future (e.g.withSchemaWarningoption) - JsonError now must expose
pointer,schemaandvalueconsistently on data property
updates
- getSchema consistently returns errors and can return errors for empty schema using
withSchemaWarningoption
v8.0.0
With version v8.0.0, getData was improved to better support optional properties and utilize existing core logic, making it more reliable. Breaking changes:
- Renamed
JSONErrortoJsonErrorandJSONSchematoJsonSchema getDataonly adds required properties. Behaviour can be changed by getData default options- Internal schema property
oneOfSchemahas been replaced byschema.getOneOfOrigin() - Changed
unique-items-errorto point to error for duplicated item and changed data-properties - Removed
SchemaServiceas it was no longer used nor tested
Exposed new helper functions
mergeSchema- Merges to two json schemareduceNode- Reduce schema by merging dynamic constructs into a static json schema omitting those propertiesisDynamicSchema- Returns true if the passed schema contains dynamic properties (if, dependencies, allOf, etc)resolveDynamicSchema- Resolves all dynamic schema definitions for the given input data and returns the resulting JSON Schema without any dynamic schema definitions.
7.0.0
- changed core interface to draft for simpler configuration using a configuration map
Breaking Changes
- replaced
Coreinterface by newDraftinterface - changed export of
InterfacetoDraft - changed export of
InterfacetoDraft - renamed
addSchematoaddRemoteSchema - changed api of
compileSchemato have an additional schema-parameter for rootSchema reference - changed
compileSchemaandaddRemoteSchemato work on instance state, instead of global state addRemoteSchema,compileSchemanow requires draft instance as first parameter- removed direct export of following functions:
addValidator,compileSchema,createSchemaOf,each,eachSchema,getChildSchemaSelection,getSchema,getTemplate,isValid,step,validate. They are still accessible under the draftConfigs of each draft-version - changed draft version of
JsonEditorto draft07
Milestone
- [✓] configurable and consistent draft api
- [✓] expose all function under their draft-version
- [✓] remove global states in remotes
6.1.0
- [✓] Feature -- add support for dependencies in getSchema and getTemplate
- [✓] Feature -- added isJSONError type guard
- fixe and improve types
version 4.0
- [✓] Fix -- latest benchmark tests
- [✓] Fix -- iterate schema (using typeDefs)
- [✓] Fix -- scopes per schema-instance
- [✓] Fix -- insane $ref resolution 'node' can be in 'root/node' or 'root/folder/node'
- [✓] Refactor -- remove duplication from resolveRef.strict and resolveRef.withOverwrite
- [✓] Change -- improve function apis (param order, rootSchema per default)
- [✓] Fix --
getTemplateto resolve $ref to infinity
Breaking Changes
iterateSchemarenamed toeachSchemavalidateandisValidchanged signature from (schema, data, [pointer]) to (data, [schema], [pointer])validateAsyncchanged signature from (schema, data, [pointer], [onError]) to (data, [{ schema, pointer, onError }])getTemplatechanged signature from (schema, data) to (data, [schema])getSchemachanged signature from (schema, data, [pointer]) to (pointer, [data], [schema])eachchanged signature from (schema, data, [pointer]) to (data, [schema], [pointer])resolveOneOfchanged signature from (schema, data, [pointer]) to (data, [schema], [pointer])precompileSchemarenamed tocompileSchema
Milestone consistent feature support
- [✓] no side-effects on added remote-schemas
- [✓] rootSchema should always be compiled
- [✓] Add missing support for allOf and anyOf type definitions in 'step' and 'getTemplate'
- [✓] Complete schema support in iterateSchema
2017
- [~] Features -- Improve validation maps to add & hook (!) custom entries (WIP, Add tests)
- [✓] Fix -- Return all errors in oneOf-validation
- [✓] Feature -- Error progress notification for async validation
- [✓] Refactor -- Keyword validators should only be called for defined keyword
- [✓] Feature -- getSchema of patternProperties
Milestone add remaining draft04 features
- [✓] remote references
- [✓] default format validations
- [✓] definitions
- [✓] dependencies
- [✓] Features -- allOf
- [✓] Features -- anyOf
- [✓] Features -- type-array
- [✓] Features -- patternProperties
- [✓] Features -- uniqueItems
- [✓] Features -- oneOf: fail for multiple matching oneof-schemas
- [✓] Features -- oneOf: for non-arrays
- [✓] Features -- required (array of properties). Currently every property is required by default
16/12
- [✓] Testing (validate real json files)
- [✓] Test + document core differences
- [✓] Add async validation
Milestone customizable default and form (json-editor) validation
- [✓] Sanitize Errors
- [✓] Features -- Add core: Form, fix core: Draft04 - by using separate functions
- [✓] Add getTemplate to core (resolveOneOf)
- [✓] Breaking -- Add sort of 'core' to customize validation, stepper, errors etc and reduce requried arguments
Milestone custom validator (form-validation, oneOfProperty)
- [✓] Features -- additionalProperties: Boolean | Schema
- [✓] Features -- additionalItems: Boolean | Schema
- [✓] Features -- Add support for type "integer"
- [✓] Features -- oneOf -> oneOfProperty ( + Documentation)
- [✓] Breaking -- change isValid to return boolean
- [✓] Breaking -- use
stepin isValid -- bad: circular dependencies with step -> guessOneOfSchema -> isValid --X-> step - [✓] Features -- items: [] schema (order/defined indices)
- [✓] Features -- not
- [✓] Features -- return custom errors in data validation
- [✓] Basics