Issue: Params does not work, when there are multiple values for a key #76

Closed
opened 2025-12-29 14:22:04 +01:00 by adam · 4 comments
Owner

Originally created by @raghavendrabankapur on GitHub (Mar 9, 2018).

Originally assigned to: @StefH on GitHub.

For a request in the Param's, if we have multiple values for a key, we are not able to match the score for that request and return 410 saying could not find the mapping.

In a request for a query string parameter, we can have only one value. But in the structure, we are allowing an array of values that can be passed. That means for that key, it can be anything among the passed values.

example

  "Params": [
        {
          "Name": "searched",
          "Values": ["test","test2"]
        }
      ]

here in params, we have the key "searched" and values being "test" and "test2". Now my request can be like
http://localhost:9092/xyz?searched=test
http://localhost:9092/xyz?searched=test2

We can have either of them. But we cannot have like http://localhost:9092/xyz?searched=test1,test2

In this case, in the RequestMessageParamMatcher.cs file, we are deciding the score based on the count of values. Ideally, this should have been done if the list contains the requests param value.

Originally created by @raghavendrabankapur on GitHub (Mar 9, 2018). Originally assigned to: @StefH on GitHub. For a request in the Param's, if we have multiple values for a key, we are not able to match the score for that request and return 410 saying could not find the mapping. In a request for a query string parameter, we can have only one value. But in the structure, we are allowing an array of values that can be passed. That means for that key, it can be anything among the passed values. example ``` json "Params": [ { "Name": "searched", "Values": ["test","test2"] } ] ```` here in params, we have the key "searched" and values being "test" and "test2". Now my request can be like http://localhost:9092/xyz?searched=test http://localhost:9092/xyz?searched=test2 We can have either of them. But we cannot have like http://localhost:9092/xyz?searched=test1,test2 In this case, in the RequestMessageParamMatcher.cs file, we are deciding the score based on the count of values. Ideally, this should have been done if the list contains the requests param value.
adam closed this issue 2025-12-29 14:22:04 +01:00
Author
Owner

@StefH commented on GitHub (Mar 10, 2018):

Thanks for this report.

@StefH commented on GitHub (Mar 10, 2018): Thanks for this report.
Author
Owner

@StefH commented on GitHub (Mar 10, 2018):

Will be fixed soon, please watch updates here + NuGet.

@StefH commented on GitHub (Mar 10, 2018): Will be fixed soon, please watch updates here + NuGet.
Author
Owner

@raghavendrabankapur commented on GitHub (Mar 10, 2018):

I have a fix for the same. I will create a pull request.

On Sat, Mar 10, 2018, 8:19 PM Stef Heyenrath notifications@github.com
wrote:

Will be fixed soon, please watch updates here + NuGet.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/WireMock-Net/WireMock.Net/issues/106#issuecomment-372035456,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AExkn3SWkC7X4k08R_eXbrv-7lAUoB7Rks5tc-f7gaJpZM4Sj-oZ
.

@raghavendrabankapur commented on GitHub (Mar 10, 2018): I have a fix for the same. I will create a pull request. On Sat, Mar 10, 2018, 8:19 PM Stef Heyenrath <notifications@github.com> wrote: > Will be fixed soon, please watch updates here + NuGet. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > <https://github.com/WireMock-Net/WireMock.Net/issues/106#issuecomment-372035456>, > or mute the thread > <https://github.com/notifications/unsubscribe-auth/AExkn3SWkC7X4k08R_eXbrv-7lAUoB7Rks5tc-f7gaJpZM4Sj-oZ> > . >
Author
Owner

@StefH commented on GitHub (Mar 10, 2018):

Already fixed, no need for PR.

@StefH commented on GitHub (Mar 10, 2018): Already fixed, no need for PR.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#76