153 Commits

Author SHA1 Message Date
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
5189eadddc Large refactor and addedGetAllChanges to each change
tons of updates, so many things.
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
Dave Shanley
38064123ed Working through complex rendering edgecases. 2023-03-26 06:10:31 -04:00
Tristan Cartledge
9d5a5d03be fix: add missing summary for OpenAPI 3.X docs 2023-03-17 14:59:24 -04:00
Dave Shanley
f269259fcf fix: handle example comparison correctly. #61
examples can be anything, most commonly maps. previously `libopenapi` did not check maps correctly. Now it does. It was also creating a panic by inserting a nil pointer as the value to a map key. This has also been fixed.

Examples are the only element that use this pattern for comparison.
2023-01-05 17:05:36 -05:00
Hugo Stijns
1e1ec6694a Fix left right comparison 2022-12-30 10:26:57 -05:00
Hugo Stijns
b395518a5e Change indentation to tabs 2022-12-30 10:26:57 -05:00
Hugo Stijns
d6031b5440 Fix compare different node tag 2022-12-30 10:24:58 -05:00
Hugo Stijns
fc7da1d38d Change identation to tabs 2022-12-30 10:24:58 -05:00
Dave Shanley
5259ab1510 Updated some json mappings for what-changed reports.
As far as I know, no-one is using this stuff yet, so this should have no impact, non-breaking and no-need for a release yet.
2022-12-11 10:58:28 -05:00
Dave Shanley
646b7ab01b Added high level overview report for for what-changed
Used by `openapi-changes` to provide a high level terminal output.
2022-12-09 14:45:38 -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
cddd3b3e93 bumped test coverage back up a little for what-changed
Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-30 10:26:26 -05:00
Dave Shanley
7a159bb467 fix: Fixed inaccurate property checks on schemas for what-changed
Schema properties were not being correctly checked, as validated when using the models to render a UI.
2022-11-29 09:35:17 -05:00
Dave Shanley
d6ca1802f6 Fixed small glitch in what-changed for checking nil values.
gofmt does not operate the same across mac and windows, this is wht the whole file got shuffled. odd.
2022-11-27 12:50:20 -05:00
Dave Shanley
0e0b99225d Moved what-changed PropertyChanges to a pointer in all models.
No breaking changes, gofmt seems to have gone a little nuts for some reason, but this is an internal change that moves everything to a pointer, for better reflection use down the chain.
2022-11-23 12:57:10 -05:00
Dave Shanley
726134f00e Fixed some glitches with changes on examples in what-changed
Running some stress tests triggered some failures, still needs coverage but is operational and accurate.
2022-11-22 17:12:06 -05:00
Dave Shanley
cd7f24f65e Added what-changed docs to readme
and some examples for go-docs

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-21 11:25:59 -05:00
Dave Shanley
62d580e671 Added what-changed documentation to methods and structs.
Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-21 10:44:04 -05:00
Dave Shanley
3ad8ec3d43 Clearing up some dead code and adding docs to what-changed
Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-21 09:57:21 -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
2ee3123bfe Fixed rendering bug with .Schema() being called again.
Should have known better, almost there with accuracy now.

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-20 18:11:38 -05:00
Dave Shanley
ddf772270e What-changed is ready
Needs documenting, but the feature is ready for an application to really stress test the model and logic.

Guess what's next :) (after docs)

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-11-20 14:30:50 -05:00
Dave Shanley
6c3cc97b04 swagger what-changed support climbing.
working through more rough edges, making some choices.
2022-11-20 14:30:50 -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
97a03315d6 Smashing bugs in models by validating changes.
Who would have thought the what-changed tool would be the key to ensuring accuracy on the models.
2022-11-20 14:30:50 -05:00
Dave Shanley
22ca3ced63 discovered a bug in content changes
Switching machines, I can’t use this laptop for any real work.

Signed-off-by: Dave Shanley <dshanley@splunk.com>
2022-11-20 14:30:50 -05:00
Dave Shanley
ecb7603a32 Wired up callbacks to what-changed for operations.
It was a todo that I needed to loop back on. now operational

Signed-off-by: Dave Shanley <dshanley@splunk.com>
2022-11-19 09:34:18 -05:00
Dave Shanley
a8a8b482d8 Hardening model whilst testing what-changed feature.
Checking and sampling, and fixing bugs while working through testing.

Signed-off-by: Dave Shanley <dshanley@splunk.com>
2022-11-18 14:11:19 -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
b510be3563 what-changed code in place.
Let the explosions begin!
2022-11-18 11:00:34 -05:00
Dave Shanley
a85445019d what-changed v3 document testing and fixes.
sending bolts of electricity through the entire stack is throwing errors here and there, simple null values that need checking, some forgotten has functions and what not. shaking out as many bad splices as possible as we reach for the summit.
2022-11-18 11:00:34 -05:00
Dave Shanley
6382819dd0 Working through swagger documen what-changed.
Working through every element, testing as we go, fxing bugs along the way.
2022-11-18 11:00:34 -05:00
Dave Shanley
59bf83c446 Supercharged test coverage back up to 99.9%
I can't test that one line in the index, so this will do.

Now to complete the document for what's changed.
2022-11-18 11:00:34 -05:00
Dave Shanley
12594fdf1c Components what-changed completed.
Now to move on to the document and finally some perform stress testing.

AND THEN! we're done with this MF. Jesus H Christ, what a mission.
2022-11-18 11:00:34 -05:00
Dave Shanley
f66c77ccb5 Working through components what-changed code.
Moved comparison function for map checking to be async, removed the untyped variation as it's no longer required. Getting prepared for tests
2022-11-18 11:00:34 -05:00
Dave Shanley
1abc25a923 Added component checking for swagger models.
components support now caters to v2, v3 coming shortly - but now it's time for a walk. this shit is exhausting my brain.
2022-11-18 11:00:34 -05:00
Dave Shanley
6694ad54d2 Upgraded comparison funcrtion for maps.
It's  now more intelligent and runs async in threads, also added a variation of the map check function to cope with untyped comparison functions.
2022-11-18 11:00:34 -05:00
Dave Shanley
49ba7bb8b7 Added callback object to what-changed
Cleaned up more covage in v3 model, we're almost there. My god what a mission this has been.
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
aa62232440 v3 Links, callbacks operations low level models at 100% coverage 2022-11-18 11:00:34 -05:00
Dave Shanley
4f3b10bbbf Cleaned up model interfaces for parameters
overlapping getters created a mess, the mess is now clean.
2022-11-18 11:00:34 -05:00
Dave Shanley
ce82d42ce3 Bumped coverage on headers and items in v2 package.
Starting to clean up the cross interface mess that I created when building what's changed for these pain in the ass objects that vary so much between  versions. We don't need super shared interfaces with all the properties populated for this to be useful.
2022-11-18 11:00:34 -05:00
Dave Shanley
a522ec0f91 Paths added to what-changed feature
bubbled right up to the top and all the hard bits are done! components/defs are up next, however before that - we have to clean up some of the test coverage carnage appearing in our model after so much feature work.
2022-11-18 11:00:34 -05:00
Dave Shanley
55291d42c0 Fixed up what-changed tests after model fix.
Now all tests are building the model correctly and everything is passing again, confidence up much higher now.
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
131513a6f6 Path items added to what changed
Path items now diffable! woo!
2022-11-18 11:00:34 -05:00