fix: merged schemas cache key
- [x] run
npm run testandnpm run benchmark - [x] tests and/or benchmarks are included
- [ ] ~~documentation is changed or added~~
- [x] commit message and code follows the Developer's Certification of Origin and the Code of conduct
Hello, 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 into Maximum 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 in context.mergedSchemasIds (like merged schemas from buildOneOf and from buildAllOf functions).
I am not sure of the solution. Thank you for your review !
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.
hi @ivan-tymoshenko , any progress on this? Can I maybe try to take it from wherever you've got to?