acs-object-management provides an API to manage object types, including in-table and extension table definition of attributes, forms, and a Tcl API to the database pl/sql layer.
It might be a good place to start.
I also just discovered this Python library that provides a really good API to serialize objects to and from JSON that makes no assumptions about how the data is used. It may provide inspiration.
https://marshmallow.readthedocs.io/en/stable/why.html