wso2wso2-esbwso2-enterprise-integratorwso2-micro-integratorwso2-integration-studio

How to Access Fields in application/vnd.oracle.adf.resourceitem+json Response in WSO2 Integration Studio?


I'm currently working on a project in WSO2 Integration Studio, where I need to retrieve and process data from an external API. The challenge I'm facing is that the API response is in the application/vnd.oracle.adf.resourceitem+json content type.

In the past, I have worked with APIs that returned responses in application/json, and I could easily access specific fields using expressions like json-eval($.Products).

However, I'm unsure how to properly access and manipulate the fields in the application/vnd.oracle.adf.resourceitem+json response format. How can I extract and process the fields from this content type to save them as properties for further processing in my sequence?

Any guidance or examples would be greatly appreciated.


Solution

  • First, we have to assign a message builder for this message format. Please refer [1] for more details. As per my brief research application/vnd.oracle.adf.resourceitem+json can be treated as a JSON. So, we can register the same message builder we use for application/json (org.wso2.micro.integrator.core.json.JsonStreamFormatter) After that we should be able to access message fields using json-path expressions.

    [1] https://mi.docs.wso2.com/en/latest/install-and-setup/setup/message-builders-formatters/message-builders-and-formatters/