I am stuck. I am trying to automate some API tests, and I cannot figure out how one would pass a path variable to Newman. For example, I have a PUT to /accounts/:accountId where :accountId is the account ID I want to modify.
And then, how can I supply a POST body to update the target resource?
Additional context: I imported my collection from a Swagger doc, and I intend to keep doing this in a custom pipeline. Edit: I included this because I see some people have Postman style variables in their paths, but I don’t because I’m bringing in a Swagger doc.
Edit: This seems to work for path params, but feels wrong:
const id = 60;
pm.request.url.path = '/accounts/' + id;
Kind of crazy that I can overwrite the path, but I can’t find a built in way to replace a path var.