going to shamelessly plug my own library here: https://github.com/mivanit/ZANJ
You can have nested dataclasses, as well as specify custom serializers/loaders for things which aren't natively supported by json.