Forum Discussion

SiKing's avatar
SiKing
Community Expert
7 years ago
Solved

context.expand produces different results between JSON and XML

I have some JSON response from a service, like: { "foo": "bar" } I try to read this from a Groovy step, like: log.info context.expand('${REST Request#Response#$..foo}') log.info context.expand(...
  • PaulMS's avatar
    7 years ago

    Either JSONpath expression $.foo (single dot) or $..foo[0] (the first occurrence in an array) would return a string.