Encode the type T into a Json string
the encoded json string from given type T
the custom json object used to decode the specified string