Skip to content

Deep linking does not work for operations with tags containing spaces #4120

@linelson

Description

@linelson
Q A
Bug or feature request? Bug
Which Swagger/OpenAPI version? 2.0
Which Swagger-UI version? 3.9.1 (current)
How did you install Swagger-UI? Built using npm run build, copied dist folder
Which browser & version? Chrome 63.0.3239.132, Edge 41.16299.15.0
Which operating system? Windows 10

Demonstration API definition

Change the tag "pet" in the sample petstore.json to be "pet v1" or any other value containing a space.

Expected Behavior

Example operation: POST /pet with the tag "pet v1"
The link http://localhost:3200/#/pet_v1/addPet (replace localhost with whatever the host is) should result in the UI scrolling to the operation POST /pet.

Current Behavior

The UI does not scroll to the linked operation when the operation tag contains a space. In this example, the id of the html element for the operation POST /pet is "operations-pet v1-addPet".

Possible Solution

In this example, the element id of the operation POST /pet is "operations-pet v1-addPet". The space in this id breaks linking. The element id in this example should probably instead be "operations-pet_v1-addPet".

Context

Users expect that the linked operation should be scrolled to.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions