@hitsthings Your API is worth considering, without a doubt. My remarks:
- It introduces new entities/method, which is not a big deal, but should be avoided if possible.
- Does not support multiple parent schemas ("classes"). The latter of course can be easily fixed by using an array instead of a String value for
_type
(s). - I like that you're able to chose the property that holds the type information.
- I think parent properties should be included by default, which is in line with programmers intuition.
I came up with an alternative approach that keeps the changes to the current API to a bare minimum and leverages the way models are created and cached.