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.

Q&A (please complete the following information)

  • OS: Windows 10 version 1709
  • Browser: Edge
  • Version: 41.16299.611.0
  • Method of installation: [e.g. npm, dist assets]
  • Swagger-UI version: 3.18
  • Swagger/OpenAPI version: [e.g. Swagger 2.0, OpenAPI 3.0]

Content & configuration

Example Swagger/OpenAPI definition:

# your YAML here

Swagger-UI configuration options:

SwaggerUI({
  // your config options here
})
?yourQueryStringConfig

Describe the bug you’re encountering

To reproduce…

Steps to reproduce the behavior:

  1. Click the execute button for a Get method
  2. The response that comes back is “can’t parse JSON”

Expected behavior

The JSON that is returned loads

Screenshots

Additional context or thoughts

If I hit the endpoint in the browser directly valid JSON is returned. I put the JSON in a validation tool and it came back as being valid. I found a post that indicated that this needed to be added to the web.config:

<add name="Access-Control-Expose-Headers" value="Content-Disposition"/>

That didn’t solve the problem.

This does work in IE11 and Chrome, just not Edge.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
calmdevcommented, Sep 6, 2018

Hey, out of curiosity I tried also using Windows 10 with Edge (using version 42 instead of 41 though) and didn’t have any issues with JSON response parsing. I used browserstack which lets you test IE edge for free. Test was against an api using the OAS 3 spec with swagger-ui 3.18.2

0reactions
shockeycommented, Nov 26, 2018

@jlw0, glad to hear it worked out!

Closing - on the whole, this seems like an issue caused by an old version of Edge.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't parse JSON error - Scripting Support
print(Admins) works correctly and prints the pastebin, but when I attempt to call JSONDecode on Admins it says it can't parse the JSON....
Read more >
javascript - Can't parse JSON response
Your response is an object containing one property named "AgApplyTableE*!", which is an array that contains one element, which is an object ...
Read more >
SyntaxError: JSON.parse: bad parsing - JavaScript | MDN
JSON.parse() parses a string as JSON. This string has to be valid JSON and will throw this error if incorrect syntax was encountered....
Read more >
JSON Exception Error Not able to Parse JSON
Hi Gunasekaren, Correct. In running a Gt request to Analytics plus and the Returning JSON will not parse. its failing on the client...
Read more >
Codable: Can't Parse JSON File Swift Xcode 12
I am trying to parse a JSON file that has this structure: Code Block. {. "species":[. {. "name":"Aglais io",. "info": {. "family":"Nymphalidae",.
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