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

Question: how can i define multiple values of one query parameter #132

Closed
pkonnov opened this issue May 13, 2022 · 2 comments
Closed

Question: how can i define multiple values of one query parameter #132

pkonnov opened this issue May 13, 2022 · 2 comments

Comments

@pkonnov
Copy link

pkonnov commented May 13, 2022

---
request:
  method: "GET"
  path: "/v1/endpoint"
  queryStringParameters:
    param1:
      - "value1"
      - "value2"
response: ...

Log:
2022/05/13 22:21:49 Discarding mock: get_something.yaml[0] Reason: Query string not match. Actual: param1: value1, Expected: param1: value1, param1: value2

@pkonnov
Copy link
Author

pkonnov commented May 31, 2022

there

....
for key, mval := range mockMap {
if rval, exists := reqMap[key]; exists {

	if isOneElementOfArrayExistsToAnotherArray(mval, rval) {
		return true
	}
....
func isOneElementOfArrayExistsToAnotherArray(array []string, anotherArray []string) bool {
	for _, v := range array {
		for _, vv := range anotherArray {
			if v == vv {
				return true
			}
		}
	}
	return false
}

@jmartin82
Copy link
Owner

Hi, I'm not following you, could you provide the request ?

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

No branches or pull requests

2 participants