swagger-api / swagger-api/swagger-ui

Detecting default server url

Open
#4,751 11 comments 7 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cat: try-it-out specification: 3.x type: enhancement version: 3.x Workaround available
Dominant language
JavaScript
Stars
29k
Forks
9.3k
Avg merge
2d 23h
Merged PRs (30d)
25

Description

Is your feature request related to a problem?

We have different server urls: localhost, review apps, staging and production. Everytime one uses
swagger ui, they have to pick correct server first. Currently default server url is the first configured, this can be confusing since swagger is sending request somewhere else, getting one to think something is wrong with the current url.

Describe the solution you'd like

It would be intuitive if server url was picked to match the browser url from where
swagger ui is served (if it does match).

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

The issue names Swagger UI's configured server selection but no files, tests, or entry points. Start by locating the logic that chooses the first configured server and the code exposing the browser URL; verify behavior when the browser URL matches a configured server and when it does not. Done means Swagger UI selects the matching server by default without changing the fallback behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.