-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request - support parsing of request.path
#128
Comments
One of my latest PRs #167 addresses this by adding a new pathVariables object to the request: So for your case you could have:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: