Closed codeperfector closed 7 years ago
@tranhungt can you please take a look. Thanks!
@waynemz Thanks for the submission. This is a great idea.
A suggestion though, why don't we use named regex groups to parse the URL instead of passing in the parameters 'groupNames'? http://stackoverflow.com/questions/415580/regex-named-groups-in-java
It would help reduce fragility/coupling of the regex url matcher and the named groups.
@tranhungt thanks for the feedback. I'll make the change to the static imports. Will test with named capturing groups to see if they work well. I could have support for both named capturing as well as 'groupNames' parameter with a preference for groupNames if present. Any opinions on having both?
Great, thanks @waynemz.
Coming from Python, I think it's more clear for the end user if there's only one correct way to use named groups. Giving multiple options may add cruft to our code, make it harder to maintain, and will be confusing or prone to implementation errors to end users.
Since the user has to specify the named groups in the urlRegex
field already, it's common practice to use named groups in regex matching. We'll be sure to show how to use named groups in the documentation so it'll be clear how it works.
@tranhungt I added the requested changes. Please review. Note that you may see some code from conflict resolution since I had a conflict with another PR.
Awesome. Thanks @waynemz . Will look soon.
@tranhungt Please take a look and approve.
@waynemz Thanks for the reminder! This looks great. Thanks for adding the feature. :1st_place_medal:
Added regex based pattern matching for incoming request URLs that allows extracted regex groups to be included in variable replacements. This allows values to be extracted from query parameters, etc in the URL and be included in the response body.