write subTypes in json