Rahul Agrawal
10/15/2023, 2:26 AMLee Turner
10/15/2023, 12:04 PMjoin
before today but I am not sure it is the helper you are looking for. It looks like it uses the last parameter as the separator between the other parameters passed in. For example, this template fragment generates
"foo": "{{join 'Foo' 'Bar' 'Baz'}}",
Generates this result:
"foo": "FooBazBar",
I get an error when I try and pass in an empty string as the last parameter which would have been a nice solution.
Can you give us a little more context as to what you are trying to achieve to see if we can help find a solution ? Can you share your mapping and a request to use with it ?{
"first": "Hello",
"second": "World"
}
Using this mapping file:
{
"name": "concat",
"request": {
"url": "/concat",
"method": "GET"
},
"response": {
"status": 200,
"jsonBody": {
"result": "{{jsonPath request.body '$.first'}} {{jsonPath request.body '$.second'}}"
},
"headers": {
"Content-Type": "application/json"
},
"transformers": [
"response-template"
]
}
}
It should generate a result like this:
{
"result": "Hello World"
}
No special helper needed with this example.Rahul Agrawal
10/15/2023, 12:36 PMLee Turner
10/15/2023, 12:47 PM