swagger-api / swagger-api/swagger-ui

Markdown link open a new tab/window

Open
#3,473 5 comments 14 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P2 type: bug version: 3.x
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

  • swagger-ui version: v3.0.21
swagger: '2.0'
info:
  version: "1.0.0-alpha"
  title: Answer to life
  description: |

      # Documentation

      This endpoint can solve the problems of the world:
      [look at its specification](#/WorldEndpoint)

paths:
  #  endpoints
  /:
    get:
      summary: the answer is 42
      description: |
        # Information
          for understanding this endpoint you have to have a look at the
          [Documentation](#/Documentation)
      operationId: getanswer
      tags:
        - WorldEndpoint
      responses:
        200:
          description: The api information is returned. 

Using this example is impossible to have a normal navigation between the two generated paragraph.

The link from the "Documentation" section open a new tab/window.
The link from the endpoint it isn't referring the paragraph.

As a solution I would like to suggest these two things:

  • intercept the default href behaviour and add the "preventdefault" and the call to the "scrolltosource" (into the Markdown provider)
  • add ids to the h1 - h3 header in order to use the solution mentioned above.

the problem has been tested here: http://editor.swagger.io/#/

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

Reproduce the example in editor.swagger.io and start by locating the Markdown provider mentioned in the issue. Verify that links stay in the current window and navigate to the corresponding rendered heading; done means both the Documentation and endpoint links provide normal in-page navigation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation, frontend
Issue type
Bug
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.