{"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"extend-included-or-existing-configuration","__idx":0},"children":["Extend included or existing configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," to use the built-in configurations and other configuration files as the base settings."," ","If you don't ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"#priority-and-overrides"},"children":["override this base configuration"]},", it is used for all APIs specified in your configuration file."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you don't have a Redocly configuration file, Redocly CLI automatically uses the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recommended"]}," configuration."," ","To override the default settings, you can either configure different settings for specific rules in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rules"]}," object, or create your own configuration files and reference them in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list is structured as an array of strings."," ","It supports the following types of values:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Built-in ruleset name (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["minimal"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recommended"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["recommended-strict"]},")"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A plugin's registered configuration name"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Path or URL to another Redocly configuration file containing rules, preprocessors, decorators or custom plugins."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When providing values as URLs, they must be publicly accessible."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"extends:\n  - built-in-configuration-name\n  - local-plugin-name/configuration-name\n  - ./path/to/another/redocly-configuration.yaml\n  - https://url-to-remote/redocly.yaml\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["See also:"]}," Visit the detailed documentation on how to ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/cli/v2/custom-plugins/custom-config"},"children":["use custom plugins to set configuration"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"nested-configuration","__idx":1},"children":["Nested configuration"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Other configuration files linked in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list of your main Redocly configuration file may contain their own ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Custom plugins can't contain the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list because recursive extension is not supported in that case."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following examples illustrate configuration nesting with multiple configuration files."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," to the project ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redocly.yaml"]}," file:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"extends:\n  - custom.yaml\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Define another ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," and some additional rules in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["custom.yaml"]}," file referenced before:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"extends:\n  - nested.yaml\nrules:\n  tags-alphabetical: error\n  paths-kebab-case: warn\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["nested.yaml"]}," file is another Redocly configuration file containing ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rules"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"rules:\n  path-parameters-defined: error\n  tag-description: warn\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"priority-and-overrides","__idx":2},"children":["Priority and overrides"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In case of conflict, individual API settings specified in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["apis"]}," object always override settings globally specified."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Redocly CLI applies the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," configuration in the order in which items are listed, from top to bottom."," ","The further down an item appears, the higher its priority."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In case of conflicting settings, content in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rules"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decorators"]}," objects always overrides any content in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the following example, the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rules"]}," object and another configuration file in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list configure the same rule (",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tags-alphabetical"]},")."," ","Due to the conflict, priority goes to the inline ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rules"]}," over the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list, and the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tags-alphabetical"]}," has a resulting severity level of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," first in ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redocly.yaml"]},", plus any other rules you want to add to the base configuration"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"extends:\n  - custom.yaml\nrules:\n  tags-alphabetical: error\n  paths-kebab-case: warn\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Set up a base configuration with the rules you want to re-use. In this example, the file is called ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["custom.yaml"]}," (example below) and it's referenced from ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redocly.yaml"]}," (above):"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"rules:\n  tags-alphabetical: warn\n  path-parameters-defined: warn\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The same approach applies within the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list."," ","If you have multiple configurations that try to configure the same rule, only the setting from the last configuration in the list applies."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In the following example, Redocly CLI uses the setting for the conflicting ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tags-alphabetical"]}," rule from the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["testing.yaml"]}," file, because that file is further down in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This means you can control the priority of configurations by reordering them in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list, and override all lint configurations (custom and built-in) by specifying individual rule settings in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rules"]}," object."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The main ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redocly.yaml"]}," file:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"extends:\n  - custom.yaml\n  - testing.yaml\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["custom.yaml"]}," file is included first:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"rules:\n  tags-alphabetical: warn\n  paths-kebab-case: warn\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Then the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["testing.yaml"]}," file, which overrides because it's referenced second:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"rules:\n  tags-alphabetical: error\n  path-parameters-defined: warn\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["extends"]}," list with the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["rules"]}," configuration to build up the rulesets and overrides as appropriate for your needs."]}]},"frontmatter":{},"tagList":[],"title":"Extend included or existing configuration","lastModified":"2025-05-28T16:01:32.000Z"}