Commit Graph

63 Commits

Author SHA1 Message Date
Marcel Boehm
3d92fc0b1a Fix RenderAndReload error handling 2024-05-11 14:49:07 -04:00
quobix
b4b24a02f3 added assertion to test 2024-04-19 06:45:19 -04:00
quobix
3aed0d38aa Added test for #269 2024-04-19 06:45:19 -04:00
quobix
a20a09710b bumped coverage 2024-04-19 06:45:19 -04:00
quobix
1cc814411d addressed issue #264
Error was not being returned when rendering JSON
2024-04-19 06:45:19 -04:00
quobix
1a240cb967 Cleaned up document test
Signed-off-by: quobix <dave@quobix.com>
2024-02-13 07:33:55 -05:00
quobix
37975517e0 Added test to validate nested files work
Should catch any regressions made.

Signed-off-by: quobix <dave@quobix.com>
2024-02-13 07:33:55 -05:00
quobix
7afb1e9d11 Addressed #159
Cleaned up all interesting static checks. All that is left is cosmetics.

Signed-off-by: quobix <dave@quobix.com>
2024-02-06 22:13:41 -05:00
quobix
ce6b9b9470 Added windows support, all tests pass now. 2024-01-18 15:11:39 -05:00
quobix
bc040de300 fixed formatting
Signed-off-by: quobix <dave@quobix.com>
2023-12-18 16:11:59 -05:00
quobix
f67d666c4f Issue #214 cannot be re-created, added test to validate.
The correct values are be extracted in version `0.14`+

Signed-off-by: quobix <dave@quobix.com>
2023-12-18 16:11:59 -05:00
quobix
0b7f809ac6 Added in high level schema type ref #215
Missed capturing the high level schema. Added test to document to capture use case permanently.

Signed-off-by: quobix <dave@quobix.com>
2023-12-18 16:11:59 -05:00
Tristan Cartledge
2b128cb465 fix: data race 2023-12-04 18:08:02 +00:00
Tristan Cartledge
2ff7c59585 tests: add failing test case for recursive callback reference 2023-12-04 10:15:31 +00:00
Tristan Cartledge
69ba5b875a feat: add ordered json 2023-12-03 22:28:15 +00:00
Tristan Cartledge
a1bc5275ac Merge branch 'main' into ordered-libopenapi 2023-12-03 21:09:28 +00: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
Tristan Cartledge
00e1544abd Merge branch 'main' into ordered-libopenapi 2023-12-01 17:57:05 +00:00
Tristan Cartledge
a4ad09aab3 fix: continued moving everything to orderedmaps plus cleaned up most the tests 2023-12-01 17:37:07 +00: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
Tristan Cartledge
2de65e4ca0 Merge branch 'main' into Baliedge/PIP-2552-consistent-ordering 2023-11-27 12:06:39 +00:00
quobix
ab4af83649 added mix ref origin test
Signed-off-by: quobix <dave@quobix.com>
2023-11-25 10:10:51 -05:00
quobix
33fc552c65 Another round of coverage
will it go green? will it stay red? who knows…

Signed-off-by: quobix <dave@quobix.com>
2023-11-01 11:50:23 -04:00
quobix
5d717bdefe Changed document signatures to use error instead of []error
Also removed old swagger `CreateDocument` method that has been deprecated.

Signed-off-by: quobix <dave@quobix.com>
2023-10-24 12:31:47 -04:00
quobix
d30ac24db9 All tests pass! logs of tests fixed and tuning API for high level
Document configuration has been simplified, no more need for AllowRemote stuff in the document configuration, it’s assumed by setting the baseURL or the basePath.

Signed-off-by: quobix <dave@quobix.com>
2023-10-24 10:24:19 -04:00
quobix
8b795c6321 working through rolodex design and using it externally via vacuum
this is some complex and messy work.

Signed-off-by: quobix <dave@quobix.com>
2023-10-15 12:34:54 -04:00
Shawn Poulson
b6c05f5af0 More unit tests. 2023-09-25 09:01:53 -04:00
Shawn Poulson
94adb8c064 Fix omitempty handling on components. 2023-09-25 08:59:51 -04:00
Shawn Poulson
f389fedadd Monster refactor of map to orderedmap.Map data type. 2023-09-25 08:59:42 -04:00
Shawn Poulson
652e818456 Refactor Paths to OrderedMap. 2023-09-22 17:51:21 -04:00
quobix
f0a968bce4 Added polymorphic/array ignore to document config.
Now a document can be pre-configured to ignore polymorphic circular references, and array references.

Signed-off-by: quobix <dave@quobix.com>
2023-09-21 06:01:23 -04:00
quobix
43bf162e0c Added new Render method to top level document.
Like `RenderAndReload` this method will render / print out the document, however it won’t read it back in and reload the model from the ground up. This is a non-destructive method that does not reload the model from the rendered document.

If you don’t use the low model or you don’t care that the high level model and low-level models are out of sync? No problem. Otherwise keep this in mind that the low level model will only represent the original un-mutated document, as will the index.

Signed-off-by: quobix <dave@quobix.com>
2023-09-14 07:30:03 -04:00
Dave Shanley
3a238df141 Fixed broken test
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-07-22 14:09:33 -04:00
Dave Shanley
5cb4939522 updated test coverage
Signed-off-by: Dave Shanley <dave@quobix.com>
2023-07-22 14:09:33 -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
e1f0f69650 Original indention and text delimiter style retained when rendering #106
Now the original indention is captured and string delimiters are retained when rendering out documents.

Signed-off-by: Dave Shanley <dave@quobix.com>

# fixes 106
2023-06-17 14:12:27 -04:00
Dave Shanley
5b128c098a Added support for original format rendering #105
Original input document types are now rendered automatically as JSON or YAML (vs always being YAML). This only operates at the `Document` level for rendering out entire documents.

Requested in #105

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-06-17 14:12:27 -04:00
Dave Shanley
24d094ca7b Corrected remote document lookup behavior
When remote documents are requested and there is no way to know the base URL, the index will now try and determine the base path from the way the spec was loaded (if it comes in remote, we use the base URL of the spec)
2023-04-22 09:50:44 -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
bc5a020c7a Hardening is uncovering a few rough edges.
Some missing bits here and there are being picked up by the diff engine in tests. Working through each rough edge, one at a time.
2023-03-26 06:10:31 -04:00
Dave Shanley
cd3011655c Coverage bumped again
however, more hardening is required, Asana is getting upset with changes found when rendering, so that's up next. Then, we will need to harden against few others.
2023-03-26 06:10:31 -04:00
Dave Shanley
cecee1ca73 Working through coverage
Fixing whack a mole issues as code is fully tested.
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
441068174c Working through mutation designs.
trying out some sketches to get the APIs correct.
2023-03-26 06:10:31 -04:00
Dave Shanley
e6626fe22e Support for relative links now in place #73
Tests all passing, runs super fast, pulls in every single DigitalOcean spec and parses it. There may be some issues deeper down in the models, but for now high level tests all pass.
2023-02-22 09:14:27 -05:00
Dave Shanley
1df5f44e6f Working through fix-73 and v0.6.0 2023-02-22 09:14:27 -05:00
Dmitry
cc5b7e73d9 Fix ref object parsing 2023-01-12 17:36:38 -05:00
Benjamin Nolan (TwoWholeWorms)
5f9541283a fix: Update tests where appropriate 2023-01-11 05:47:06 -05:00
Dave Shanley
df8cf6b870 Added another test to help with reference location.
Added another variation for pulling out references.
2022-12-12 07:55:33 -05:00