AsyncAPI linter rules
The linter reads AsyncAPI 3 documents; the reader rejects AsyncAPI 2 documents.
Rulesets
Rules
| Rule | What it checks | Since |
|---|---|---|
audience-defined | 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 | This rule checks that no channel address contains a query (?) or a fragment (#). | 0.12.0 |
channel-addresses-unique | 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 | 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 | 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 | This rule checks that the schemas of CloudEvents attributes say what the specification says of them. | 0.12.0 |
cloudevents/binding-headers | 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 | 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 | This rule checks whether complete contact information is present in an AsyncAPI document. | 0.9.0 |
id-defined | 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 | This rule checks whether the info object of an AsyncAPI document provides a description and a version. | 0.9.0 |
latest-version | This rule suggests the latest version of AsyncAPI, 3.1.0, to a document that declares an older one. | 0.12.0 |
license-defined | This rule checks whether the licensing information is present in an AsyncAPI document. | 0.9.0 |
operation-channel-in-channels | 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 | This rule checks whether every operation of an AsyncAPI document has a meaningful description. | 0.9.0 |
operation-messages-from-channel | 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 | This rule checks whether every operation of an AsyncAPI document is protected by a security requirement. | 0.9.0 |
operation-tags-defined | This rule checks whether every operation of an AsyncAPI document has at least one tag assigned. | 0.9.0 |
parameter-description-defined | This rule checks whether every channel parameter of an AsyncAPI document has a meaningful description. | 0.9.0 |
parameter-naming | 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 | This rule ensures that Markdown strings (descriptions) do not contain unsafe constructs like script tags or eval() calls. | 0.9.0 |
schema-constraints | This rule ensures that schema objects define constraints restricting the size of the underlying data. | 0.9.0 |
schema-datetime-suffix | This rule ensures that the names of date and time properties end with a common suffix. | 0.9.0 |
schema-enum-naming | 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 | This rule ensures that the enum lists of schema objects contain no duplicate values. | 0.9.0 |
schema-enum-types | 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 | This rule ensures that top-level schemas of an AsyncAPI document provide examples. | 0.9.0 |
schema-format-defined | This rule ensures that numeric schemas specify the precision of their values with a format. | 0.9.0 |
schema-format-deprecated | 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 | This rule ensures that the format of a schema is consistent with its type. | 0.9.0 |
schema-format-unknown | 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 | 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 | This rule ensures that object schemas explicitly disallow additional properties. | 0.9.0 |
schema-property-naming | This rule ensures that the names of schema properties adhere to a predefined naming convention. | 0.9.0 |
server-hosts | 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 | This rule checks whether at least one server is defined in an AsyncAPI document. | 0.9.0 |
spell-check | This rule checks the spelling of the texts written for humans: titles, summaries and descriptions. | 0.9.0 |
standard-media-types | This rule checks whether messages use only standard media types. | 0.9.0 |
tag-description-defined | This rule checks whether every tag of an AsyncAPI document has a meaningful description. | 0.9.0 |
tags-sorted | This rule checks whether the tags listed in info.tags are sorted by their names. | 0.9.0 |
tags-unique | This rule checks whether the names of the tags listed in info.tags are unique. | 0.9.0 |
unused-shared-component | This rule checks whether every shared component of an AsyncAPI document is actually used. | 0.9.0 |
Was this helpful?