dataclasses-json
dataclasses-json copied to clipboard
How to pass undefined=Undefined.EXCLUDE via mixin?
I can use @dataclasses(undefined=Undefined.EXCLUDE)
as an annotation to a class definition to specify the behavior for undefined fields. How can I specify it when I used Mixin instead of annotation?
I came across this somewhere.
@dataclass
class ApiRequest(DataClassJsonMixin):
dataclass_json_config = config(
letter_case=LetterCase.CAMEL,
undefined=Undefined.EXCLUDE
)['dataclasses_json']
See https://github.com/lidatong/dataclasses-json/issues/194.
I was looking for this, thank you! I think this should end up in the documentation as well.
I was looking for this in the documentation, but couldn't find it.
Please consider adding it to the docs.