Skip to content

openapi with servers as relative path #565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dmnk89 opened this issue Mar 12, 2025 · 0 comments
Open

openapi with servers as relative path #565

dmnk89 opened this issue Mar 12, 2025 · 0 comments

Comments

@dmnk89
Copy link

dmnk89 commented Mar 12, 2025

when using openapi hosted by application server I expect that relative paths will resolve to the server host url instead of docs

The URLs in the servers array can be relative, such as /v2. In this case, the URL is resolved against the server that hosts the given OpenAPI definition.
https://swagger.io/docs/specification/v3_0/api-host-and-base-path/#relative-urls

example

docs.json

        "openapi": {
          "source": "https://api.my-host.com/openapi",
          "directory": "api-reference"
        }

/openapi

servers:
  - url: /api/v1

i expect that rendered docs will point to
https://api.my-host.com/api/v1

but they just call /api/v1 of hosted docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant