I have a swagger API constructed that uses a POST endpoint to take in a JSON file and returns a valid JSON schema for that file.
However when the JSON schema is constructed and returned the string also contains escape character backslashes. For example the normally correct string of
{"$schema": "http://json-schema.org/draft-04/schema#"}
Will be returned as the following in Swagger API:
"{\"$schema\": \"http://json-schema.org/draft-04/schema#\"}
As you can see the backslashes that are included should not be there. The backslashes are used to escape the "
character within C#, however when this data is returned as JSON it seems the escape characters are also being printed instead of parsed and removed.
Is there anyway I am able to change the response type of the Swagger endpoint so that this doesn't occur? There is a dropdown available in the UI that allows me to change the response type, but only application/json
is available.
Swashbuckle.AspNetCore and Swashbuckle.AspNetCore.Swagger versions 3.0.0 are being used.