Getting the first (wildcard) element...possible?

62 views
Skip to first unread message

Eric Peters

unread,
Jan 18, 2016, 1:57:45 PM1/18/16
to JsonPath
Trying to do something like: $.request.*[0].provider

16/01/18 18:52:59 [main()]: DEBUG path.CompiledPath: Evaluating path: $['request'][0]['provider']
Failed with exception java.io.IOException:com.jayway.jsonpath.PathNotFoundException: Filter: [0]['provider'] can only be applied to arrays. Current context is: {getPegasusVersionInfo2={provider=10}}

Such that when gets returned would be a single number, rather than an array of numbers if I use: $.request.*.provider

Is that even possible?

Thanks,

Eric
Reply all
Reply to author
Forward
0 new messages