API servers (Environments)
In OpenAPI 3.0, you use the servers array to specify one or more base URLs for your API.
-
Each server has a
urland an optionaldescription. -
You can also have multiple servers, for example, production and sandbox.
Allowed OpenAPI Extensions
Extensions (also referred to as Adeptia extensions) are custom properties that start with x-adeptia. They can be used to describe extra functionality that is not covered by the standard OpenAPI Specification.
Extension: Environment-Specific Authentication Definitions
x-adeptia-securitySchemes
This extension allows separate definitions of authentications for different environments.
-
Each environment may have its own authentication endpoints.
-
It's optional; if defined, only the authentications specified here apply to the specified environment.
-
If not defined, global authentications apply to all environments.
The x-adeptia-securitySchemes must have a reference to a security scheme defined in the specification.
-
To understand authentication strategies and how security scheme is applied, refer to the document Authentication strategies.
-
It's represented as an array, allowing you to specify multiple references to the security scheme.
This example specifies that:
-
For the Sandbox server, the security scheme is
OAuth2SandBoxas defined at'#/components/securitySchemes/OAuth2SandBox'. -
For the Production server, the security scheme is
OAuth2as defined at'#/components/securitySchemes/OAuth2'.
Extension: URL Templating
x-adeptia-parameters
Any part of the server URL – host name or its parts, subpath – can be parameterized using parameters.
Here is the description of the fields:
| Field name | Type | Description |
|---|---|---|
| name | string | The name of the parameter. |
| description | string | A description of the parameter. |
| fetchFrom | string |
|
| paramName | string |
|
Extension: Environment Type
x-adeptia-environment
Specify the environment type that will appear in the Adeptia Account creation UI in the Environment field.