Commit Graph

37 Commits

Author SHA1 Message Date
quobix
c9155f7ef3 Updated docs for NewDocument
fixed issue #297
2024-07-08 10:24:40 -04:00
quobix
338eaa3dac Fixed spec format setting for 3.1 in SpecInfo 2024-05-17 17:19:46 -04:00
Marcel Boehm
3d92fc0b1a Fix RenderAndReload error handling 2024-05-11 14:49:07 -04:00
quobix
8d4b638a59 removed unreachable code 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
2bc6e9f028 Added ‘bundler’ module
resolves a v3 document or a model into a single document.

Signed-off-by: quobix <dave@quobix.com>
2024-01-18 15:11:39 -05:00
quobix
54450edf6c Adding convenience methods and glitch fixes for 0.13
Testing inside vacuum is throwing up a couple of small glicthes that need adding/tuning

Signed-off-by: quobix <dave@quobix.com>
2023-11-04 16:22:48 -04:00
quobix
ce4a60baa8 cleaning up the last few stragglers
Signed-off-by: quobix <dave@quobix.com>
2023-11-01 15:15:46 -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
quobix
511843e4df Major surgery on the index and resolver. A complete flip in design.
Signed-off-by: quobix <dave@quobix.com>
2023-10-14 12:36:38 -04:00
quobix
bfbff2c2e2 Removed branch to check for errors
it’s impossible to test, for my ability anyway.

Signed-off-by: quobix <dave@quobix.com>
2023-09-14 07:30:03 -04:00
quobix
eb4b6e93dd Tuned logic on render only code for document.
I could not build a test to ensure any error returned from creating a new doc after rendering was caught. There is no way to test the code, so I changed the logic to capture all errors and cascade down. Same outcome, simplified flow.

Signed-off-by: quobix <dave@quobix.com>
2023-09-14 07:30:03 -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
50c1d80563 Added general linting support for non openapi files.
This allows vacuum to operate outside of the OpenAPI world. Exciting!

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-07-22 14:09:33 -04:00
Dave Shanley
20ac2fb25a Adding more test coverage
Fixing some outdated code as well.

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

Cleaning up more coverage issues

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

More test coverage updates.

Signed-off-by: Dave Shanley <dave@quobix.com>
2023-06-17 14:12:27 -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
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
441068174c Working through mutation designs.
trying out some sketches to get the APIs correct.
2023-03-26 06:10:31 -04:00
Dmitry
9004d57197 Improve documentation and make code match what doc says 2023-03-16 06:03:54 -04:00
Dave Shanley
def670dbba Adressed comments from @n0rig on #83
Fixed digital ocean test fix, bumped comments up a little
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
Dave Shanley
2d536c884d A few tiny non breaking changes.
just cleaning things up, preparing for online demo push for https://pb33f.io
2023-02-11 09:16:17 -05:00
Dave Shanley
6d77716c9a feat: add index for getting all "schema" objects #50
There is new code that looks for inline `schema` definitions and collects them, as well as a futher subset of references that are specifically `object` or `array` types. This is a breaking change because the `index.GetAllSchemas()` method now returns a slice of *Reference pointers, rather than a map of them. The original behavior of `GetAllSchemas()` has been replaced with `GetAllComponentSchemas()` which retains the signature.

Two new additional methods `GetAllInlineSchemas()` and `GetAllInlineSchemaObjects()`. The former will return everything in the spec marked with `schema` that is not a reference. The latter will return everything the former does, except filtered down by `object` or `array` types.

Also the index is now bubbled up through the document model. There isn't a simple way to get access to it, small non breaking change that attaches a reference to the index, returned by `DocumentModel`
2023-01-28 14:09:11 -05:00
Dave Shanley
f8ae5759d0 Couple of small fixes for what-changed.
No breaking changes, errors and model are returned now (allows errors and model through). And a small fix to the paths hashing mechanism to ensure identical paths with different names are checked.
2023-01-18 07:02:51 -05:00
Dave Shanley
ece888d201 Tests were hanging, stopped JSON parsing channel use altogether
vacuum will need looking at for this later version.
2022-12-13 14:12:45 -05:00
Dave Shanley
724fdb31c4 (fix): A memory leak was detected and fixed #46
The issue lay with the `ExtractSpecInfo()` method from within the `datamodel` module. There is a round of parsing that happens in another thread inside there, and a notification is pumped down a channel once done. The pronlem is that nothing was listening on that channel, so everything in those threads just kept piling up with the garbage collector unable to free any of it.
2022-12-13 14:12:45 -05:00
Wouter Dullaert
4fcf45b813 Bubble up circular reference errors 2022-12-07 08:10:08 -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
3d5ecf0efb Refactored version directory names
3.0 and 2.0 do not work, there are multiple versions and anything with a period in it sucks from my point of view, v2 and v3 feel much better from a DX perspective.
2022-09-16 08:33:39 -04:00
Dave Shanley
fef5822e15 Adding docs and examples to code. 2022-09-13 10:47:43 -04:00
Dave Shanley
a2b7119af7 Added mutate command to low level API
This simple method gives the low API a super powerful and simple way to mutate the value of any node, which is then reflected in the root node, can than be serialized again and, voila! now our spec is editable.
2022-09-13 09:15:55 -04:00
Dave Shanley
647541cc77 Added in high document API
filling out documentation, looking at DX and how to consume things, re-shuffling and cleaning house.
2022-09-13 08:39:38 -04:00
Dave Shanley
2c4177e97a Swagger 2.0 high level model going in now
Shifting a few high level models around that are also shared. now it's just a churn game to flesh the high level model and test it up.
2022-09-09 07:08:52 -04:00