Introduction
In Oracle Integration Cloud (OIC), JSON request and response payloads may change dynamically when new fields are added. The REST Adapter's Allow Dynamic Json feature helps process additional JSON elements that are not defined in the original sample schema.
This feature supports for:
- Trigger Request
- Invoke Response
2. Use Case
Suppose an API initially returns:
{
"Val1": "v1"
}
Later, it returns additional fields:
{
"Val2": true
}
We need to process these new fields without depending entirely on the original JSON schema.
3. Implementation Steps
- Open the REST Adapter configuration for the trigger or invoke.
- Select JSON as the payload format and enable Allow Dynamic Json.
- Configure the initial JSON sample and complete the adapter setup.
- Open the mapper and map the standard fields using the graphical mapper.
- For additional fields, update the mapper's XSLT code to extract the required elements dynamically.
Example XSLT:
<xsl:value-of
select="*[local-name()='test2']"/>
Adjust the XPath to match the actual response wrapper and namespace structure in your mapper.
POC screenshots:
4. Benefits
- Supports additional JSON fields at runtime.
- Reduces dependence on the original JSON sample schema.
- Provides flexibility when API payloads change.





No comments:
Post a Comment