Commit Graph

47 Commits

Author SHA1 Message Date
Tristan Cartledge
a4ad09aab3 fix: continued moving everything to orderedmaps plus cleaned up most the tests 2023-12-01 17:37:07 +00:00
Tristan Cartledge
785824a271 fix: fixed tests after merge 2023-11-27 17:05:37 +00:00
Tristan Cartledge
2de65e4ca0 Merge branch 'main' into Baliedge/PIP-2552-consistent-ordering 2023-11-27 12:06:39 +00:00
quobix
745142d9e0 Fixed logic and test failure
Signed-off-by: quobix <dave@quobix.com>
2023-11-17 16:44:01 -05:00
quobix
af5cb775aa Stop the remote FS from looking up local files
added [empty] to represent literally empty refs

Signed-off-by: quobix <dave@quobix.com>
2023-11-17 16:44:01 -05: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
a8a0e1d47f added context to schema buildout
model was failing on subschemas with refs, needed context

Signed-off-by: quobix <dave@quobix.com>
2023-11-02 10:47:31 -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
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
70eda75790 Schema now has access to index, which has access to spec info.
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>
2023-10-08 12:27:52 -04:00
Tristan Cartledge
8531113e17 fix!: fixed handling of additionalProperties to handle the bool/json-schema nature better 2023-10-05 09:31:16 -04:00
Shawn Poulson
f389fedadd Monster refactor of map to orderedmap.Map data type. 2023-09-25 08:59:42 -04:00
Tristan Cartledge
58433a6ffc fix: add missing const value to schema 2023-09-13 06:13:09 -04:00
Dmitry
55da120b19 Add dummy parameter to conform to Buildable 2023-08-25 09:51:57 -04:00
Dave Shanley
25d8de9b0e Added more support for YAML merge nodes, anchors and aliases
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>
2023-07-16 11:45:18 -04:00
Dave Shanley
c3cf5f1e38 Added support for unevaluatedProperties as Schema and bool #118
Also ran `gofmt` across the entire project. Things need cleaning up.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-06-17 14:12:27 -04:00
Derrick J. Wippler
a09916eb67 fix: Schema.Minimum and Schema.Maxmium are now float64 2023-06-17 13:12:50 -04:00
Dave Shanley
26e694a5e9 Updated embedded OAS schemas and fixed UniqueValues
UniqueValues was marked as an integer, not a boolean.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-04-30 09:01:15 -04:00
Tristan Cartledge
99bf12c1c7 feat: add attribute to schema model 2023-04-18 05:22:49 -04:00
Dave Shanley
04eac2abe7 More hardening with digitla ocean
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.
2023-03-26 06:10:31 -04:00
Dave Shanley
0e8ae7c548 rendering complex additionalProperties in place.
slices of maps were not rendered properly. Now corrected, coverage continues to rise, refactoring node generation into utils package.
2023-03-26 06:10:31 -04:00
Dave Shanley
0b8fab869e working through code coverage 2023-03-26 06:10:31 -04:00
Dave Shanley
3101a7c9b7 Large update to support v3 rendering. 2023-03-26 06:10:31 -04:00
Dave Shanley
38064123ed Working through complex rendering edgecases. 2023-03-26 06:10:31 -04:00
Dave Shanley
bf4e94bcbd fix: swapped line/col for issue #86
Swapped line and col in error.
2023-02-27 11:05:18 -05:00
Dave Shanley
d8a7b6c21d Ensure encoded paths are handled in lookup. #84
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.
2023-02-22 09:14:27 -05:00
Dmitry
cc5b7e73d9 Fix ref object parsing 2023-01-12 17:36:38 -05:00
Tristan Cartledge
52f9868d96 fix: fix handling of ordered arrays when processing them async 2023-01-10 17:39:03 -05:00
Dave Shanley
3fd088b217 Increased coverage for model back to 100% 2022-12-09 07:06:34 -05:00
Dave Shanley
b3f0a0b1ae Working on model changes to resolve #38 and #28 **breaking change**
Also adding in other properties to schema that are missing. Test coverage still needs improving and this is a breaking change to low and high models.
2022-12-09 07:06:34 -05:00
Dave Shanley
d51d2fcd27 Added contains, minContains and maxContains to schema #28
Added support for missing 3.1 schema properties, however it does not cover the `boolean` case
2022-12-09 07:06:34 -05:00
Dave Shanley
cbfb051a92 (feat): Schema now has pointer back to SchemaProxy #29
The 'owning' `SchemaProxy` is now trackable back from a `Schema` part of the conversations happening on #29
2022-12-05 12:18:10 -05:00
Dave Shanley
c08dd591b2 (feat): Unpack extensions into complex function types #8
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>
2022-12-02 11:15:44 -05:00
Dave Shanley
c4b6e68197 Added prefixItems support to Schema. Fixes #2
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>
2022-11-21 09:44:51 -05:00
Dave Shanley
26d3535e75 Working through what-changed fixes and tuneups.
more testing is required, however things feel quite reasonable and rounded. All changes correctly detected in a spec so far.
2022-11-20 14:30:50 -05:00
Dave Shanley
9d8d6e36ea what-changed operational
the code is working, the tests are passing. There is a lot more to check, but it's a good time to bring the feature into main.
2022-11-18 11:00:34 -05:00
Dave Shanley
61f99b8fd6 Replacing extensions hash code **breaking change**
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.
2022-11-18 11:00:34 -05:00
Dave Shanley
7ffc294e97 Tuned low level schema hash function.
Wasn't quite right, now it's looking much more right!

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-18 11:00:34 -05:00
Dave Shanley
5bd0d8de50 Bumping coverage on low level models after new feature.
Fixed borked test
2022-11-18 11:00:34 -05:00
Dave Shanley
54d924d46d Enums in Schema are now interface{} types in datamodel #1
Addressing issues #1, Enums can be anything and should not be consideded plain strings.
2022-10-27 06:51:37 -04:00
Dave Shanley
fada7e5b09 Schema example checking is now in place.
Added generic hasing function for anything untyped.
2022-10-11 07:12:08 -04:00
Dave Shanley
61beb3ea2a Schema what-changed almost complete.
Perhaps the biggest and most complex of all the models to determine what has changed.
2022-10-10 12:19:57 -04:00
Dave Shanley
4b9c5fba1e Building out schema comparison mechanism
Which has led to a new wider hashing capability for the low level API. hashing makes it very easy to determine changes quickly, without having to run comparisons to discover changes, could really speed things up moving forward.
2022-10-08 14:09:46 -04:00
Dave Shanley
be71a5e775 V2 low-base docs in place
refactored constants a little also to clean things up.
2022-09-20 10:08:31 -04:00
Dave Shanley
849074d0bc High-level base documentation is complete.
Examples and every model completed, 1/6th of the way through models.
2022-09-15 11:13:54 -04:00
Dave Shanley
19269af7d7 Added support for 3.1 updates to schema 2022-09-14 11:16:16 -04:00
Dave Shanley
68743113ed Refactoring core structure of datamodel to accomodate v2 model.
There is a lot of overlap on these models, to create a much more sensible design, a new 'base' package has been added which contains shared models that both versions make use of.
2022-09-01 08:53:16 -04:00