# info-defined

Source: https://apigenie.pl/docs/linter/swagger/rules/info-defined

A rule of the Swagger 2.0 linter, which reads Swagger 2.0 documents; OpenAPI 3 documents go to the OpenAPI linter. Since 0.9.0. In the rulesets: Recommended at error, Strict at error, All at error.

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 empty` when `info.description` is missing
  or empty,
- `Info version is empty` when `info.version` is an empty string.

The title is required by the Swagger specification itself and is not checked
by this rule.

The OpenAPI and AsyncAPI linters have rules of the same name,
[info-defined](/docs/linter/openapi/rules/info-defined) and
[info-defined](/docs/linter/asyncapi/rules/info-defined).

## Examples

**Good**.

```yaml
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.

```yaml
swagger: '2.0'
info:
  title: Pet Store
  version: ''
paths: {}
```
