Describe the bug
I have a case where a schema may return a circular dependency (even to itself) and this seems to cause a maximum callstack and/or out of memory exception. But only if a multi-level baseUri is specified.
To Reproduce
This causes an infinite loop:
const resolver = new Resolver({
resolvers: {
file: {
resolve(p) {
return { $ref: p.toString() };
}
}
}
});
await resolver.resolve([{ $ref: './a' }], {
baseUri: '/root1/root2' // Change this to /root1 and it's fine
});
Expected behavior
baseUri should support any number of nested folders.
Additional context
Just a guess, but I assume this is something related to the normalised key that's being stored as a visited node - but am unfamiliar with the code and haven't been able to dig into it yet.
Environment (remove any that are not applicable):
Describe the bug
I have a case where a schema may return a circular dependency (even to itself) and this seems to cause a maximum callstack and/or out of memory exception. But only if a multi-level baseUri is specified.
To Reproduce
This causes an infinite loop:
Expected behavior
baseUri should support any number of nested folders.
Additional context
Just a guess, but I assume this is something related to the normalised key that's being stored as a visited node - but am unfamiliar with the code and haven't been able to dig into it yet.
Environment (remove any that are not applicable):