Escaping special characters in Swagger UI

2,108 views
Skip to first unread message

Marko Kaar

unread,
Sep 30, 2015, 7:35:03 AM9/30/15
to Swagger
Hey,

We have a scenario in our project where we have special characters entered in the JSON body parameter of a PUT request in Swagger UI. We have set the content type as JSON and charset as UTF-8, however upon trying the request out we get the following error:
{ "StatusCode": "-1", "StatusMessage": "Unknown service error", "AdditionalInfo": "Unrecognized character escape '4' (code 52)\n at [Source: org.eclipse.jetty.server.HttpConnection$Input@1e949adb{HttpChannelOverHttp@2e42af8c{r=2,a=DISPATCHED,uri=OURURI},HttpConnection@1c13280e{FILLING},g=HttpGenerator{s=START},p=HttpParser{s=END,54 of 54}}; line: 3, column: 22] (through reference chain: Identity[\"Password\"])" }
Basically we have a "\" in the password field of our authentication service and it thinks we're trying to escape the following character.
Has anyone run into a similar issue or does anyone have any solutions for this?

Thanks in advance,
Marko

Ron Ratovsky

unread,
Oct 2, 2015, 5:35:26 PM10/2/15
to Swagger
Hi Marko,

Can you provide a sample input and how it is actually transmitted over the wire (using the browser network log)?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------
Reply all
Reply to author
Forward
0 new messages