Commit Graph

21 Commits

Author SHA1 Message Date
Tristan Cartledge
99bf12c1c7 feat: add attribute to schema model 2023-04-18 05:22:49 -04:00
Dave Shanley
5189eadddc Large refactor and addedGetAllChanges to each change
tons of updates, so many things.
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
5d7f22fca7 first level testing for rending v3 model in place.
Now onto some hardening tests, lets re-render each spec after reading to check for failures.
2023-03-26 06:10:31 -04:00
Benjamin Nolan (TwoWholeWorms)
5f9541283a fix: Update tests where appropriate 2023-01-11 05:47:06 -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
1f18491506 (fix): Fixed primitive decoding for default on schemas #15
@danielgtaylor reported a bug with schema's not picking up primitive values for defaults. This glitch was caused by the `model_builder` only wanting to deal with objects and ignoring primitives (it was checking for a map). This check has been removed, and all defaults should now be picked up (object or not).

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-30 08:39:22 -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
e1e91d0682 Bumping coverage
checking all the corners for cobwebs
2022-11-20 14:30:50 -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
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
5e86e7094f low level base model back at 100% coverage
A few little gaps opened up with new code, all tucked back in.
2022-11-18 11:00:34 -05:00
Dave Shanley
a184c5e909 Fixed a low level bug with locating nodes.
locating nodes was looking through two levels to locate something. This is not the correct behavior, after making the change - lots of tests needed to be updated to be correct in what they put into as a the root node.
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
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
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