Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot parse Swagger JSON containing special characters #295

Open
radarsh opened this issue Oct 29, 2019 · 0 comments
Open

Cannot parse Swagger JSON containing special characters #295

radarsh opened this issue Oct 29, 2019 · 0 comments

Comments

@radarsh
Copy link
Contributor

radarsh commented Oct 29, 2019

We use JSON based Swagger files in our project and it's quite common to have lines such as:

"url": {
    "type": "string",
    "pattern": "^:https?:\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+[-A-Za-z0-9+&@#/%=~_|]$",
    "description": "A URL"
}

Unfortunately such properties are not parsed by the plugin and throws the below error:

Could not generate Swagger UI
YAML decoding problem: while scanning a double-quoted scalar
in 'reader', line 853, column 32:
"pattern": "^:https?:\/\/[-A-Za-z0-9+&@#/%? ... 
^
found unknown escape character /(47)
in 'reader', line 853, column 43:
...           "pattern": "^:https?:\/\/[-A-Za-z0-9+&@#/%?=~_|!:,.;]+ ... 
^

The same Swagger files have worked previously until a certain update to the plugin broke it.

Just to add, the same Swagger file works fine on editor.swagger.io when I choose the "Don't convert to YAML" option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant