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>
All known gaps (well known in my own head) seem to have been closed now, the final TODO in this area has been cleaned up, highlighted by an issue reported by speakeasy.
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>
version can be extracted from anywhere in the model. Added logic for extracting the correct
version for exlusiveMaximum and exlusiveMinimum
Signed-off-by: quobix <dave@quobix.com>
And added deeper support for Aliases. Also added in local file handling through renamed `FSHandler` configuration property for the index.
Also re-ran `go fmt`
Signed-off-by: Dave Shanley <dave@quobix.com>
some ref handling was a bit strange, now it's rendering correctly. I have a feeling we will be back to the diff engine at some point soon, it's picking up some strange changes that are so deep in the model, I can't determine what is what, so we will wait for another set of triggers to appear.
This partially resolves a whacky path ref lookup in the index mentioned in #84, but it's not a full fix, that requires the build out of a resolved spec. The design needs thought and care.
The more in-depth we use extensions, the more likely is is that we need custom extensions. New `UnpackExtensions` function in the high package makes this easy. Low level models have been updated to support feature fully and docs added in README and examples as well.
Signed-off-by: Dave Shanley <dave@quobix.com>
prefixItems is a property of JSONSchema and supported by OpenAPI 3.1, this update adds support for `prefixItems` in low and high models. It's essentially a copy of the `items` property, but allows seperate configuration of both, without combining them and muddling things for clarity.
Signed-off-by: Dave Shanley <dave@quobix.com>
This is a large update, I realized that extensions are not being hashed correctly, and because I have the same code everywhere, it means running back through the stack and cleaning up the invalid code that will break if multiple extensions are used in different positions in the raw spec.
At the same time, I realized that the v2 model has the same primitive/enum issues that are part cleaned up in v3. This is a breaking changhe because enums are now []any and not []string, as well as primitives for bool, int etc are all pointers now instead of the copied values.
This will break any consumers.