-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace jsonschema with pydantic #65
Comments
I don't disagree here, but we should be cautious merging, as it will essentially be a breaking change due to changing the external requirements of the lib :) I'm interested to see the diff in the code though. |
Agreed. Given that @PietroPasotti is working on v1 of the libs (#63), which essentially will be incompatible regardless, it feels like it could be a good time to do both these changes at the same time to not have break the compatibility twice. :) |
I like the idea! I was thinking to combine this with #38 I'm thinking about the last line you added; what do you reckon would the user story look like?
|
I'm thinking we'd use the datamodel-code-generator, probably as part of the CI of the relation interfaces repo itself, and that users then would be able to download the pydantic model straight from github and use it in their projects. |
We are already using pydantic. |
The traefik libraries would be excellent candidates for trying out replacing jsonschema with pydantic. According to lessons learned by the charmcraft team, pydantic plays a lot nicer with more complex data structures, is faster in the general use case and has better error logging.
In addition to the swap, it would be excellent if we generated the pydantic model from the json schemas of the interface spec.
The text was updated successfully, but these errors were encountered: