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>
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>
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>
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>
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
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>
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.
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`
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.
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.
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.
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.