Closed azaslavsky closed 7 years ago
This package implements $merge and $patch as custom keywords, it only uses resolved schemas in place, without generating full resolved schema.
It's relatively simple to generate the schema you want, using the same packages that are used here and json-schema-traverse.
It's worth publishing as a separate package I think - it could be used in ajv-cli package to add an additional command.
For example, if I have the following two schemas:
Is there anyway to output the result of the merge operation? Something like
ajv.getMergedSchema(schemaExtended);
, which would produce:The reason I ask is that most other json-schema implementations do not support merge-patch, so it would be nice if there was some method by which JSON schemas that use these keywords could be converted to regular JSON schemas.