Open DamienVicet opened 5 months ago
I found the problem. I'm working on the solution. Unfortunatelly merging schemas with recurcive references is the most complecated part of this library and take tons of time every time when we need to fix the bug.
npm run test
andnpm run benchmark
documentation is changed or addedHello, this PR fixes #724.
When diving in the bug, I found that the
context.mergedSchemasIds
Map, added by @ivan-tymoshenko, is using objects as keys. This caused the schema to infinitely try to build and results intoMaximum call stack size exceeded
error. So I replaced the key by a hash of the object, then I got another problem :anyOf inside allOf
test failed because, to my understanding, we try to cache different merged schemas using the same key incontext.mergedSchemasIds
(like merged schemas frombuildOneOf
and frombuildAllOf
functions).I am not sure of the solution. Thank you for your review !