Compatibility warning
These specification extensions are supported only in OpenAPI 2.0. For OpenAPI 3.0 and later, use the servers
section.
Use x-servers
in your OpenAPI 2.0 documents to define one or more target hosts for the API.
This specification extension provides compatibility via backporting from the OpenAPI 3.0 servers
object. It doesn't support templates.
Use the x-servers
extension in the root OpenAPI object.
Option | Type | Description |
---|---|---|
x-servers | [ Server Object ] | A list of server objects used to add one or more target hosts for the API. |
The following example show how to adds development and staging hosts to OpenAPi description.
swagger: '2.0'
x-servers:
- url: https://development.example.com/v1
description: Development server
- url: https://staging.example.com/v1
description: Staging server
- Mock server configuration - Configure mock server settings to complement server definitions for API testing and development
- Show extensions configuration - Control which extensions are included in your API reference documentation for optimal presentation
- OpenAPI configuration settings - Complete reference for all available OpenAPI configuration options and customization settings
- Supported OpenAPI extensions - Complete list of all OpenAPI extensions supported by Redocly for enhanced API documentation