Currently JSON definitions are declared statically and included in the binary. Ideally, however, there should be an API to load JSON definitions at runtime instead of using the static definitions. Definitions loaded at runtime would have to follow the same spec as defined in the static definitions in order to deserialize correctly.
It would be nice to have this specification outlined in the Wiki, either here or in Substrate Archive.