Safely merge JSON Schema allOf compositions into a single, readable schema by resolving logical intersections and conflicts. v0.8.1 supports most JSON Schema core/validation keywords (v6), correctly handles additionalProperties, patternProperties, items, and dependencies. Unlike simple schema merging tools, it throws on logical impossibilities and uses keyword-specific resolution (intersection, union, min/max) to preserve validation semantics. Stable with low release cadence. Suitable for schema authors who want to eliminate allOf from their schemas without changing validation behavior. Supports pluggable resolvers for custom keywords. Node.js >=12.0.0 required.
npm install json-schema-merge-allofNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Merges an allOf array with a root schema, combining properties and required fields while honoring additionalProperties: false.
Use `import mergeAllOf from 'json-schema-merge-allof'` or in CJS: `const mergeAllOf = require('json-schema-merge-allof').default`.Call `mergeAllOf(schema, { ignoreAdditionalProperties: true })` to allow merging even when additionalProperties is false.Use `mergeAllOf(schema, { customResolvers: { myKeyword: resolverFunction } })` instead of `{ resolvers: ... }`.Ensure your schema is compliant with draft-06 or later, or provide custom resolvers for non-standard keywords.
Review your schema for logical contradictions that would yield an empty intersection.
Change to `const mergeAllOf = require('json-schema-merge-allof').default;` or switch to ESM `import`.Use the `ignoreAdditionalProperties: true` option, or ensure all allOf members have compatible additionalProperties settings.
Remove or adjust the type constraints in the allOf members to have a common type.
Use default import: `import mergeAllOf from 'json-schema-merge-allof'`.