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>
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>