Hello,

I have the following JSON:

{
    "resourceType": "Bundle",
    "entry": [{
        "resource": {
            "resourceType": "Patient",
            "identifier": [{
                "use": "usual",
                "system": "MySystem",
                "value": "12346"
            },
            {
                "use": "secondary",
                "system": "Yo",
                "value": "654321"
            }]
        }
    }]
}

I would like to extract the value of the identifier with the use "usual".
To do so, I wanted to use JSON Path as described in [1]. So, here is my
property with the right expression:

<log level="full">
        <property

expression="json-eval($.entry[0].resource.identifier[?(@.use='usual')].value)"
            name="MyValue" xmlns:ns="http://org.apache.synapse/xsd"/>
</log>

However, in my log, I just see an empty array...:

TID: [-1234] [] [2018-02-02 11:35:21,524]  INFO
{org.apache.synapse.mediators.builtin.LogMediator} -  To: /YoTest/,
MessageID: urn:uuid:b341e57e-f1cf-4b76-b79d-4185fbcb26a1, Direction: r
equest, MyValue = [],

The problem is I am sure my expression works because it works nicely on
[2]. So, is there a bug in the ESB?


[1] https://docs.wso2.com/display/ESB480/JSON+Support
[2] https://jsonpath.curiousconcept.com/
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to