Skip to content
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

Servers/Base URL not being overridden at path or operation level #459

Open
jeffski opened this issue Jul 20, 2021 · 1 comment
Open

Servers/Base URL not being overridden at path or operation level #459

jeffski opened this issue Jul 20, 2021 · 1 comment
Assignees
Labels

Comments

@jeffski
Copy link
Contributor

jeffski commented Jul 20, 2021

Describe the bug
According to the docs here: https://swagger.io/docs/specification/api-host-and-base-path/#overriding, it should be possible to override the global servers setting at the path or operation level. As far as I can tell the global URL set under servers is always used and can not be overridden in the code examples, or mentioned anywhere in the generated markdown.

As an example if I set global servers like this:

servers:
  - url: "https://api.domain.com/"

then, override it like this in a path:

paths:
  books/{id}
    get:
      servers:
        - url: https://legacy.domain.com/

Then the code examples all still use the global servers url, like:

curl -X GET https://api.domain.com/books/{id} \

Expected behavior
I would expect to see the code examples use the overridden value:

curl -X GET https://legacy.domain.com/books/{id} \

Also somewhere in the body of the documentation it should show the url/server for the request.

Versions:

  • Node.js v12.18.3
@MikeRalphson MikeRalphson self-assigned this Jul 20, 2021
@MikeRalphson
Copy link
Contributor

Thanks for the report. Confirmed.

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

No branches or pull requests

2 participants