Skip to content

Example request: An example with custom serialization/desrialization #289

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

Closed
Tracked by #290
andrewthetechie opened this issue Sep 18, 2022 · 7 comments · Fixed by #294
Closed
Tracked by #290

Example request: An example with custom serialization/desrialization #289

andrewthetechie opened this issue Sep 18, 2022 · 7 comments · Fixed by #294
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest Good hacktoberfest issue

Comments

@andrewthetechie
Copy link
Owner

Describe the solution you'd like
A new example that shows a custom serializer/deserializer based on the documentation https://pydantic-aioredis.readthedocs.io/en/latest/serialization.html

This example should show overriding json_default and serialize_partially/deserialize_partially.

@andrewthetechie andrewthetechie added documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest Good hacktoberfest issue labels Sep 18, 2022
@devbazregari
Copy link

bro would you please explain a little bit more about what you want ?

@andrewthetechie
Copy link
Owner Author

Hello @devbazregari,

This would be an example in the examples/ directory, preferably in a subdirectory like serialization that demonstrates how to customize serialization and deserialization when using pydantic-aioredis.

@devbazregari
Copy link

in fact, do you want me to show an example of serializing and deserializing in pydantic aioredis?

@andrewthetechie
Copy link
Owner Author

@devbazregari feel free to make a PR, but I may not accept it if the example does not match the quality of our other examples. This issue is a goal as part of the 1.0 release of this library to make sure that things are well documented and have examples for users to follow.

@devbazregari
Copy link

sure. I give it my best.

@andrewthetechie
Copy link
Owner Author

Ok, the goal is to release 1.0 this week

@devbazregari
Copy link

bro in overriding json_default and serialize_partially/deserialize_partially do you want me to implement the logic or just show users how to override ?! I'm asking this stupid question :) because I read your code and see you implemented the logic.

andrewthetechie added a commit that referenced this issue Sep 23, 2022
This adds a new feature, the ability to customize the json
deserialization into objects using a json.loads object hook.

it also updates documentation and includes an example of customizing
serialization and deserialization of python objects

#289
andrewthetechie added a commit that referenced this issue Sep 23, 2022
This adds a new feature, the ability to customize the json
deserialization into objects using a json.loads object hook.

it also updates documentation and includes an example of customizing
serialization and deserialization of python objects

#289
@andrewthetechie andrewthetechie linked a pull request Sep 23, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation good first issue Good for newcomers hacktoberfest Good hacktoberfest issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants