Authors:
@adamaltman
, Adam Altman (Redocly)
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.
Configured in redocly.yaml
, like this:
rules:
rule/info-description:
subject:
type: Info
property: description
assertions:
defined: true
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.