{"_id":"@redocly/allof-merge","_rev":"8-29b2685cc84b139e2e9f90dd9c353666","name":"@redocly/allof-merge","dist-tags":{"latest":"0.6.13"},"versions":{"0.6.8":{"name":"@redocly/allof-merge","version":"0.6.8","keywords":["json","schema","json-schema","jsonschema","openapi","swagger","allof","merge","resolve","simplify"],"author":{"name":"Damir Yusipov"},"license":"MIT","_id":"@redocly/allof-merge@0.6.8","maintainers":[{"name":"romanhotsiy","email":"gotsijroman@gmail.com"},{"name":"alawar","email":"olexandr.varchuk@gmail.com"},{"name":"adamaltman","email":"adam@rebilly.com"},{"name":"marshevskyy","email":"marshevskyy@gmail.com"},{"name":"volodymyr-rutskyi","email":"rutskyi.v@gmail.com"},{"name":"slavikbezkorovainyi","email":"slavik@redocly.com"}],"nx":{"namedInputs":{"prod":["!{projectRoot}/tests/**"]}},"dist":{"shasum":"d47118adefe8b63d40dbc0d1bf0e50535bae7e0a","tarball":"https://registry.npmjs.org/@redocly/allof-merge/-/allof-merge-0.6.8.tgz","fileCount":52,"integrity":"sha512-O4acNHHam5YH44fskvVHZn4Pt9DDE676MCAZ5/dlWjTGFjjSWXigItMJoMyDrUBHtezSM1VrYzjvbJgqJGErEA==","signatures":[{"sig":"MEQCIHj2gmQItGg1ghw2NtYUoNcX2Dey1/aPXXBqRaEwAkrlAiAcCbGBEQ3fsJI9zbSaAASNztHoEUIIAeheUN4e/8ytSA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":143952},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","gitHead":"191c1c70d2ea1b8835dbf6473d5ba83c21b62714","scripts":{"test":"nx run vitest:test","build":"pnpm run clean && tsgo","clean":"rimraf lib","ts:check":"tsgo --noEmit"},"_npmUser":{"name":"romanhotsiy","email":"gotsijroman@gmail.com"},"_npmVersion":"11.16.0","description":"Simplify JsonSchema/Openapi by combining allOf safely","directories":{},"_nodeVersion":"26.3.0","dependencies":{"json-crawl":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"gqlapi":"^0.5.1","rimraf":"catalog:","vitest":"catalog:","graphql":"catalog:","js-yaml":"catalog:","typescript":"catalog:","@types/js-yaml":"catalog:","@vitest/coverage-v8":"catalog:"},"_npmOperationalInternal":{"tmp":"tmp/allof-merge_0.6.8_1781265666450_0.3848067915396114","host":"s3://npm-registry-packages-npm-production"}},"0.6.9":{"name":"@redocly/allof-merge","version":"0.6.9","keywords":["json","schema","json-schema","jsonschema","openapi","swagger","allof","merge","resolve","simplify"],"author":{"name":"Damir Yusipov"},"license":"MIT","_id":"@redocly/allof-merge@0.6.9","maintainers":[{"name":"romanhotsiy","email":"gotsijroman@gmail.com"},{"name":"alawar","email":"olexandr.varchuk@gmail.com"},{"name":"adamaltman","email":"adam@rebilly.com"},{"name":"marshevskyy","email":"marshevskyy@gmail.com"},{"name":"volodymyr-rutskyi","email":"rutskyi.v@gmail.com"},{"name":"slavikbezkorovainyi","email":"slavik@redocly.com"}],"nx":{"namedInputs":{"prod":["!{projectRoot}/tests/**"]}},"dist":{"shasum":"4c3af3d772cb358e2237a933772bb99dfd5fabb8","tarball":"https://registry.npmjs.org/@redocly/allof-merge/-/allof-merge-0.6.9.tgz","fileCount":52,"integrity":"sha512-r/89c3IqaRk6lFHfif2/WEndX8NCmYUztEhQMk6g7xdxeKJ63y9ZxnDvkJ+i6womKtfiA/tbYYi6NjQ56z02ow==","signatures":[{"sig":"MEYCIQD+S5oSPgi8CtioLiM7a0HA0XTt9a2M3z8cfCOji8CjkgIhAPUmT5ib/7dG044shdVFP96ZEQhDp8F2YDBVDTLXeO5s","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":143932},"main":"./lib/index.js","type":"module","_from":"file:redocly-allof-merge-0.6.9.tgz","types":"./lib/index.d.ts","module":"./lib/index.js","scripts":{"test":"nx run vitest:test","build":"pnpm run clean && tsgo","clean":"rimraf lib","ts:check":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:b004a5c5-536a-4445-92e2-73a040fe1274"}},"_resolved":"/tmp/487721c0714fb35acb2e74a931dc6833/redocly-allof-merge-0.6.9.tgz","_integrity":"sha512-r/89c3IqaRk6lFHfif2/WEndX8NCmYUztEhQMk6g7xdxeKJ63y9ZxnDvkJ+i6womKtfiA/tbYYi6NjQ56z02ow==","_npmVersion":"11.13.0","description":"Simplify JsonSchema/Openapi by combining allOf safely","directories":{},"_nodeVersion":"24.16.0","dependencies":{"json-crawl":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"gqlapi":"^0.5.1","rimraf":"5.0.7","vitest":"4.1.8","graphql":"16.12.0","js-yaml":"4.1.1","typescript":"6.0.3","@types/js-yaml":"4.0.9","@vitest/coverage-v8":"4.1.8"},"_npmOperationalInternal":{"tmp":"tmp/allof-merge_0.6.9_1781513431715_0.2651764885568384","host":"s3://npm-registry-packages-npm-production"}},"0.6.10":{"name":"@redocly/allof-merge","version":"0.6.10","keywords":["json","schema","json-schema","jsonschema","openapi","swagger","allof","merge","resolve","simplify"],"author":"Damir Yusipov","license":"MIT","_id":"@redocly/allof-merge@0.6.10","maintainers":[{"name":"romanhotsiy","email":"gotsijroman@gmail.com"},{"name":"alawar","email":"olexandr.varchuk@gmail.com"},{"name":"adamaltman","email":"adam@rebilly.com"},{"name":"marshevskyy","email":"marshevskyy@gmail.com"},{"name":"volodymyr-rutskyi","email":"rutskyi.v@gmail.com"}],"nx":{"namedInputs":{"prod":["!{projectRoot}/tests/**"]}},"dist":{"shasum":"9dcb55e0a25e57d4e6ec9d7db4edafe709a2d39f","tarball":"https://registry.npmjs.org/@redocly/allof-merge/-/allof-merge-0.6.10.tgz","fileCount":52,"integrity":"sha512-cfqq+moG2Scg9P6eZKUNa7v1QVxxTynaHgwMUY5YoBpHoyJWseb1mJR5GDuTKmh1nWtwyvH6SIb//1WpJVpllg==","signatures":[{"sig":"MEUCIQDhzi/eUb3k8yMvphGTwcjYYjRmeDCdrJAO7sUBp5hmdQIgSjY4gwgTgTOHtB0iS4KZjaniOImqC5OkvFAb0ZLfL7k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCID7ETwX4wxPcPa8Kc3o4KoLzCrCNrRvHXGW7AnN8sy/BAiEAjSzmgEZe//6DGi3T+Oew7Gdti7u5z9akGzfKIyTvLBo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":170469},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","scripts":{"test":"nx run vitest:test","build":"pnpm run clean && tsgo","clean":"rimraf lib","ts:check":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"b004a5c5-536a-4445-92e2-73a040fe1274"}},"description":"Simplify JsonSchema/Openapi by combining allOf safely","directories":{},"dependencies":{"json-crawl":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"gqlapi":"^0.5.1","rimraf":"5.0.7","vitest":"4.1.11","graphql":"16.14.2","js-yaml":"4.3.2","typescript":"6.0.3","@types/js-yaml":"4.0.9","@vitest/coverage-v8":"4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/allof-merge_0.6.10_1793102325984_0.2641944271571516","host":"s3://npm-registry-packages-npm-production"}},"0.6.11":{"name":"@redocly/allof-merge","version":"0.6.11","keywords":["json","schema","json-schema","jsonschema","openapi","swagger","allof","merge","resolve","simplify"],"author":"Damir Yusipov","license":"MIT","_id":"@redocly/allof-merge@0.6.11","maintainers":[{"name":"romanhotsiy","email":"gotsijroman@gmail.com"},{"name":"alawar","email":"olexandr.varchuk@gmail.com"},{"name":"adamaltman","email":"adam@rebilly.com"},{"name":"marshevskyy","email":"marshevskyy@gmail.com"},{"name":"volodymyr-rutskyi","email":"rutskyi.v@gmail.com"}],"nx":{"namedInputs":{"prod":["!{projectRoot}/tests/**"]}},"dist":{"shasum":"86023107e36577761f7c2f20a231a65627b62fdc","tarball":"https://registry.npmjs.org/@redocly/allof-merge/-/allof-merge-0.6.11.tgz","fileCount":52,"integrity":"sha512-kbo82PtvCiL/OY2SYLhZbAhVKU25Ny/my1lMr0lgYUx7Y4BDZ2/HfSvf1KzkZ7Cn4cxtkdkzPZHJbM31fIjl8g==","signatures":[{"sig":"MEUCICMChiSvNbKm2ko3DpjQU8Or1V/kPBPv9jTHL1VEI+hfAiEAsNzd+4pHPjlhvwSe5P2n+TSOxIP7QH62A/rEyoXKi+I=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCAW9yAP5bcwubD+jJpO10vibnIg5iBnWHU24dMBRXecgIgVzYxikoklHlJmJWFzFS5+N5AVszxXFETyDa4mqa2CGg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":174151},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","scripts":{"test":"nx run vitest:test","build":"pnpm run clean && tsgo","clean":"rimraf lib","ts:check":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"b004a5c5-536a-4445-92e2-73a040fe1274"}},"description":"Simplify JsonSchema/Openapi by combining allOf safely","directories":{},"dependencies":{"json-crawl":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"gqlapi":"^0.5.1","rimraf":"5.0.7","vitest":"4.1.11","graphql":"16.14.2","js-yaml":"4.3.2","typescript":"6.0.3","@types/js-yaml":"4.0.9","@vitest/coverage-v8":"4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/allof-merge_0.6.11_1793629125743_0.48673842759186203","host":"s3://npm-registry-packages-npm-production"}},"0.6.12":{"name":"@redocly/allof-merge","version":"0.6.12","keywords":["json","schema","json-schema","jsonschema","openapi","swagger","allof","merge","resolve","simplify"],"author":"Damir Yusipov","license":"MIT","_id":"@redocly/allof-merge@0.6.12","maintainers":[{"name":"romanhotsiy","email":"gotsijroman@gmail.com"},{"name":"alawar","email":"olexandr.varchuk@gmail.com"},{"name":"adamaltman","email":"adam@rebilly.com"},{"name":"marshevskyy","email":"marshevskyy@gmail.com"},{"name":"volodymyr-rutskyi","email":"rutskyi.v@gmail.com"}],"nx":{"namedInputs":{"prod":["!{projectRoot}/tests/**"]}},"dist":{"shasum":"032e67fd7e77dbd24ad4439e3d1ce08cdd34b2c6","tarball":"https://registry.npmjs.org/@redocly/allof-merge/-/allof-merge-0.6.12.tgz","fileCount":52,"integrity":"sha512-tdhenuLd1tJYQkxEqxLwOHiftKuW2dc6NJr8rmBA9zMM53Pi9Hip/fAEyJjLp632mB4ArbOJ+KRjlE6UuaZ23Q==","signatures":[{"sig":"MEQCIH5S9/xvVT/d+uFBrl6ufJZpJ7+pqmXxi6T1SxAM4gsAAiA/RBfmqESIxKFEOf+bAKJn5+/f7lGLYoTWK51N6nfqgg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIDEFfaLXtFNFn525ZfRkZ07fi/ePEgD+Nd4q+rjarVKiAiEA/PpwA7utwi8UWo8PiAtwTHRtb8GtAMCxSld+bfU44u4=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":174406},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","scripts":{"test":"nx run vitest:test","build":"pnpm run clean && tsgo","clean":"rimraf lib","ts:check":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"b004a5c5-536a-4445-92e2-73a040fe1274"}},"description":"Simplify JsonSchema/Openapi by combining allOf safely","directories":{},"dependencies":{"json-crawl":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"gqlapi":"^0.5.1","rimraf":"5.0.7","vitest":"4.1.11","graphql":"16.14.2","js-yaml":"4.3.2","typescript":"6.0.3","@types/js-yaml":"4.0.9","@vitest/coverage-v8":"4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/allof-merge_0.6.12_1793710572145_0.5034250748485368","host":"s3://npm-registry-packages-npm-production"}},"0.6.13":{"name":"@redocly/allof-merge","version":"0.6.13","keywords":["json","schema","json-schema","jsonschema","openapi","swagger","allof","merge","resolve","simplify"],"author":"Damir Yusipov","license":"MIT","_id":"@redocly/allof-merge@0.6.13","maintainers":[{"name":"romanhotsiy","email":"gotsijroman@gmail.com"},{"name":"alawar","email":"olexandr.varchuk@gmail.com"},{"name":"adamaltman","email":"adam@rebilly.com"},{"name":"marshevskyy","email":"marshevskyy@gmail.com"},{"name":"volodymyr-rutskyi","email":"rutskyi.v@gmail.com"}],"nx":{"namedInputs":{"prod":["!{projectRoot}/tests/**"]}},"dist":{"shasum":"d08b4cf62c6f53cd79ba90310f82537a9f1cb1af","tarball":"https://registry.npmjs.org/@redocly/allof-merge/-/allof-merge-0.6.13.tgz","fileCount":52,"integrity":"sha512-Ca/QjaoOL6dRopWtrBkhiKp7M6JeCqyg6Mjn8OQLYk7ZfwJYe6oEOzip5sUcQ8xWUzHnIgz2v+I3YZdXdWTd9w==","signatures":[{"sig":"MEUCIQCHLB2x+gmEFG8LMB9uvq3Aq7HxOS6MeirXbO97TcccQQIgO0HO2Tose+izpo9rTcn+t3wg0PX6KsrSS/nyUdbai9k=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFKQR5rmuil/sR5dD2s7JnyB5Hk8MawoOb5v2vo8HbvmAiA14Z5tr2fusTjH45x0R66RCKDwlLQ8tS0lslTHKWmMIA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":174717},"main":"./lib/index.js","type":"module","types":"./lib/index.d.ts","module":"./lib/index.js","scripts":{"test":"nx run vitest:test","build":"pnpm run clean && tsgo","clean":"rimraf lib","ts:check":"tsgo --noEmit"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"b004a5c5-536a-4445-92e2-73a040fe1274"}},"description":"Simplify JsonSchema/Openapi by combining allOf safely","directories":{},"dependencies":{"json-crawl":"^0.5.3"},"_hasShrinkwrap":false,"devDependencies":{"gqlapi":"^0.5.1","rimraf":"5.0.7","vitest":"4.1.11","graphql":"16.14.2","js-yaml":"4.3.2","typescript":"6.0.3","@types/js-yaml":"4.0.9","@vitest/coverage-v8":"4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/allof-merge_0.6.13_1793732403280_0.9824994112809402","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-06-12T12:01:06.208Z","modified":"2026-11-05T15:06:40.329Z","0.6.8":"2026-06-12T12:01:06.605Z","0.6.9":"2026-06-15T08:50:31.888Z","0.6.10":"2026-10-27T11:58:46.070Z","0.6.11":"2026-11-02T14:18:45.815Z","0.6.12":"2026-11-03T12:56:12.230Z","0.6.13":"2026-11-03T19:00:03.413Z"},"author":"Damir Yusipov","license":"MIT","keywords":["json","schema","json-schema","jsonschema","openapi","swagger","allof","merge","resolve","simplify"],"description":"Simplify JsonSchema/Openapi by combining allOf safely","maintainers":[{"email":"gotsijroman@gmail.com","name":"romanhotsiy"},{"email":"olexandr.varchuk@gmail.com","name":"alawar"},{"email":"adam@rebilly.com","name":"adamaltman"},{"email":"marshevskyy@gmail.com","name":"marshevskyy"},{"email":"andrew.tatomyr@gmail.com","name":"tatomyr"},{"email":"rutskyi.v@gmail.com","name":"volodymyr-rutskyi"}],"readme":"# @redocly/allof-merge\n\nThis is a fork of [allof-merge](https://github.com/udamir/allof-merge) maintained by Redocly. The original package is MIT-licensed; the upstream `LICENSE` is preserved alongside this README.\n\n---\n\n> Merge schemas with allOf into a more readable composed schema free from allOf.\n\n## Features\n- Safe merging of schemas combined with allOf in whole document\n- Fastest implmentation - up to x3 times faster then other popular libraries\n- Merged schema does not validate more or less than the original schema\n- Removes almost all logical impossibilities\n- Correctly merge additionalProperties, patternProperties and properties taking into account common validations\n- Correctly merge items and additionalItems taking into account common validations\n- Supports custom rules to merge other document types and JsonSchema versions\n- Supports input with circular references (javaScript references)\n- Supports $refs and circular $refs either (internal references only)\n- Correctly merge of $refs with sibling content (optionally)\n- Correctly merge of combinaries (anyOf, oneOf) with sibling content (optionally)\n- Typescript syntax support out of the box\n- No dependencies (except json-crawl), can be used in nodejs or browser\n\n## Works perfectly with specifications:\n\n- [JsonSchema](https://json-schema.org/draft/2020-12/json-schema-core.html)\n- [OpenApi 3.x](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.3.md)\n- [GraphApi](https://github.com/udamir/graphapi)\n- ~~Swagger 2.x~~ (roadmap)\n- ~~AsyncApi 2.x~~ (roadmap)\n- ~~AsyncApi 3.x~~ (roadmap)\n\n## Other libraries\nThere are some libraries that can merge schemas combined with allOf. One of the most popular is [mokkabonna/json-schema-merge-allof](https://www.npmjs.com/package/json-schema-merge-allof), but it has some limitatons: Does not support circular $refs and no Typescript syntax out of the box.\n\n## External $ref\nIf schema contains an external $ref, you should bundle it via [api-ref-bundler](https://github.com/udamir/api-ref-bundler) first.\n\n## Installation\n```SH\nnpm install @redocly/allof-merge --save\n```\n\n## Usage\n\n### Nodejs\n```ts\nimport { merge } from '@redocly/allof-merge'\n\nconst data = {\n  type: ['object', 'null'],\n  additionalProperties: {\n    type: 'string',\n    minLength: 5\n  },\n  allOf: [{\n    type: ['array', 'object'],\n    additionalProperties: {\n      type: 'string',\n      minLength: 10,\n      maxLength: 20\n    }\n  }]\n}\n\nconst onMergeError = (msg) => {\n  throw new Error(msg)\n}\n\nconst merged = merge(data, { onMergeError })\n\nconsole.log(merged)\n// {\n//   type: 'object',\n//   additionalProperties: {\n//     type: 'string',\n//     minLength: 10,\n//     maxLength: 20\n//   }\n// }\n\n```\n\n## Documentation\n\n### `merge(data: any, options?: MergeOptions)`\nCreate a copy of `data` with merged allOf schemas:\n\n\n### Merge options\n```ts\ninterface MergeOptions {\n  // source document if merging only part of it\n  // (optional) default = data\n  source?: any          \n  \n  // custom merge rules\n  // (optional) default = auto select based on the input (jsonSchemaMergeRules, openApiMergeRules, graphapiMergeRules)\n  rules?: MergeRules    \n\n  // merge $ref with sibling content\n  // (optional) default = false\n  mergeRefSibling?: boolean  \n\n  // merge anyOf/oneOf with sibling content\n  // (optional) default = false\n  mergeCombinarySibling?: boolean  \n\n  // Merge error hook, called on any merge conflicts\n  onMergeError?: (message: string, path: JsonPath, values: any[]) => void\n\n  // Ref resolve error hook, called on broken ref\n  onRefResolveError?: (message: string, path: JsonPath, ref: string) => void\n}\n```\n\n### Supported rules\nYou can find supported rules in the src/rules directory of this repository:\n- `jsonSchemaMergeRules(version: \"draft-04\" | \"draft-06\")`\n- `openApiMergeRules(version: \"3.0.x\" | \"3.1.x\")`\n- `graphapiMergeRules`\n\n## Contributing\nThis package keeps the upstream goal of no additional runtime dependencies (`json-crawl` only). Run unit tests before submitting a PR:\n\n```SH\npnpm --filter @redocly/allof-merge test\n```\n\n## License\n\nMIT — see [LICENSE](./LICENSE). Original work copyright Damir Yusipov.\n","readmeFilename":""}