Per-API configuration

The apis object is used to configure one or more APIs. Every API in the object is identified by its name and version in the format name@version. The version is optional, and when not provided, Redocly apps interpret it as latest by default. Every name@version combination listed in the object must be unique.

For every API listed in the object, you must provide the path to the OpenAPI description using the root property.

If rules, decorators, or preprocessors aren't defined for an API, root settings are used. If rules, decorators, or preprocessors are defined for an API, its settings apply together with the root configuration. If per-API and root settings modify the same properties, per-API settings overrides root settings.

Patterned properties

additional property
object (API object) non-empty

Specifies the name and version of an API associated with the root API description with the pattern {name}@{version}. If the version is omitted, Redocly apps interpret it as 'latest' by default.

root
required
string

The path to the root API description file of the specified API.

labels
Array of strings

Use it to assign one or more existing Redocly Workflows organization-wide labels to your APIs. You must have a Redocly Workflows account with an active organization, and add the top-level organization property to the configuration file. If you try to assign labels that don't already exist for your organization, Redocly apps display a warning in the output and only assigns the existing labels (if any).

object (Preprocessors object)

Change the severity level of any preprocessors in your extended configurations. Preprocessors run first during lint and bundle.

additional property
string or object

List each preprocessor by name. For example, do-this-first.

object (Rules object)

Change the severity level of any rules in your extended configurations. Some rules may also receive additional configurations. Rules run during the lint command after preprocessors. They run during the bundle command between preprocessors and decorators if the --lint option is used.

additional property
string or Rule configuration object (object)

List each rule by name. For example, no-empty-servers.

object

Used to enable or disable decorators. Decorators run during the bundle command after linting.

additional property
string or Decorator configuration object (object)

List each decorator by name. For example, remove-x-internal.

object
openapi
object

Defines theming and functionality for an API description. Supports the same format and options as the root openapi object. API-level configuration always overrides the root configuration.

mockServer
object

Defines mock server behavior for an API description. Supports the same format and options as the root mockServer object. API-level configuration always overrides the root configuration.

Example

Copy
Copied
apis:
  name@version:
    root: ./openapi/openapi.yaml
    labels:
      - production
    theme:
      openapi: {}
Important

Per-API configurations take priority over global settings.