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.
Model for v2 and v3 has been validated, now to build out a simple high level creation API, as well as port in 3.1 models (I think there are two). and this is ready for heavier testing.
There is a lot of overlap on these models, to create a much more sensible design, a new 'base' package has been added which contains shared models that both versions make use of.
there is a reasonable amount of shared structure, so a 'shared' package for high and low models is being introduced to prevent duplication and circular imports
working with k8s, stripe, petstore and locals. Speed is as good as I can make it at this point, not without further performance tunupes for memory consumption. less copying everywhere.
Same functions will power every other model. Found some opprotunities to add control over circular references, when and how to fire errors and what not. All in all, some robust code additions will improve the library significantly.
Schemas are now rendered on demand. There is no reasonable way to navigate the mayhem that is circular dependencies through multiple inheritance and polymorphism. So now using a msuch simpler design (and MUCH faster), there is a `SchemaProxy` for every schema reference. This holds a reference to the low model and index, that renders the schema on demand. Once rendered, it's done. Any children can also be rendered on demand, and so down the rabbit hole you do (if you want).
All circular dependencies are know by the index, so you can decide when you want to stop, or just keep going for ever, however it's now a choice, not something decided for you.
Signed-off-by: Dave Shanley <dave@quobix.com>
Using some designs unearthed from building the higher level model, I have brough that design down to the lower level to speed things up. It only took 8 years, but finally, I think I have mastered mult-threading. No more deadlocks, and no more need for waitgroups for everything.
this should actually be the full model, the whole graph is in - now to optimize full model and check for circular deps.
then, it's time to move back in history and rebuild the swagger model.