{"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"decorators","__idx":0},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decorators"]}]},{"$$mdtype":"Tag","name":"ConfigOptionRequirements","attributes":{"products":["Realm","Redoc","Revel","Reef","Redocly CLI"],"plans":["Community","Pro","Enterprise","Enterprise+"]},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"introduction","__idx":1},"children":["Introduction"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decorators"]}," configuration section defines the transformation steps that are applied to your API description when it is bundled."," ","On this page you can find configuration for ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/cli/decorators"},"children":["built-in decorators"]}," and ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/cli/custom-plugins/custom-decorators"},"children":["decorators from custom plugins"]},"."," ","You can use the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decorators"]}," block at the root of a configuration file, or inside an ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/realm/config/apis"},"children":["API-specific section"]},"."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"options","__idx":2},"children":["Options"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["{decorator name}"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string | ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"#decorator-object"},"children":["Decorator object"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["REQUIRED"]},"."," ","You can add as many decorators as you wish."," ","The keys must be either built-in decorators (for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["info-description-override"]},"), or a decorator from a plugin (for example ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tags-plugin/no-unused-tags"]},")."," ","Set the value to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["on"]}," or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["off"]}," to enable or disable a decorator."," ","You can also use a ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"#decorator-object"},"children":["Decorator object"]}," to configure additional options for a specific decorator."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"decorator-object","__idx":3},"children":["Decorator object"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Option"},"children":["Option"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Type"},"children":["Type"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Description"},"children":["Description"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["{additional properties}"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["any"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Some decorators support additional configuration, check the documentation for each specific decorator to discover the values that can be used."," ","For example the ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/cli/configuration/reference/decorators#decorator-object"},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["filter-out"]}," decorator"]}," supports ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["property"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["value"]}," settings for what to filter."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["severity"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["string"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Severity level of any problems reported with this decorator."," ","Setting this option is usually only useful for troubleshooting purposes."," ","The value must be one of ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["error"]},", ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["warn"]},", or ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["off"]},", where ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["off"]}," disables the decorator."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"examples","__idx":4},"children":["Examples"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["This section covers some examples and common use cases."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-built-in-decorators","__idx":5},"children":["Configure built-in decorators"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Pick and mix the built-in decorators in your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["redocly.yaml"]}," file as you need to."," ","The following example enables the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["remove-unused-components"]}," decorator, and uses ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["info-override"]}," to update the title:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"decorators:\n  remove-unused-components: on\n  info-override:\n    title: Better title than before\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["info-override"]}," decorator accepts some additional configuration."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"configure-decorators-from-custom-plugins","__idx":6},"children":["Configure decorators from custom plugins"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Redocly also supports ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/cli/custom-plugins/custom-rules"},"children":["custom plugins"]}," for advanced users."," ","Decorators in custom plugins are also configured in the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["decorators"]}," section of the configuration file, using the plugin's module name as a prefix."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The following example shows enabling a decorator called ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["alphabetical"]}," from a plugin named ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["tag-sorting"]},":"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"yaml","header":{"controls":{"copy":{}}},"source":"plugins:\n  - './tag-sorting.js'\n\ndecorators:\n  tag-sorting/alphabetical: on\n","lang":"yaml"},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The example includes adding the plugin, partly to remind you that this is also needed."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"resources","__idx":7},"children":["Resources"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/realm/config/apis"},"children":["APIs configuration"]}]}," - Set per-API configuration options in redocly.yaml for granular control over different API specifications"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/realm/config/rules"},"children":["Rules configuration"]}]}," - Define linting rules that work with decorators for comprehensive API validation and transformation"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/cli/decorators"},"children":["Decorators documentation"]}]}," - Complete guide to decorators for transforming and modifying OpenAPI documents during processing"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To build your own decorators, you can use ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://redocly.com/docs/cli/custom-plugins/custom-decorators"},"children":["custom plugins"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["The ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"https://github.com/Redocly/redocly-cli-cookbook"},"children":["Redocly CLI cookbook"]}," is a great resource for learning and sharing decorators and custom plugins."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Explore other ",{"$$mdtype":"Tag","name":"Link","attributes":{"href":"/docs/realm/config"},"children":["configuration options"]}," for your project."]}]}]},"frontmatter":{"products":["Realm","Redoc","Revel","Reef","Redocly CLI"],"plans":["Community","Pro","Enterprise","Enterprise+"],"description":"Define transformation steps applied to your API description when it is bundled."},"tagList":["configOptionRequirements","table"],"title":"decorators","lastModified":"2026-08-24T16:21:33.000Z"}