Stubbing application/json response without having to escape double quotes in response body
See original GitHub issueHow can I stub application/json response without having to escape all the double quotes, i.e.: I want to get rid off all of those escape chars in response.body contents:
{
"request": {
"method": "GET",
"url": "/some/thing"
},
"response": {
"status": 200,
"body": "{\"id\": \"1\", \"type\": \"something\"}",
"headers": {
"Content-Type": "application/json"
}
}
}
Issue Analytics
- State:
- Created 9 years ago
- Comments:6
Top Results From Across the Web
Stubbing application/json response without having to escape ...
How can I stub application/json response without having to escape all the double quotes, i.e.: I want to get rid off all of...
Read more >How to escape double quotes in JSON - Stack Overflow
This solution helps in a Swift version building a string that's added to arguments for a JSON POST.
Read more >"Unexpected character ', while reading `payload` as Json ...
In JSON, you don't need to escape single quotes inside a value that is enclosed with double-quotes. In the case that you have...
Read more >JSONObject - Android Developers
When the requested type is a double, other Number types will be coerced using ... Creates a new JSONObject with name/value mappings from...
Read more >Groovy Language Documentation
If your code is indented, for example in the body of the method of a class, ... And you can escape the escape...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can always use
jsonBody
instead ofbody
and have much cleaner code:For the next person needing this: at least on wiremock 2.8 the property is actually called
bodyFileName
, notbodyFilePath
.