Skip to content

Latest commit

 

History

History

info-description

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

Info must include Description

Authors:

What this does and why

Ensures that the info section includes a description field. Including good metadata with your API can help discoverability, so you might like to include this rule in your ruleset.

This rule is an equivalent to Spectral's info-description rule, easily expressed in Redocly configurable rule syntax.

Code

Configured in redocly.yaml, like this:

rules:
  rule/info-description:
    subject:
      type: Info
      property: description
    assertions:
      defined: true

Examples

An OpenAPI specification without a description in info will cause an error:

openapi: 3.1.0
info:
  title: A non-descriptive API
paths: {}

Will give an error:

rule/info-description failed because the Info description didn't meet the assertions: Should be defined

If you add a description, the check will pass.

References