Variables can have arbitrary values, or may be restricted to an enum. Unlike path parameters, server variables do not use a schema. Variables are indicated by in the server url, like so:ĭescription: Customer ID assigned by the service provider If the servers array is not provided or is empty, the server URL defaults to /:Īny part of the server URL – scheme, host name or its parts, port, subpath – can be parameterized using variables. Note: Server URL must not include query string parameters. If the server URL is relative, it is resolved against the server where the given OpenAPI definition file is hosted (more on that below). WebSocket schemes ws:// and wss:// from OpenAPI 2.0 are also supported in OpenAPI 3.0. The host can be a name or IP address (IPv4 or IPv6). Server URL format follows RFC 3986 and usually looks like this: You can also have multiple servers, for example, production and sandbox:ĭescription: Production server (uses live data)ĭescription: Sandbox server (uses test data) Server URL Format Each server has an url and an optional Markdown-formatted description. servers replaces the host, basePath and schemes keywords used in OpenAPI 2.0. In OpenAPI 3.0, you use the servers array to specify one or more base URLs for your API. ![]() For example, assuming the base URL of, the /users endpoint refers to. API Server and Base URLĪll API endpoints are relative to the base URL. If you use OpenAPI 2.0, see the OpenAPI 2.0 guide.
0 Comments
Leave a Reply. |