ajv-validator / ajv-merge-patch

$merge and $patch keywords for Ajv JSON-Schema validator to extend schemas
https://ajv.js.org
MIT License
46 stars 17 forks source link

Support Ajv v7 #38

Closed kevbook closed 3 years ago

kevbook commented 3 years ago

Or we not suppose to use merge / patch for JSON schemas?

epoberezkin commented 3 years ago

Yes, it needs to be upgraded too - it’s not high on priorities list though...

It is less important for v7 as you have an option to use unevaluatedProperties in similar scenarios, but it’s still worth upgrading (effectively, re-writing) this package to simplify migration.

willdurand commented 3 years ago

It is less important for v7 as you have an option to use unevaluatedProperties in similar scenarios, but it’s still worth upgrading (effectively, re-writing) this package to simplify migration.

Hey @epoberezkin, could you expand on this? I'd like to upgrade ajv on a project that also relies on ajv-merge-patch but it throws errors and I am not sure to understand why (see https://github.com/mozilla/addons-linter/pull/3504#issuecomment-762861071). Thanks!

treardon17 commented 3 years ago

@epoberezkin is there any update on this? or any possibility of merging https://github.com/ajv-validator/ajv-merge-patch/pull/39? The docs still reference this package as the solution for merging schemas (https://ajv.js.org/guide/combining-schemas.html#merge-and-patch-keywords). I'm trying to upgrade from AJV 6.12.6, but I can't without this package. Is there an alternative to merging schemas outside of this package? You mentioned unevaluatedProperties, but I'm not sure I follow how that would help.

epoberezkin commented 3 years ago

You mentioned unevaluatedProperties, but I'm not sure I follow how that would help.

The use case these keywords were created for - extension of strict records - can now be implemented with unevaluatedProperties. There can be some other scenarios of course.

willdurand commented 3 years ago

@epoberezkin sorry to bother you but could you consider #39 to solve this issue? and if not, could you let us know why and/or how we could move forward? Thanks!

epoberezkin commented 3 years ago

Thanks for pinging... Looking

willdurand commented 3 years ago

Thanks for pinging... Looking

@epoberezkin thanks for looking into it!