swaggo / gin-swagger

gin middleware to automatically generate RESTful API documentation with Swagger 2.0.
MIT License
3.76k stars 270 forks source link

How do you escape double quotes? #233

Open danielsaporo opened 2 years ago

danielsaporo commented 2 years ago

How do you escape double quotes in a string (e.g. the description of a parameter, response, etc)? I've already tried \" and "" and in either case the string gets truncated as soon as it sees a ".

Is this a bug, or is there some way of escaping double quotes? I haven't seen any in the documentation.

Example which doesn't work:

// @Param sortdir query string false "Sort direction - can be either \"asc\" (ascending - default) or \"desc\" (descending)."