Standalone Wiremock Server not converting mime-type before recording and matching

31 views
Skip to first unread message

IB

unread,
Jan 23, 2023, 7:22:47 PM1/23/23
to wiremock-user
I noticed Wiremock standalone server is recording a request body as is (without removing any special characters) even if the Content-Type is stated as application/json.

Here's an example, my JSON request body has the following format,
```
{
  "transactionId": "testemeasss1",
  "transactionDate": "2023-01-12",
  "transactionType": "QUOTE",
  "currency": "EUR",
  "sourceSystemId": "ESTORE"
}
```
Wiremock is saving the mapping as,
```
"bodyPatterns" : [ {
      "equalToJson" : "{\"transactionId\":\"testemeasss1\",\"transactionDate\":\"2023-01-12\",\"transactionType\":\"QUOTE\",\"currency\":\"EUR\"}",
      "ignoreArrayOrder" : true,
      "ignoreExtraElements" : true
    } ]
```
The Axios library that I'm using for making the HTTP calls and escaping the double quotes (\"). Is there a way of recording the JSON body after removing the escapes before the double quotes?

Thanks

Uri Maoz

unread,
Jan 24, 2023, 11:16:48 AM1/24/23
to wiremock-user
Hi

Can you please post the question in our Slack community? We are moving the WireMock discussions to Slack community 

You can join here:


Thanks,
Reply all
Reply to author
Forward
0 new messages