Open EarthyOrange opened 4 years ago
I made some modifications in the code, that I have, to do this.
This is what I added to the switchResponses key in config.json.
{
"$.path1value1": {
"httpStatus": 200,
"jsonPathUpdates": { "$.id": "ID" },
"mockBody": "@@request"
}
And also added logic to consume this configuration. If this feature is ever officially added I will update the code that I have.
I have an endpoint that accepts a JSON object and responds with the same JSON object with the ID field updated with a unique value. So the rest of the request body is pretty much untouched.
My plan is to use a few fields from the request body for
switch
and assign an ID based on that. Since it can be a huge object, I want to avoid using templating to copy all the keys from the request body to the response body. Is there an easy way to do that?Thanks!!