-
Notifications
You must be signed in to change notification settings - Fork 50
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
Pydantic v2 support for MSONable types #548
Conversation
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## master #548 +/- ##
==========================================
- Coverage 76.57% 76.53% -0.04%
==========================================
Files 27 27
Lines 1524 1547 +23
Branches 320 322 +2
==========================================
+ Hits 1167 1184 +17
- Misses 297 303 +6
Partials 60 60
☔ View full report in Codecov by Sentry. |
for more information, see https://pre-commit.ci
Merged. The codecov is just meant to check if something really has no tests. Here we are well covered. |
Great, thanks! Would you mind minting a new release whenever you get a moment? |
Already done. |
Beautiful! |
Summary
This PR adds support for pydantic >= 2.0 with the addition of custom class validation methods to
MSONable
:__get_pydantic_json_schema__
to define pydantic field JSON schema__get_pydantic_core_schema__
to define pydantic field core schemaThe same validation function is used for both versions.