Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: https://wso2.org/jira/browse/DOCUMENTATION-8022 Corrected the classes to org.apache.synapse.commons.json.JsonStreamFormatter and org.apache.synapse.commons.json.JsonStreamBuilder

...

  • org.apache.axis2.json.JSONBuilder/JSONMessageFormatter
  • org.apache.axis2synapse.commons.json.JSONStreamBuilderJsonStreamBuilder/JSONStreamFormatter

  • org.apache.axis2.json.JSONBadgerfishOMBuilder/JSONBadgerfishMessageFormatter

...

Tip

To support having spaces inside JSON attributes, change the default JSON builder and formatter to the following pair in either <APIM_HOME>/repository/conf/axis2/axis2.xml (super tenant scenario) or <APIM_HOME>/repository/conf/axis2/tenant-axis2.xml (tenant scenario) file:

Code Block
<messageBuilder contentType="application/json" class="org.apache.synapse.axis2commons.json.JSONStreamBuilder>JsonStreamBuilder>
<messageFormatter contentType="application/json" class="org.apache.axis2synapse.commons.json.JSONStreamFormatter”JsonStreamFormatter”/>
Tip

To support use cases for JSON payloads with arrays, change the default JSON builder and formatter to the following pair in either <APIM_HOME>/repository/conf/axis2/axis2.xml (super tenant scenario) or <APIM_HOME>/repository/conf/axis2/tenant-axis2.xml (tenant scenario) file:

Code Block
<messageBuilder contentType="application/json" class="org.apache.synapse.axis2commons.json.JSONStreamBuilder>JsonStreamBuilder>
<messageFormatter contentType="application/json" class="org.apache.synapse.axis2commons.json.JSONStreamFormatter”JsonStreamFormatter”/>

Else, in JSON to XML conversion, there might be issues as below:

Code Block
titleJSON
"phoneNumbers":[
      {
        "phoneNumber":"4027161289",
        "phoneNumberType":"home"
      }
]
Code Block
titleConverted XML
<?xml-multiple phoneNumbers?>
<phoneNumbers>
   <phoneNumber>4027161289</phoneNumber>
   <phoneNumberType>home</phoneNumberType>
</phoneNumbers>

...