swagger-api / swagger-api/swagger-ui

DeepLinking breaks angular 8 routing

Open
#5,811 5 comments 8 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

Hi,
I have a very annoying problem with angular 8 and swagger deepLinking feature, which i want to use for sharing exact tag/operation description.

My swagger-UI configuration options:
this.ui = SwaggerUIBundle({
url: "http://petstore.swagger.io/v2/swagger.json",
domNode: this.el.nativeElement.querySelector('.swagger-container'),
deepLinking: true,
filter: true,
presets: [
SwaggerUIBundle.presets.apis,
],
validatorUrl: null,
plugins: [
...
],
docExpansion: 'none',
displayOperationId: true
});

The problem is:
When the deepLinkng is set to true, the deep-linking plugin helper (setHash), overrides the url: host/pathname to host/#/tag-clicked.

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 by examining the deep-linking plugin helper setHash and the Angular 8 integration shown in the report. Reproduce the configuration with deepLinking enabled and verify how the host/pathname changes when a tag or operation is selected. Done means preserving Angular routing while still sharing the selected Swagger UI location.

Written by the indexing model from the issue text.

Assessment

Tech stack
angular, javascript
Domain
frontend, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.