This is my code:
 

Class bd.webapp.OutboundMessageRequest Extends (%Persistent, Ens.Request, %JSON.Adaptor)

{



Property Metadata As bd.webapp.OutboundMessageRequestMetadata;

Property MessageContent As %DynamicObject;

Method %GetContentType() As %String
{
    If $ISOBJECT(..MessageContent) {
        Quit "application/json"
    } Else {
        Quit ##super()
    }
}

Method %ShowContents(pZenOutput As %Boolean = 0)
{
    If $ISOBJECT(..MessageContent) {
        Set json = ..MessageContent.%ToJSON()
        set formatter = ##class(%JSON.Formatter).%New()
        If pZenOutput {
            Write formatter.Format(json)
        } Else {
            Write json
        }
    } 
    
  
    /*If $ISOBJECT(..Metadata) {
        Set json = ..Metadata.%ToJSON()
        set formatter = ##class(%JSON.Formatter).%New()
        If pZenOutput {
            Write formatter.Format(json)
        } Else {
            Write json
        }
    }*/
}

Method %ShowContentsHead(pZenOutput As %Boolean = 0)
{
    If $ISOBJECT(..MessageContent) {
        If pZenOutput {
            Write "<b>MessageContent (JSON)</b><br>"
        } Else {
            Write "MessageContent (JSON):", !
        }
    }
}


Class bd.webapp.OutboundMessageRequestMetadata Extends (%RegisteredObject, %JSON.Adaptor)
{

Property RegionSlug As %String;

Property TenantSlug As %String;

Property SystemSlug As %String;

Property MessageId As %String;

Property MessageType As %String [ InitialExpression = "JSON" ];

Property OccurredAt As %String;

Property CorrelationId As %String;

}