Skip to content

Remove link from Logo/Topbar #4527

@karstensgit

Description

@karstensgit

Q&A (please complete the following information)

  • OS: Win10
  • Browser: All
  • Version: --
  • Method of installation: npm (dist package)
  • Swagger-UI version: 3.14.0
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Swagger-UI configuration options:

SwaggerUI({
  ...
    presets: [
        SwaggerUIBundle.presets.apis,
        SwaggerUIStandalonePreset,
    ],
    plugins: [
        SwaggerUIBundle.plugins.DownloadUrl,
        DisableAuthorizePlugin, // custom plugin to disable auth button
        DisableValidatorPlugin //custom plugin to disable online validator badge
],
    layout: 'StandaloneLayout',
...
})

Screenshots

How can we help?

The Topbar in swagger-ui comes with the swagger logo in the top left corner. The logo is wrapped inside a <a href="#"></a> tag, which creates an absoulte link with the "#". Now, while this does not
trigger navigation away from the current route, what it does is change the current url to the base url of my (Angular 5) App and append the "#".

Because I have wrapped SwaggerUI inside a routed Angular Component, the url to the swagger view looks something like:
my-custom-app-url/swagger.
After clicking the link, the url changes to:
my-custom-app-url/#.

Is it possible to avoid this? Deactivating the link or even overwriting it would totally do the job for me.

Also clicking the link triggers a warning to my web-console (observed in Firefox, translated from german) "Empty string was given to getElementById()", which does not bother me too much but I guess it might be worth mentioning here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions