Closed PJCampi closed 2 months ago
Should be solved in v1, but I suggest we still fix this in v0
This is becoming a bigger problem for me (global configs are also not applied from collections or mappings) so I will try to see if I can fix this tomorrow. It should be relatively simple.
I have a fix for the bug. I can create a PR if someone can grant me write access to the repo.
@PJCampi tagged you in another issue - please fork the repo and create a PR, you do not need contributor access to the repo itself
Description
Let's say I register a custom encoder/decoder for type
T
in theglobal_config
. I would expect that adataclass
with a field of typeOptional[T]
to use the encoder/decoder registered. Instead I have to manually register the same encoder for the typeOptional[T]
for the encoder to be picked up._user_overrides_or_exts
does not unwrap the optional type.Code snippet that reproduces the issue
Describe the results you expected
{"created_at": "2023-08-08"}
Python version you are using
3.9
Environment description
dataclasses-json==0.5.14