Message "can't parse JSON. Raw result:" added to response body

27,547

The cause of the anomalous message, I was told, is because application/json is the content media said to be returned in the server's response header. See the header here: enter image description here

The response is actually a text file -- not JSON. The sending server is incorrectly configured. Swagger-UI runtime response handler determines whether the response is valid. So Swagger-UI outputs the "can't parse JSON..." message.

Because of the error, the output to local storage function on the browser is not performed.

For more details, refer to the Swagger-UI issue #4098.

Share:
27,547
Mike
Author by

Mike

Retired - NOT!... I still spend my days writing code! Most recent contribution is the the GitHub ndexbio/openapi-specification repository. The application runs at http://openapi.ndextools.org. My zen is to integrate new heterogeneous software technologies into tools that absolutely "WOW!" software developers, scientists and academicians. This involves scouting out new open-source projects, and making them "play nice" with other open-source code bases. While I was once paid to do fun stuff like this, today I do it for free.

Updated on September 28, 2020

Comments

  • Mike
    Mike over 3 years

    I'm trying to define a file download endpoint using the OpenAPI spec (v3). I am facing two problems. 1) the file is not being downloaded 2) within swagger-ui, the response body shows a message that isn't produced by the server (i.e. can't parse JSON. Raw result:"

    Anyone have a clue as to what I am doing wrong?

    YAML code snapshot: enter image description here

    Output result from swagger-ui running on an AWS server. enter image description here