Open fabsimilian opened 3 years ago
Why do you need to change the response value?
We need to mock a state. We're developing a feature against a sandbox of an external provider. But there are not all possible states available in the sandbox environment. So we want to mock them for testing.
@fabsimilian Do you want to change "foo" with fixed value?
There is no current solution, but I'm trying to figure out a possible solution.
For example, configuration like the following:
{
"request": {
"uri": "/foo/bar"
},
"response": {
"proxy": {
"url": {
"template": "http://another.site/${req.uri}"
},
"modifier": {
"key" : {
"jsonPath": "$.data.foo"
},
"value": "fixed"
}
}
}
}
Currently I'm using moco with json. Is there a way to change a json property of a proxy response?
What I'm trying to achieve: Send a request to a different site, get the json response from that site and change a json property.
Example:
http://another.site/${req.uri} will return me a json like:
And I want to change property foo to another value.