I’m building mocked APIs using examples.
The faker library to create random bits and pieces (https://learning.postman.com/docs/writing-scripts/script-references/variables-list/) is awesome to mock the creation of a new resource.
However a common pattern we have does not work with this.
We have a Restful API, so usually we have something along the lines: https://api.com/resource/:id
With Postman I can now nicely return a static JSON response and with that faker library I can even generate random data so that it is always looking different.
However what I would need to do is to have that :id from the path inside the JSON.
So essentially a way to have the path variable as a variable for the response.
How can I achieve this? This would enable us to build mock APIs with ease!