swagger-api / swagger-api/swagger-ui

Button to toggle a preview of html returned in a response

Open
#6,847 4 comments 19 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Review the response-rendering behavior described in the issue and the referenced implementation commit 1344e49 first. Locate the existing Swagger UI response display entry point, then verify that a control can show and hide an inline HTML preview while preserving the default rendering behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.