Closed wapcrazut closed 1 year ago
Hello @dreamhead, sorry to ping but I was wondering if you could have any idea if this is already implemented or if this needs some work. If that's the case, could you point me to where to start at? Thanks.
This feature is not supported for now.
I do want to implement this feature, that's like Spring RequestMapping parsing, as following:
{
"request": {
"uri": {
"path": "/v1/test/{foo-id}/example"
},
"method": "get",
},
"response": {
"status": 200,
"text": {
"template": "{$req.uri.path.foo-id}"
},
"headers": {
"Content-Type": "application/json"
}
}
}
@dreamhead That seems pretty good, do you have plans on when to implement this? I would like to help but I'll need some guidance on how to extend Moco's functionality.
@wapcrazut Feel free to commit PR. I'll help you extend Moco.
@wapcrazut Your feature request has been included in release 1.4.0. https://github.com/dreamhead/moco/blob/master/moco-doc/apis.md#path-2
@dreamhead Awesome!! many thanks for the hard work you guys put into this project 🚀
Is it possible to use URL parameters in path and insert them in the response template, as URL queries?
For some mocks, I see the need to insert values coming from the URL path.
For example:
/v1/test/.*/example
/v1/test/dummy/example
dummy
Maybe something like the following:
Thanks.