Selecting JsonPath using sub properties -
given
{ "bb:fund": [{ "label": "visa - 4113", "amount": 24.96, "amountdisplay": "$24.96", "cchash": "8cb41346976847bfb17d8a4da346e989", "_links": { "profile": [{ "href": "https://host/profiles/price-line" }, { "href": "https://host/profiles/price-line-credit-card" }] } }] }
i select fund object matching profile href, like
$.bb:fund[?(@..href=='https://host/profiles/price-line-credit-card')]
or $.bb:fund[?(@_links.profile[*].href=='https://host/profiles/price-line-credit-card')]
neither ever seem work.
i end using hack selecing based on unique attribute know won't present on other profiles. ie $.bb:fund[?(@.cchash)]
isn't guarnateed true forever...while profile is.
Comments
Post a Comment