https://linen.dev logo
#help
Title
# help
a

Avinash Gaur

08/01/2023, 10:46 AM
json file:
Copy code
{
  "mappings": [
    {
      "request": {
        "urlPath": "/things",
        "method": "GET",
        "queryParameters": {
          "id": {
            "hasExactly": [
              {
                "equalTo": "1"
              },
              {
                "contains": "2"
              },
              {
                "doesNotContain": "3"
              }
            ]
          }
        }
      },
      "response": {
        "status": 200
      }
    }
  ]
}
command used to run:
java -jar ~/Downloads/wiremock-jre8-standalone-2.35.0.jar --port 80 --https-port 443 -global-response-templating
Error:
Copy code
Exception in thread "main" com.github.tomakehurst.wiremock.standalone.MappingFileException: Error loading file mocks/./mappings/userConfigSvc/get-user-config.json:
{"hasExactly":[{"equalTo":"1"},{"contains":"2"},{"doesNotContain":"3"}]} is not a valid match operation
	at com.github.tomakehurst.wiremock.standalone.JsonFileMappingsSource.loadMappingsInto(JsonFileMappingsSource.java:126)
	at com.github.tomakehurst.wiremock.core.WireMockApp.loadMappingsUsing(WireMockApp.java:224)
	at com.github.tomakehurst.wiremock.core.WireMockApp.loadDefaultMappings(WireMockApp.java:220)
	at com.github.tomakehurst.wiremock.core.WireMockApp.<init>(WireMockApp.java:112)
	at com.github.tomakehurst.wiremock.WireMockServer.<init>(WireMockServer.java:70)
	at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.run(WireMockServerRunner.java:62)
	at com.github.tomakehurst.wiremock.standalone.WireMockServerRunner.main(WireMockServerRunner.java:133)
I have taken this example from the documentation here . Still I am getting this error. Can someone please help?
t

Tom

08/01/2023, 10:55 AM
This is actually only available in 3.x. Seems it’s got into the 2.x docs by mistake.
👍 1
a

Avinash Gaur

08/01/2023, 10:56 AM
Is there any way to support multiple values of a single request param in 2.x? If yes, where can I find the docs for the same?
t

Tom

08/01/2023, 1:55 PM
I’m afraid not, you’ll need to upgrade to 3 for this. Don’t be put off by the beta label - it’ll be out of beta very soon and we only intend very minor (non-breaking) changes between now and then.
a

Avinash Gaur

08/02/2023, 4:45 AM
Thanks, Tom, Will upgrade to the latest version as you recommended.
4 Views