Forum Discussion
KJans
Staff
The Swagger spec supports overriding servers for a different path or operation level: see https://swagger.io/docs/specification/api-host-and-base-path/
for this quote and an example:
Overriding Servers
The global servers array can be overridden on the path level or operation level. This is handy if some endpoints use a different server or base path than the rest of the API. Common examples are:
- Different base URL for file upload and download operations,
- Deprecated but still functional endpoints.
mhiggins
3 years agoStaff
Does this help:
servers:
- description: Live servers
url: 'https://{host}/v1'
variables:
host:
enum:
- 'test.book.com'
- 'staging.book.com'
- 'sandbox.book.com'
default: 'test.book.com'
Related Content
Recent Discussions
- 13 days agotobyclements