Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upAllow custom json encoder / decoder #714
Comments
This comment has been minimized.
This comment has been minimized.
as discussed in #599 @pablogamboa suggested allowing a custom JSON encoder / decoder library. This would allow libraries like orjson to be used without making them explicit dependencies of pydantic. The problem here is going to be how to deal with the |
This comment has been minimized.
This comment has been minimized.
If this requires a breaking change it should be done with the bump to version 1. |
This comment has been minimized.
This comment has been minimized.
Did you think about implementing something similar to @JrooTJunior done in https://github.com/aiogram/aiogram/blob/dev-2.x/aiogram/utils/json.py? |
This comment has been minimized.
This comment has been minimized.
I would prefer more like the |
This comment has been minimized.
This comment has been minimized.
Yes. I want to remove this code from aiogram.
|
This comment has been minimized.
This comment has been minimized.
@samuelcolvin |
This comment has been minimized.
This comment has been minimized.
No one has started this. PR very welcome. |
makes more sense, perhaps we could have
dump_json
andload_json
attributes ofConfig
which are then used inparse_json()
,json()
andschema_json()
(and anywhere else we use encode/decode json that I've forgotten about).Originally posted by @samuelcolvin in #599 (comment)