Linter rulesSwagger 2.0info-defined
info-defined
Since 0.9.0
This rule checks whether the info object of a Swagger 2.0 document provides a description and a version.
Rule Details
The info object is the first thing readers of an API see. Besides the mandatory title, it should explain what the application does and which version of the API is being described.
The info-defined rule reports:
Info description is missing or emptywheninfo.descriptionis missing or empty,Info version is emptywheninfo.versionis an empty string.
The title is required by the Swagger specification itself and is not checked by this rule.
Configuration
None.
Examples
Good.
swagger: '2.0'
info:
title: Pet Store
version: 1.0.0
description: Manages the pets of a shelter and their adoptions.
paths: {}
Bad. The document does not explain what the API does, and its version is empty.
swagger: '2.0'
info:
title: Pet Store
version: ''
paths: {}
When Not to Use It
We recommend to always enable this rule.
Compatibility
This rule is compatible with Swagger 2.0 documents. OpenAPI 3.x and AsyncAPI
documents are linted by the OpenAPI and AsyncAPI linters, which have their own
info-defined rules.