You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Class field types can be any primitive type (eg. `str`, `int`, `datetime`), a variadic generic (eg. `list[str]`, `Optional[int]`, `Literal["hello", "world"]`). The `default_value` argument of `jsonfield` will be used if the key is not found in the json structure, the type of the class field is not `Optional[...]`. In this case, the value of `default_value` will be passed to the supplied parser function.
45
+
Class field types can be any primitive type (eg. `str`, `int`, `datetime`),
46
+
a variadic generic (eg. `list[str]`, `Optional[int]`, `Literal["hello", "world"]`),
47
+
or even another jsondataclass. The `default_value` argument of `jsonfield` will be used
48
+
if the specified key is not found in the dictionary *and* the type of the class field is not `Optional[...]`.
49
+
In this case, the value of `default_value` will be passed to the supplied parser function.
0 commit comments