# AsyncAPI linter rules

Source: https://apigenie.pl/docs/linter/asyncapi
See also: [Linter rules](https://apigenie.pl/docs/linter.md), [Recommended ruleset](https://apigenie.pl/docs/linter/asyncapi/rulesets/recommended.md), [Strict ruleset](https://apigenie.pl/docs/linter/asyncapi/rulesets/strict.md), [All ruleset](https://apigenie.pl/docs/linter/asyncapi/rulesets/all.md), [CloudEvents ruleset](https://apigenie.pl/docs/linter/asyncapi/rulesets/cloudevents.md).

The linter reads AsyncAPI 3 documents; the reader rejects AsyncAPI 2 documents.

## Rulesets

- [Recommended ruleset](/docs/linter/asyncapi/rulesets/recommended.md)
- [Strict ruleset](/docs/linter/asyncapi/rulesets/strict.md)
- [All ruleset](/docs/linter/asyncapi/rulesets/all.md)
- [CloudEvents ruleset](/docs/linter/asyncapi/rulesets/cloudevents.md)

## Rules

| Rule | What it checks | Since |
| --- | --- | --- |
| [`audience-defined`](/docs/linter/asyncapi/rules/audience-defined.md) | This rule checks whether the intended audience of an API is declared in the `#/info/x-audience` extension of an AsyncAPI document. | 0.9.0 |
| [`channel-address-no-query`](/docs/linter/asyncapi/rules/channel-address-no-query.md) | This rule checks that no channel address contains a query (`?`) or a fragment (`#`). | 0.12.0 |
| [`channel-addresses-unique`](/docs/linter/asyncapi/rules/channel-addresses-unique.md) | This rule checks that no two channels of an AsyncAPI document share the same address, including addresses that differ only by the names of their parameters. | 0.9.0 |
| [`channel-parameters-defined`](/docs/linter/asyncapi/rules/channel-parameters-defined.md) | This rule checks that the parameters used in a channel address are declared in the channel's `parameters` map, and that the map declares no parameters the address does not use. | 0.9.0 |
| [`channel-servers-in-servers`](/docs/linter/asyncapi/rules/channel-servers-in-servers.md) | This rule checks that the servers of a channel under the root `channels` are references to servers under the root `servers`. | 0.12.0 |
| [`cloudevents/attribute-schemas`](/docs/linter/asyncapi/rules/cloudevents-attribute-schemas.md) | This rule checks that the schemas of CloudEvents attributes say what the specification says of them. | 0.12.0 |
| [`cloudevents/binding-headers`](/docs/linter/asyncapi/rules/cloudevents-binding-headers.md) | This rule checks that the attribute headers of binary-mode CloudEvents use the prefix of the protocol their channel is served over. | 0.12.0 |
| [`cloudevents/required-attributes`](/docs/linter/asyncapi/rules/cloudevents-required-attributes.md) | This rule checks that every CloudEvents message declares and requires the four attributes every event has: `id`, `source`, `specversion` and `type`. | 0.12.0 |
| [`contact-defined`](/docs/linter/asyncapi/rules/contact-defined.md) | This rule checks whether complete contact information is present in an AsyncAPI document. | 0.9.0 |
| [`id-defined`](/docs/linter/asyncapi/rules/id-defined.md) | This rule checks whether the application identifier (the root `id` field) is present in an AsyncAPI document, and whether its value matches the expected format. | 0.9.0 |
| [`info-defined`](/docs/linter/asyncapi/rules/info-defined.md) | This rule checks whether the info object of an AsyncAPI document provides a description and a version. | 0.9.0 |
| [`latest-version`](/docs/linter/asyncapi/rules/latest-version.md) | This rule suggests the latest version of AsyncAPI, 3.1.0, to a document that declares an older one. | 0.12.0 |
| [`license-defined`](/docs/linter/asyncapi/rules/license-defined.md) | This rule checks whether the licensing information is present in an AsyncAPI document. | 0.9.0 |
| [`operation-channel-in-channels`](/docs/linter/asyncapi/rules/operation-channel-in-channels.md) | This rule checks that the channel of an operation under the root `operations` is a reference to a channel under the root `channels`. | 0.12.0 |
| [`operation-description-defined`](/docs/linter/asyncapi/rules/operation-description-defined.md) | This rule checks whether every operation of an AsyncAPI document has a meaningful description. | 0.9.0 |
| [`operation-messages-from-channel`](/docs/linter/asyncapi/rules/operation-messages-from-channel.md) | This rule checks that the messages of an operation, and of its reply, are references to messages of the channel that the operation, or the reply, references. | 0.12.0 |
| [`operation-security-defined`](/docs/linter/asyncapi/rules/operation-security-defined.md) | This rule checks whether every operation of an AsyncAPI document is protected by a security requirement. | 0.9.0 |
| [`operation-tags-defined`](/docs/linter/asyncapi/rules/operation-tags-defined.md) | This rule checks whether every operation of an AsyncAPI document has at least one tag assigned. | 0.9.0 |
| [`parameter-description-defined`](/docs/linter/asyncapi/rules/parameter-description-defined.md) | This rule checks whether every channel parameter of an AsyncAPI document has a meaningful description. | 0.9.0 |
| [`parameter-naming`](/docs/linter/asyncapi/rules/parameter-naming.md) | This rule checks all channel parameters in an AsyncAPI document and warns if their names do not adhere to the specified naming convention. | 0.9.0 |
| [`safe-markdown`](/docs/linter/asyncapi/rules/safe-markdown.md) | This rule ensures that Markdown strings (descriptions) do not contain unsafe constructs like script tags or `eval()` calls. | 0.9.0 |
| [`schema-constraints`](/docs/linter/asyncapi/rules/schema-constraints.md) | This rule ensures that schema objects define constraints restricting the size of the underlying data. | 0.9.0 |
| [`schema-datetime-suffix`](/docs/linter/asyncapi/rules/schema-datetime-suffix.md) | This rule ensures that the names of date and time properties end with a common suffix. | 0.9.0 |
| [`schema-enum-naming`](/docs/linter/asyncapi/rules/schema-enum-naming.md) | This rule ensures that all string values defined in the `enum` properties of schema objects adhere to a predefined naming convention. | 0.9.0 |
| [`schema-enum-no-duplicates`](/docs/linter/asyncapi/rules/schema-enum-no-duplicates.md) | This rule ensures that the `enum` lists of schema objects contain no duplicate values. | 0.9.0 |
| [`schema-enum-types`](/docs/linter/asyncapi/rules/schema-enum-types.md) | This rule ensures that the values listed in the `enum` of a schema are allowed by the schema's `type`. | 0.9.0 |
| [`schema-example-defined`](/docs/linter/asyncapi/rules/schema-example-defined.md) | This rule ensures that top-level schemas of an AsyncAPI document provide examples. | 0.9.0 |
| [`schema-format-defined`](/docs/linter/asyncapi/rules/schema-format-defined.md) | This rule ensures that numeric schemas specify the precision of their values with a `format`. | 0.9.0 |
| [`schema-format-deprecated`](/docs/linter/asyncapi/rules/schema-format-deprecated.md) | This rule reports the formats which the OpenAPI format registry marks as deprecated from OpenAPI 3.1, and names what replaces them. | 0.10.0 |
| [`schema-format-type-mismatch`](/docs/linter/asyncapi/rules/schema-format-type-mismatch.md) | This rule ensures that the `format` of a schema is consistent with its `type`. | 0.9.0 |
| [`schema-format-unknown`](/docs/linter/asyncapi/rules/schema-format-unknown.md) | This rule reports a `format` of an AsyncAPI document which is neither in the OpenAPI format registry nor declared in `openapi.custom_formats` of the configuration file. | 0.10.0 |
| [`schema-keyword-support`](/docs/linter/asyncapi/rules/schema-keyword-support.md) | This rule reports schema keywords that the tools consuming the document are unlikely to support, and suggests the rewrite where one exists. | 0.11.0 |
| [`schema-no-additional-properties`](/docs/linter/asyncapi/rules/schema-no-additional-properties.md) | This rule ensures that object schemas explicitly disallow additional properties. | 0.9.0 |
| [`schema-property-naming`](/docs/linter/asyncapi/rules/schema-property-naming.md) | This rule ensures that the names of schema properties adhere to a predefined naming convention. | 0.9.0 |
| [`server-hosts`](/docs/linter/asyncapi/rules/server-hosts.md) | This rule checks that the servers of an AsyncAPI document have well-formed hosts and protocols, and that they use secure protocols. | 0.9.0 |
| [`servers-defined`](/docs/linter/asyncapi/rules/servers-defined.md) | This rule checks whether at least one server is defined in an AsyncAPI document. | 0.9.0 |
| [`spell-check`](/docs/linter/asyncapi/rules/spell-check.md) | This rule checks the spelling of the texts written for humans: titles, summaries and descriptions. | 0.9.0 |
| [`standard-media-types`](/docs/linter/asyncapi/rules/standard-media-types.md) | This rule checks whether messages use only standard media types. | 0.9.0 |
| [`tag-description-defined`](/docs/linter/asyncapi/rules/tag-description-defined.md) | This rule checks whether every tag of an AsyncAPI document has a meaningful description. | 0.9.0 |
| [`tags-sorted`](/docs/linter/asyncapi/rules/tags-sorted.md) | This rule checks whether the tags listed in `info.tags` are sorted by their names. | 0.9.0 |
| [`tags-unique`](/docs/linter/asyncapi/rules/tags-unique.md) | This rule checks whether the names of the tags listed in `info.tags` are unique. | 0.9.0 |
| [`unused-shared-component`](/docs/linter/asyncapi/rules/unused-shared-component.md) | This rule checks whether every shared component of an AsyncAPI document is actually used. | 0.9.0 |
