Commit Graph

34 Commits

Author SHA1 Message Date
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
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
Dave Shanley
0f774a4c4b Updated example code and readme to help explain encoding issues #34
Signed-off-by: Dave Shanley <dave@quobix.com>
2022-12-03 12:30:31 -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
52a5b61de2 (feat): Upgraded circular error handling experience #27
Thinking more about how to know what to resolve and what not to means depending on circular reference knowledge. So using an idea from @TristanSpeakEasy, the `*resolver.ResolvingError`  now contains a pointer to the original circular error, and it also implements the `Error` interface correctly which allows it simple passage up the chain, without losing fidelity.

Added new documentation example as well

Signed-off-by: Dave Shanley <dave@quobix.com>
2022-12-01 11:43:08 -05:00
Dave Shanley
e1dd606c69 (feat): Circular / resolving errors returned with document creation. #18
Tristan made a good point, part of the doc building process performs a resolving check and circular reference check, which is ignored by the returned errors. So resolving errors are now unpacked into standard errors and returned. Not sure why gofmt has shifted everything around however.
2022-11-29 13:51:05 -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
a036f0c039 Fixed document test
No release required, no changes
2022-11-07 08:13:16 -05:00
Dave Shanley
1c98ae170a fix: panic thrown when paths is wrapped in an array #4
When paths are wrapped in an array, the index throws an error because it's expecting them to be supplied as a map. Now paths can be wrapped or unwrapped, the index won't care.
2022-11-07 08:09:22 -05:00
Dave Shanley
fc68b488f0 Added new example and updated readme with mutation example.
We update and add as we go.
2022-09-19 09:51:57 -04:00
Dave Shanley
fef5822e15 Adding docs and examples to code. 2022-09-13 10:47:43 -04:00
Dave Shanley
aa4422fa74 Mutation method updated to return new copy
with value node (pointer) and value (non pointer) returned.
2022-09-13 09:32:08 -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