Here is the body of my request. You will note the {{numProducts}} variable.
{
“query”: {
“bool”: {
“filter”: [
{
“term”: {
“language”: “EN”
}
},
{
“term”: {
“region”: “USA”
}
},
{
“term”: {
“season”: “FA2019”
}
}
]
}
},
“size”:{{numProducts}},
“_source”: [
“language”,
“genderAge”,
“division”,
“productCode”,
“region”
]
}
I also have a pre-req script which has this line : var sources = JSON.parse(pm.request.body.raw)._source.toString();
When I run the request manually, I do not have an issue, but when I run it as part of a collection, I get this error: JSONError: Unexpected token ‘n’ at 23:14 “size”:{{numProducts}}, ^