You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's creating the sub-dereferencer, passing in the current refCache before the current ref is added. This sub-dereferencer then attempts to dereference the same ref (not finding it in the cache), and so on ad infinitum. Perhaps fetched could be added to refCache before creating subDereffer?
The text was updated successfully, but these errors were encountered:
Describe the bug
Infinite recursion when a reference references itself.
To Reproduce
Steps to reproduce the behavior:
Attempt to dereference the following schema:
Expected behavior
For the library to detect/handle the self reference and deference appropriately.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
From looking at the code, I think the issue lies around https://github.com/json-schema-tools/dereferencer/blob/master/src/dereferencer.ts#L168
It's creating the sub-dereferencer, passing in the current
refCache
before the current ref is added. This sub-dereferencer then attempts to dereference the same ref (not finding it in the cache), and so on ad infinitum. Perhapsfetched
could be added torefCache
before creatingsubDereffer
?The text was updated successfully, but these errors were encountered: