swagger-api / swagger-api/swagger-ui

swagger-ui route in SPA

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

Nobody has claimed this yet.

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

Description

Q&A (please complete the following information)
  • OS: [macOS]
  • Browser: [chrome]
  • Version: [latest]
  • Method of installation: [npm]
  • Swagger-UI version: [3.23.4]
  • Swagger/OpenAPI version: [OpenAPI 3.0]
Content & configuration

Swagger/OpenAPI definition: petstore oas 3 (not important)
Swagger-UI configuration options (very basic, nothing specific):

SwaggerUI({
  dom_id: '#swaggerContainer',
  spec: swagger,
  docExpansion: 'list',
});
Screenshots

none

How can we help?

We are rendering SwaggerUI in one of our pages in SPA (React + React-router), lets say https://my.awesome.app/path/to/page/1 but as soon as I navigate to this page swagger component changing route (probably when it renders) to https://my.awesome.app/# which is breaking our users experience.
Any guidelines / hints how to prevent this from happening?

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

Start with the SwaggerUI configuration shown in the issue and the React/React-router page navigation that renders it. Reproduce the transition to the page with the OpenAPI 3 petstore definition, then trace which Swagger UI behavior adds the /# route; done means the SPA URL remains unchanged when the component renders.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend, web-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.