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.58k stars 8.96k forks source link

Support Deep Linking Page Scrolling on route updates for Single Page Applications #5970

Open bbusch19 opened 4 years ago

bbusch19 commented 4 years ago

Content & configuration

Swagger-UI configuration options:

 SwaggerUI({
   dom_id: '#swagger-ui',
   docExpansion: 'none',
   deepLinking: true,
 })

Is your feature request related to a problem?

I am trying to create my own side navigation for a Swagger-UI project. The problem is that with deepLinking: true, the correct section is only scrolled into view on initial page load.

Describe the solution you'd like

It would be great if the UI would scroll to the correct section on route changes instead of only firing on initialization for SPAs.

Additional context

I am using Vue for this project.

Aravin commented 4 years ago

Yes, it is much-needed feature.

I am embedding the Swagger document in the Docusuraus framework, the deep link is not working.

Without deep-link, it is difficult to share the particular spec to someone.