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
A single line that tries to read an HTTP response body and fails is very hard to test without mocking, and the mock does not add value to a single line of code to check for an error that can rarely ever be triggered. Going to settle for 99.9% for now.
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.
Building out models that have circular references is tricky. Particularly when they are polymorphic ones. The resolver now searches the polymorphic references for circular references as well (which is returning much more valuable results now). The low level model is now sensitive to this and will avoid building out anything that is circular.
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.