You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched existing bugs to ensure a similar bug has not already been created
Description
If you provide a mock JSON that should return in the body a string, the actual HTTP response includes always the quotes of the string.
That is an issue because normally in the dotnet world if an API just returns a string, it is not enclosed into quoates.
$ curl -iX GET http://localhost:5000/raw-string-example
HTTP/1.1 200 OK
Content-Type: application/json
Date: Sun, 15 Sep 2024 19:04:53 GMT
Server: Kestrel
Transfer-Encoding: chunked
This is a raw string
yes, I know about that option. But it sounds a bit weird to me for short responses to create an extra file.
It would be easier to define it directly in the JSON itself
Prerequisites
Description
If you provide a mock JSON that should return in the body a string, the actual HTTP response includes always the quotes of the string.
That is an issue because normally in the dotnet world if an API just returns a string, it is not enclosed into quoates.
Steps to reproduce
Sample mock file:
If you run the mockaco container with this file you will get the following response:
Expected behavior
The expexted behavior should be more like:
Screenshots
No response
Additional context
If a user wants explicitly return a string with quotes, he should use normal JSON escaping:
The text was updated successfully, but these errors were encountered: