# latest-version

Source: https://api-genie.dev/docs/linter/asyncapi/rules/latest-version

A rule of the AsyncAPI linter, which reads AsyncAPI 3 documents; the reader rejects AsyncAPI 2 documents. Since 0.12.0. In the rulesets: Strict at hint, All at hint.

This rule suggests the latest version of AsyncAPI, 3.1.0, to a document that declares an older
one.

## Rule details

AsyncAPI 3.1 is a minor release of 3.0, so a 3.0 document stays valid when its `asyncapi` field
says 3.1.0. The rule compares that field with 3.1.0 as versions: `3.1.0` and later pass, `3.0.0`
and `3.1.0-rc1` get the suggestion. It reports `AsyncAPI <version> is not the latest version of
the specification, 3.1.0 is` on the document.

The rule is not in `recommended`. It is the counterpart of the AsyncAPI parser's
`asyncapi-latest-version`.

Turn it off while a tool that reads your documents supports only AsyncAPI 3.0.

## Examples

**Good**.

```yaml
asyncapi: 3.1.0
info:
  title: Pet Events
  version: 1.0.0
```

**Bad**. 3.0.0 is an older version.

```yaml
asyncapi: 3.0.0
info:
  title: Pet Events
  version: 1.0.0
```
