Skip to content
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

Updated display URL parser to also support regular expressions #297

Merged
merged 5 commits into from Dec 17, 2022

Conversation

dukeofharen
Copy link
Owner

@dukeofharen dukeofharen commented Dec 12, 2022

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the new behavior?

An option was added to user the display URL variable parser with a regular expression, to parse only a part of the URL as part of your response.

# The display URL of the current request is parsed with a regular expression and the result of the regex is written to the response.
- id: dynamic-display-url-regex-example
  conditions:
    method: GET
    url:
      path:
        regex: /dynamic-display-url-regex/users/(.*)/orders
  response:
    enableDynamicMode: true
    text: "User ID: ((display_url:'\/users\/([0-9]{3})\/orders'))"
    headers:
      X-Header: "((display_url:'\/users\/([0-9]{3})\/orders'))"
  priority: 0

Does this introduce a breaking change?

  • Yes
  • No

@dukeofharen dukeofharen added the enhancement Enhancement of the code, not introducing new features. label Dec 12, 2022
@dukeofharen dukeofharen merged commit 4739056 into master Dec 17, 2022
@dukeofharen dukeofharen deleted the feature/variable-parser-url-regex branch December 17, 2022 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement of the code, not introducing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant