swagger-api / swagger-ui

Swagger UI is a collection of HTML, JavaScript, and CSS assets that dynamically generate beautiful documentation from a Swagger-compliant API.
https://swagger.io
Apache License 2.0
26.33k stars 8.92k forks source link

Button to toggle a preview of html returned in a response #6847

Open vdwees opened 3 years ago

vdwees commented 3 years ago

I am using Swagger UI to document a service, and one of the endpoints returns embeddable content. Swagger UI renders the code as HTML, for reasons described in https://github.com/swagger-api/swagger-ui/issues/1748 and https://github.com/swagger-api/swagger-ui/issues/3881. However, I found it useful to extend Swagger UI with a button to toggle rendering the html inline, so that it is easy to visualize and interact with the response from the server.

Screenshots are below. Notice the Show/Hide preview button in the bottom left corner. Its a small change that adds a really valuable feature without breaking any existing behaviour (vdwees@1344e49)

Would a formal PR be welcome?

image

image

smalagon15 commented 3 years ago

This would be awesome

qeleb commented 1 year ago

please do this

AmyChodorowski commented 1 year ago

Does anyone know a patch like this, but for the latest swagger-ui version

noor-tg commented 4 months ago

any news about this ?