Hi, Im having a problem where I need to mock a POS...
# general
p
Hi, Im having a problem where I need to mock a POST request that in the body contains json where one of the values is a list of floats, in the response I need to return this same list of floats back. I am using the python API for wiremock and have tried "{{jsonPath request.body '$.value'}}" in the jsonBody using a response-transformer. That kind of works but the returned list of floats is represented as a string ie. '[1.1, 1.2, 1.3]' etc. is there any way to have this returned as an actual list of floats in the json body of the response?
t
Hi @Patrick Jansson probably your best bet is to loop over the result of the
jsonPath
call using the
each
helper e.g.
Copy code
{{#each (jsonPath request.body '$.value') as |num|}}
  {{{num}}}
{{/each}}
p
Wow thanks for the quick response! I will test this
👍 1