Hi,
It seems that the request parameter queryStringParameters is being ignored when trying to find a match. Steps to reproduce:
Create a file foo.yaml:
---
request:
method: GET
path: /api/v1/foo
queryStringParameters:
limit:
- 1
offset:
- 0
response:
statusCode: 200
headers:
Content-Type:
- "application/json"
body: >
{
"bar":"baz"
}
create a second file foo2.yaml:
---
request:
method: GET
path: /api/v1/foo
queryStringParameters:
limit:
- 1
offset:
- 50
response:
statusCode: 200
headers:
Content-Type:
- "application/json"
body: >
{
"fooBar": "barBar"
}
launch the docker using those files as config:
docker run -v <path>/config:/config -p 8082:8082 -p 8083:8083 jordimartin/mmock
test it with curl multiple times:
curl -X 'GET' http://localhost:8083/api/v1/foo\?limit=1\&offset=50
Response:
curl -X 'GET' http://localhost:8083/api/v1/foo\?limit=1\&offset=50
Response:
container logs:
17:32:58.622 INFO ▶ New request: GET /api/v1/foo?limit=1&offset=50
17:32:58.627 INFO ▶ Definition match found: true. Name : foo.yaml
17:33:00.429 INFO ▶ New request: GET /api/v1/foo?limit=1&offset=50
17:33:00.430 INFO ▶ Definition match found: true. Name : foo2.yaml
I also tried to update the field queryStringParameters to use array of strings as seen in some examples:
queryStringParameters: {
"limit": ["1"],
"offset": ["50"]
}
Is there something wrong with the configs ?
Hi,
It seems that the request parameter
queryStringParametersis being ignored when trying to find a match. Steps to reproduce:Create a file foo.yaml:
create a second file foo2.yaml:
launch the docker using those files as config:
docker run -v <path>/config:/config -p 8082:8082 -p 8083:8083 jordimartin/mmocktest it with curl multiple times:
curl -X 'GET' http://localhost:8083/api/v1/foo\?limit=1\&offset=50Response:
curl -X 'GET' http://localhost:8083/api/v1/foo\?limit=1\&offset=50Response:
container logs:
I also tried to update the field
queryStringParametersto use array of strings as seen in some examples:Is there something wrong with the configs ?