Commit Graph

57 Commits

Author SHA1 Message Date
Emilien Puget
cbe1201cbd removed golang x package in favour of the std lib 2024-07-08 10:13:23 -04:00
quobix
ac4b6ecd31 Rresolved issue https://github.com/daveshanley/vacuum/issues/481
Ignore array values defined as ‘$ref’ they are invalid to lookup.
2024-04-21 09:10:53 -04:00
quobix
5649e798f0 resolved issue #259 2024-04-19 06:45:19 -04:00
quobix
fcc5355a9b Addressed issue #269
Regression undone
2024-04-19 06:45:19 -04:00
quobix
40b16b3f76 Resolves issue https://github.com/pb33f/libopenapi/issues/256
The depth was being artificially inflated with highly complex recursive designs, this fixes the depth counter permanently.

Signed-off-by: quobix <dave@quobix.com>
2024-02-21 08:27:39 -05:00
quobix
7119b51336 Cleaned up coverage
Signed-off-by: quobix <dave@quobix.com>
2024-02-20 13:34:39 -05:00
quobix
79d49faf70 Addressed https://github.com/daveshanley/vacuum/issues/459
Signed-off-by: quobix <dave@quobix.com>
2024-02-20 13:34:39 -05:00
quobix
603865df9f removed panic
Signed-off-by: quobix <dave@quobix.com>
2024-02-20 13:34:39 -05:00
quobix
2f82a69d6c A clean sweep around resolving during model builds.
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>
2024-02-20 13:34:39 -05:00
quobix
0eea21b150 added parent node to model for references.
Signed-off-by: quobix <dave@quobix.com>
2024-02-08 10:39:02 -05:00
quobix
c55527066a Addressed invalid polymorphic circular reference issue.
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>
2024-01-30 16:44:06 -08:00
Ilja Lapkovskis
b01b967433 Fix issue with non-working IgnorePoly flag. 2024-01-26 06:20:29 -05:00
quobix
e0f0f387bd resolved build issues
Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
2448d43902 added length check to solve #217
Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
43860f4e3c Added some new getters to the index
Also added map conversion utilities based on reported vacuum error https://github.com/daveshanley/vacuum/issues/417
also prevented the bundler from inlining root references.

Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
55a2065f8d bump coverage
removed dead code after abs path change on lookup

Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
7026e83f7c adding in path overlap feature
discovered glitch when reworking test for pipeline

Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
e699968768 Working through windows support 2024-01-18 15:11:39 -05:00
quobix
f4647af7b4 Added switch to resolver for preventing duplication.
vacuum runs things multiple times. which is causing skew on references.

Signed-off-by: quobix <dave@quobix.com>
2024-01-13 10:21:21 -05:00
quobix
9467282849 Added edge case to circular detection.
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>
2024-01-04 17:08:08 -05:00
Tristan Cartledge
8b6a5ef486 fix: increase resolver max depth 2023-12-06 08:35:55 +00:00
quobix
1b079afad9 removed dead code.
Signed-off-by: quobix <dave@quobix.com>
2023-12-04 16:13:13 -05:00
quobix
909646cff1 removed debug code.
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>
2023-12-04 16:13:13 -05:00
quobix
bb41dd41a3 Fix resolver from getting muddled up with deeply recursive resolving
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>
2023-12-04 16:13:13 -05:00
quobix
7a5a4bcb2d Tuned circular reference handling
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>
2023-12-03 15:54:20 -05:00
quobix
1e9b42a1ce catching circular references that spin out of control
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>
2023-12-03 11:06:43 -05:00
quobix
afe5c1213b Added a safety check to resolver
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>
2023-12-03 09:23:18 -05:00
quobix
190330ca9b Added in fix for stackoverflow issue
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>
2023-11-30 12:59:59 -05:00
quobix
f8154c5db2 added logic to handle variations of reference lookup for resolver
Signed-off-by: quobix <dave@quobix.com>
2023-11-30 07:20:19 -05:00
quobix
e624efbf84 addressed issue #195
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>
2023-11-08 12:36:08 -05:00
quobix
242d41cd0d Fixed loopup for branch, only ever extracting the fulldef path, not the fragment.
Signed-off-by: quobix <dave@quobix.com>
2023-11-07 11:29:24 -05:00
quobix
54450edf6c Adding convenience methods and glitch fixes for 0.13
Testing inside vacuum is throwing up a couple of small glicthes that need adding/tuning

Signed-off-by: quobix <dave@quobix.com>
2023-11-04 16:22:48 -04:00
quobix
265d462a10 Added back in logic required by vacuum.
And added test for it.

Signed-off-by: quobix <dave@quobix.com>
2023-11-04 12:36:47 -04:00
quobix
9b92a55536 Added in full resolving for specs is virtual filesystems
added last remaining coverage

Signed-off-by: quobix <dave@quobix.com>
2023-11-04 11:28:22 -04:00
quobix
7d8762fdd9 added more coverage and resolved param ref issue
Signed-off-by: quobix <dave@quobix.com>
2023-11-03 18:25:27 -04:00
quobix
fde5a9972d tuning ref lookups, finding some gaps.
coverage will drop no doubt

Signed-off-by: quobix <dave@quobix.com>
2023-11-03 14:06:37 -04:00
quobix
fa0b315756 Enabling deep array circular reference checking
Signed-off-by: quobix <dave@quobix.com>
2023-11-03 09:49:02 -04:00
quobix
713aeecdfa Tuning parameter exraction for circular ref handling
Lots and lots of variations. means lots of branches to check.

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 15:04:47 -04:00
quobix
8bbb022daa Addressed comments from review and fixed bug with schema props
props did not have context, therefore they had no idea where they were or where to resolve from.

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 10:28:29 -04:00
quobix
80b2b2d0b5 More cleaning and added docs.
We’re ready for review

Signed-off-by: quobix <dave@quobix.com>
2023-11-01 16:14:11 -04:00
quobix
ce4a60baa8 cleaning up the last few stragglers
Signed-off-by: quobix <dave@quobix.com>
2023-11-01 15:15:46 -04:00
quobix
ba8b5ac776 more coverage tuning
Signed-off-by: quobix <dave@quobix.com>
2023-10-30 15:50:33 -04:00
quobix
0cc66982f6 Adding more logic to resolver to handle mixed usecases
Signed-off-by: quobix <dave@quobix.com>
2023-10-30 15:02:00 -04:00
quobix
aca3ed66d7 Adding more use-cases for resolving remote docs
Signed-off-by: quobix <dave@quobix.com>
2023-10-30 10:43:51 -04:00
quobix
d8dfafd0a4 Working through test cases
There are still gaps to be found based on various combinations of crazy references.

Signed-off-by: quobix <dave@quobix.com>
2023-10-30 10:03:02 -04:00
quobix
a87d9236d8 bumping test coverage
more to go, more cleaning inbound also

Signed-off-by: quobix <dave@quobix.com>
2023-10-25 08:09:33 -04:00
quobix
8717b3cd33 An enormous amount of surgery on the low level model.
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>
2023-10-23 15:04:34 -04:00
quobix
28047d08d2 First sweep at cleaning up dead code
first round of a number I am sure, lots to clean.

Signed-off-by: quobix <dave@quobix.com>
2023-10-21 18:26:21 -04:00
quobix
be7e477529 index tests all pass! now time to clean.
Signed-off-by: quobix <dave@quobix.com>
2023-10-21 17:29:53 -04:00
quobix
bf270d3d2b whacking the shit out of exploded use-cases
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>
2023-10-21 14:14:49 -04:00