https://linen.dev logo
Title
g

Gabe

01/24/2023, 8:33 PM
Hey everyone, just wondering if this is possible when creating a stub json file. Is it possible to return in within a response body, a value that's identified from a request body. For example:
Request: {{URL}}
Request Body: {
    "customer": "${this_value}"
}
Response Body: {
   "key1": "value1",
    "key2": "${this_value}"
}
t

Tom

01/24/2023, 8:35 PM
Yes, the best way to do that is usually to use the
jsonPath
helper like this:
{{{jsonPath request.body '$.customer'}}}
g

Gabe

01/24/2023, 8:39 PM
Awesome, thank you @Tom. By the way, good presentation on WireMock Cloud in December last year.
t

Tom

01/24/2023, 8:39 PM
Thanks 🙂