Schema generators#9
Open
RoboDoig wants to merge 6 commits into
Open
Conversation
Contributor
Author
|
After talking with @NeuroThom about this, I don't think this approach really works. In the end the issue is that you run sgen on the |
Contributor
Author
|
Potential solution here bonsai-rx/sgen#108 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR I add an example generator script for compiling pydantic schemas to json,
json_schema.pyallows for pooling relevant pydantic schemas and dumping to a combined json file.It's useful to have a single point of entry for dumping json, but I also realised while working on the acqusition package that we often want to reference data types outside of
data_types.json, e.g. when making operators for visual display it's useful to be able to reference e.g.DisplayCalibration. Initially I dumped each pydantic file into a separate json so that the acqusition package modules can pick and choose which data types they generate, but this results in overlap between partial classes, e.g. if you sgen both data_types and displays you'll get overlap with Vector3 as they both reference them. My solution here is just to dump all relevant schemas into a single, master json file.