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

Support optional query parameters #291

Open
stefan-schweiger opened this issue Nov 14, 2023 · 2 comments
Open

Support optional query parameters #291

stefan-schweiger opened this issue Nov 14, 2023 · 2 comments

Comments

@stefan-schweiger
Copy link

It would be great if not all query parameters would be required. E.g. if I set something up like the config below which does a "ShouldMatch" with .* I think a request like this should also be accepted POST /sms.do?to=test.

- request:
    method: POST
    path: /sms.do
    query_params:
      from:
        matcher: ShouldMatch
        value: '.*'
      to:
        matcher: ShouldMatch
        value: '.+'
  response:
    status: 200
    body: |-
      {
        "count": 1,
        "error": null
      }

Overall I also think there should be an option to just ignore all query parameters and only match on the path, because honestly in the above example I couldn't even care less about the actual query parameters, I just always want my response returned for all requests.

@Sawiq
Copy link

Sawiq commented Nov 23, 2023

If I understand your problem correctly, you can simply not specify query params' matcher(s) at all...

@stefan-schweiger
Copy link
Author

If I don't specify any parameters it will just 404..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants