'Is there a way to configure Swagger V2 to accept the slash-x escape character in a value?

We have Swagger V2 on our API and we have data that uses "\x" for escape characters. Swagger is not recognizing this as a valid JSON and will not execute the request.

It goes through on Postman fine, but we'd like it to work with Swagger as well.

From what I can gather, Postman changes the "\x" to "\u00". I've tested with Swagger V3, and while it sends the request, it maintains the "\x" and fails to convert to deserialize to an object. I can do a string replace (working with C# in .NET Core 3 btw) to change the "\x" to a "\u00", however, this still only works with Swagger V3. We are limited to Swagger V2 at this time.

So, for now, the only remedy I have found is to manually alter the input in Swagger by changing all the "\x" instances with "\u00".

Does anyone have any suggested alternatives?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source