ajv-merge-patch icon indicating copy to clipboard operation
ajv-merge-patch copied to clipboard

Backward compatibility is broken, today "ajv-merge-patch" v5.0.1 is not working with "ajv"v6.12.3"

Open Parchuk opened this issue 3 years ago • 2 comments

node_modules/ajv/lib/keyword.js:30 throw new Error('Keyword ' + keyword + ' is not a valid identifier'); ^ It’s related witth this changes

Parchuk avatar Mar 11 '22 14:03 Parchuk

I have the same problem; I'm using the latest version of fastify and added ajv-merge-patch as a plugin. When I revert back to 4.0.1 I have no problem.

wieringen avatar May 08 '22 19:05 wieringen

I have the same problem; I'm using the latest version of fastify and added ajv-merge-patch as a plugin. When I revert back to 4.0.1 I have no problem.

My fix for this problem is const addKeyword = ajv.addKeyword; ajv.addKeyword = (k, definition) => { if (typeof k === 'object') { const keyword = k.keyword; delete k.keyword; addKeyword.call(ajv, keyword, k); return; } addKeyword.call(ajv, k, definition); }

Parchuk avatar May 14 '22 19:05 Parchuk