0

I have used apispec and flask-swagger-ui with flask.

The flask route returns a html page but on swagger UI I could only see the html code not the actual page.

Is there any way to get the html page displayed on swagger UI.

the flask code along with the APIspec documentation

the flask code along with the APIspec documentation

swagger UI response

swagger UI response

expected response

expected response

0

1 Answer 1

1

OpenAPI describes the text/code response your API will return. Swagger UI is correctly displaying the body of your response, not how that response will be interpreted and displayed by a particular consumer of your API (in this case a web browser). What you are trying to do is outside the intended scope of this tool. See this issue in which the developers rejected this idea for reasons of security.

Alternative:

Use the description property to include a link to additional documentation that includes images or screenshots of what this response would look like.

Sign up to request clarification or add additional context in comments.

1 Comment

Okay, got it so swagger does not have this feature because of security concerns.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.