Last updated

Built-in rules

The built-in rules are the ones we use ourselves and think apply to the majority of APIs. Some have some additional configuration, but otherwise all you need to do is decide whether each rule should error, warn or be off.

All the built-in rules are listed here, roughly grouped by the OpenAPI object they apply to. The Special rules group contains rules that may apply to multiple objects or to the entire OpenAPI document.

Build configurable rules if the rule you need isn't listed.

List of available rules

Details of all the rules available "out of the box" with Redocly CLI are listed below. Visit each individual page for details of what the rule does, additional configuration options, and examples of it in use.

Special rules

Info

Operations

Parameters

Paths

Requests, Responses, and Schemas

Servers

Tags

Rule configuration syntax

To change your settings for any given rule, add or modify its corresponding entry in your Redocly configuration file.

You can specify global settings in the top-level rules object, or use per-API settings by adding a rules object under each API in apis.

You can format each entry in the rules object in one of the following ways:

  • Short syntax with single-line configuration rule-name: {severity}, where {severity} is one of error, warn or off. You can't configure additional rule options with this syntax.
apis:
  main:
    root: ./openapi/openapi.yaml
    rules:
      specific-api-rule: warn
rules:
  example-rule-name: error
  • Verbose syntax, where you can configure additional options for rules that support them.
apis:
  main:
    root: ./openapi/openapi.yaml
    rules:
      specific-api-rule:
        severity: warn
rules:
  example-rule-name:
    severity: error
    rule-option-one: value
    rule-option-two: value

Next steps