Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JSON array convert to object in MI #3602

Open
veneerac opened this issue Sep 10, 2024 · 0 comments
Open

JSON array convert to object in MI #3602

veneerac opened this issue Sep 10, 2024 · 0 comments
Labels

Comments

@veneerac
Copy link

Description

When using the above XPath, the JSON is converted to a JSONObject, and upon changing the message type back to JSON, single-element arrays are converted into objects.JSON object

Steps to Reproduce

Use ForEach mediator with a Filter mediator to loop through a JSON, as described below.

<foreach expression="//profiles[1]/attachments" id="Itr1">
    <sequence>
        <filter xpath="//attachments/type='PHOTO'">
            <then>
                <property description="Read Photo" expression="//attachments/base64" name="Photo_value" scope="default" type="STRING"/>
                <property name="messageType" scope="axis2" value="application/json"/>
            </then>
            <else>
                            
                        </else>
        </filter>
    </sequence>
</foreach>

Affected Version(s)

MI 4.2.0.86

OS, DB, other environment details and versions

No response

Related issue(s) (optional)

No response

Suggested label(s) (optional)

No response

Suggested assignee(s) (optional)

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant