-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat(pydantic): use pydantic serialization #2139
Conversation
antarest/utils.py
Outdated
services["cache"] = cache | ||
services["maintenance"] = maintenance_service | ||
return services | ||
def to_json(data: t.Any, indent: t.Optional[int] = None) -> bytes: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What would you think about moving this to a core.serialization
module ? Something more targetted than the plain "utils".
Also we should add a docstring to mention that we do this to benefit from the performances of pydantic serialization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the use of the new method to get a string should be generalized
Indeed I was lazy |
This will allow to benefit from improved serialization performances of pydantic v2, even for non-pydantic classes. fix [ANT-2052]
fix [ANT-2052]