The depth was being artificially inflated with highly complex recursive designs, this fixes the depth counter permanently.
Signed-off-by: quobix <dave@quobix.com>
Really hammering on this model using all available examples of crazy references used in crazy ways. The fixes mean I can delete the recent patch added to handle lost indexes.
I spent two days on this commit.
Signed-off-by: quobix <dave@quobix.com>
If a polymorphic type was used incorrectly (as a map and not an array) then the logic was getting a little upset. This fixes that issue and adds some tests to validate correct handling.
Signed-off-by: quobix <dave@quobix.com>
When a polymorphic type is used, that isn’t a ref, but contains a ref, is now picked up. Thank you vercel for this edge case. Please build better specs.
Signed-off-by: quobix <dave@quobix.com>
Signed-off-by: quobix <dave@quobix.com>
Move original ref resolving to end of resolving run
this prevents mid-recursion shifting of nodes.
Signed-off-by: quobix <dave@quobix.com>
speakeasy have some crazy recursive tests. It highlighted an issue with nested resolving intriduced in 0.13.7 of libopenapi to resolve issue #195
This in fact created another bug that only shows up with deeply nested refs, the problem is that the resolver was stitching together references, whilst still burrowing, which means it lots it’s place when jumping around everywhere.
Signed-off-by: quobix <dave@quobix.com>
stopped rolodex looking up root file, looking in components schemas for a reference also. Dropped stripe circular refs down by one. seems to be catching the duplicate now.
Signed-off-by: quobix <dave@quobix.com>
This builds on the last patch, by also catching the issue in the resolver and then allowing it to bubble up to applications.
no new fixes, no new featuers, just better integration so vacuum can report the issues.
Signed-off-by: quobix <dave@quobix.com>
If the number of relatives exceeds 500 deep when resolving, libopenapi will now log a warning and escape that path from continuing. There is no reason on earth for a depth this large. It most likely indicates a circular reference that was ignored and then resolved.
Signed-off-by: quobix <dave@quobix.com>
discovered while running tests, vacuum explodes with the new stripe spec. It’s a `FullDefintion` vs `Definition` misfire.
Signed-off-by: quobix <dave@quobix.com>
Resolving and indexing has changed, new code is required and this isue highlighted a glitch introduced with the addition of the rolodex when resolving.
Signed-off-by: quobix <dave@quobix.com>
Every `Build()` method now requires a `context.Context`. This is so the rolodex knows where to resolve from when locating relative links. Without knowing where we are, there is no way to resolve anything. This new mechanism allows the model to recurse across as many files as required to locate references, without loosing track of where we are in the process.
Signed-off-by: quobix <dave@quobix.com>
Before everything worked, but was completely accurate, now everything works and everything is absolute and can be resolved. Phew, what a mission!
Signed-off-by: quobix <dave@quobix.com>