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?
to your account
makes more sense, perhaps we could have dump_json and load_json attributes of Config which are then used in parse_json(), json() and schema_json() (and anywhere else we use encode/decode json that I've forgotten about).
Originally posted by @samuelcolvin in #599 (comment)
The text was updated successfully, but these errors were encountered:
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 default argument with standard lib json and orjson allow, but not ujson.
Sorry, something went wrong.
If this requires a breaking change it should be done with the bump to version 1.
Did you think about implementing something similar to @JrooTJunior done in https://github.com/aiogram/aiogram/blob/dev-2.x/aiogram/utils/json.py?
I would prefer more like the json_serialize argument in aiohttp, so the end user is responsible for implementing a function that correct encodes or decodes JSON.
Yes. json_serialize is more good way.
I want to remove this code from aiogram.
is anyone implementing this now?
If not, I want to implement this feature.
No one has started this. PR very welcome.
custom json (d)encoders, fix #714
custom json (de)serialisation (pydantic#823)
* custom json (d)encoders, fix pydantic#714
* add docs
No branches or pull requests