Could you not just use dicts and some schema validation logic for this?