open fun <T : Any> asJSON(objectMapper: ObjectMapper, clazz: Class<T>): T (source)
Provides the body of the message, marshalled as a JSON object.
objectMapper - the object mapper to deserialize with
- the matching JSON object class
IOException - if an error occurs during marshalling
Return
a new instance of the JSON object class