As @milovan-tomašević said:
It is possible that the solution with
dataclasses-jsonmakes the code more readable and cleaner.pip install dataclasses-json
In addition, they say What if you want to work with camelCase JSON?
In case of camelCase JSON you can specify:
from dataclasses import dataclass
from dataclasses_json import dataclass_json, LetterCase
@dataclass
@dataclass_json(letter_case=LetterCase.CAMEL)
class Foo: