question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swagger replaces quotes with angled quotes in documentation

See original GitHub issue

In our documentation we have example curl calls and other things using single ' and double " quotes.

For whatever reason, when Swagger pulls in this documentation it insists on replacing the quotes with single ‘’ and double “” angled quotes.

Here is an example of what it looks like: image

This is a bug because when our users copy and paste these commands into their shell, they don’t work because of the angled quotes.

We are using swagger docker image: swaggerapi/swagger-ui:v3.19.3

And it is the API_URLS environment variable to pull the swagger json from another url.

The contents of the swagger json start with:

{
  "swagger": "2.0",
  "info": {
    "title": "Foobar Service",
    "description": "\u003cbr\u003e\u003cp\u003eExample of a simple GET request via curl with bearer HTTP Authentication:\u003c/p\u003e\u003cpre\u003ecurl -X GET \"https://foobar.com/stuff\" -H \"Accept: application/json\" -H \"Authorization: Bearer abc123.xyz.789\"\u003c/pre\u003e",
    "version": "2.0"
  },
  "paths": {}
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
shockeycommented, Jan 15, 2019

Confirmed.

To be clear: the definition itself still has regular quotation marks, but the rendered content uses smart quotes.

0reactions
veqryncommented, Feb 7, 2019

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Reformatted quotes in swagger - json - Stack Overflow
I'm working on an web API developed in Visual Studio using C#, and using Swagger to view the code documentation and play with...
Read more >
Visual Studio 2017 and Swagger: Building and Documenting ...
Swagger is a technology-agnostic standard that allows the discovery of REST APIs, providing a way for any software to identify the features of...
Read more >
Audit Logs | SwaggerHub Documentation - SmartBear Support
Note: This JSON object uses single quotes ( ' ) instead of double quotes ( " ) around the key names and values....
Read more >
YAML Multiline Strings
If instead you want them to be replaced by spaces, use the folded style, indicated by a right angle bracket ( > )....
Read more >
Replacing/turning off "smart" or "curly quotes" to avoid ...
2) Once you've made that change, you shouldn't have to repeat it, but you will have to do a global "search and replace"...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found