0

I am trying to nest expressions in Wiremock and I get an error. Is it possible to nest a randomValue inside the pickRandom helper?

Example:

I have a wiremock stub that returns: "{{{pickRandom '{\"test\": \"1\"}' '{\"test\": \"{{randomValue type=\'UUID\'}}\"}'}}}"

1 Answers1

0

I cannot test this but it might be possible to select the pickRandom Helper value from a list passed as a parameter, e.g.: {{{pickRandom (jsonPath request.body '$.names')}}}

{{{pickRandom ('{\"test\": \"1\"}' '{\"test\": \"{{randomValue type=\'UUID\'}}\"}')}}}

Ref: http://wiremock.org/docs/response-templating/

wp78de
  • 18,207
  • 7
  • 43
  • 71