You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unlike the body for example, we can't do intensive parsing of the path. The .regex() and .concat() methods don't work on the path.
The :value part of the path also cannot be limited to specific values, so you can't simultaneously get a particular part of path while limiting which values match.
I want to match create*, so create or create-thing or create-other would be valid for that part of the path.
In the response, I want to reference that component, or part of it. I'd like to use regex maybe:
response:
statusCode: 200headers:
Content-Type:
- application/jsonbody: 'A request to create {{request.path.regex(/create-([^/]*)/)}} has been received.'
response:
statusCode: 200headers:
Content-Type:
- application/jsonbody: 'A request to {{request.path.method}} has been received.'
Which is something.. but not quite the same, as I can't do any string manipulation on it.
But even worse, is that the config will match paths I don't want it to match, like /api/v1/method/delete/resource.
It seems that my only option is hardcoding the possible permutations of paths I want to match into multiple configs, with a lot of duplication and slightly different responses. The data I need isn't in the body of the request, so it seems like I'm stuck.
The text was updated successfully, but these errors were encountered:
Unlike the body for example, we can't do intensive parsing of the path. The
.regex()
and.concat()
methods don't work on the path.The
:value
part of the path also cannot be limited to specific values, so you can't simultaneously get a particular part of path while limiting which values match.As an example, I have a config like this:
I want to match
create*
, socreate
orcreate-thing
orcreate-other
would be valid for that part of the path.In the response, I want to reference that component, or part of it. I'd like to use regex maybe:
However that doesn't work.
If I instead do:
then I guess I can do:
Which is something.. but not quite the same, as I can't do any string manipulation on it.
But even worse, is that the config will match paths I don't want it to match, like
/api/v1/method/delete/resource
.It seems that my only option is hardcoding the possible permutations of paths I want to match into multiple configs, with a lot of duplication and slightly different responses. The data I need isn't in the body of the request, so it seems like I'm stuck.
The text was updated successfully, but these errors were encountered: