Linter rulesSwagger 2.0 linter rules
Swagger 2.0 linter rules
Rulesets
Rules
| Rule | What it checks | Since |
|---|---|---|
audience-defined | This rule checks whether the intended audience of an API is declared in the x-audience extension of the info object of a Swagger 2.0 document. | 0.9.0 |
contact-defined | This rule checks whether complete contact information is present in a Swagger 2.0 document. | 0.9.0 |
host-defined | This rule checks whether a Swagger 2.0 document declares the host that serves the API. | 0.9.0 |
id-defined | This rule checks whether the info object of a Swagger 2.0 document has an identifier extension (x-id by default), and whether its value has the expected format (a UUID by default). | 0.9.0 |
info-defined | This rule checks whether the info object of a Swagger 2.0 document provides a description and a version. | 0.9.0 |
license-defined | This rule checks whether the licensing information is present in a Swagger 2.0 document. | 0.9.0 |
media-types-defined | This rule checks whether the operations of a Swagger 2.0 document that send or receive a body declare its media types. | 0.9.0 |
no-content-response-defined | This rule checks whether 204 No Content responses of a Swagger 2.0 document declare a body. | 0.9.0 |
operation-description-defined | This rule checks whether every operation of a Swagger 2.0 document has a meaningful description. | 0.9.0 |
operation-id-defined | This rule checks whether every operation of a Swagger 2.0 document has an operation ID. | 0.9.0 |
operation-id-unique | This rule checks whether the operation IDs of a Swagger 2.0 document are unique. | 0.9.0 |
operation-rate-limiting-defined | This rule checks whether the responses of Swagger 2.0 operations declare rate limiting headers. | 0.9.0 |
operation-security-defined | This rule checks whether every operation of a Swagger 2.0 document is covered by a security requirement. | 0.9.0 |
operation-success-response | This rule checks whether every operation of a Swagger 2.0 document declares at least one success response. | 0.9.0 |
operation-tags-defined | This rule checks whether every operation of a Swagger 2.0 document has at least one tag. | 0.9.0 |
parameter-description-defined | This rule checks whether every parameter of a Swagger 2.0 document has a meaningful description. | 0.9.0 |
parameter-naming | This rule checks whether parameter names of a Swagger 2.0 document follow a naming convention. | 0.9.0 |
parameters-unique | This rule checks whether the parameter lists of a Swagger 2.0 document contain duplicates. | 0.9.0 |
path-parameters-defined | This rule checks whether every parameter of a path template is declared as a path parameter. | 0.9.0 |
path-parameters-on-items | This rule checks whether path parameters are declared on path items rather than on individual operations. | 0.9.0 |
paths-max-count | This rule checks whether a Swagger 2.0 document defines more paths than a configured maximum. | 0.9.0 |
paths-max-depth | This rule checks whether the paths of a Swagger 2.0 document are nested deeper than a configured maximum. | 0.9.0 |
paths-sorted | This rule checks whether the paths of a Swagger 2.0 document are sorted. | 0.9.0 |
paths-unique | This rule checks whether a Swagger 2.0 document defines paths that are equivalent to each other. | 0.9.0 |
paths-well-formed | This rule checks whether the paths of a Swagger 2.0 document are well-formed. | 0.9.0 |
safe-markdown | This rule ensures that the GFM descriptions of a Swagger 2.0 document do not contain unsafe constructs like script elements or eval() calls. | 0.9.0 |
schema-constraints | This rule ensures that typed objects of a Swagger 2.0 document define constraints restricting the size of the underlying data. | 0.9.0 |
schema-datetime-suffix | This rule ensures that the names of date and date-time properties end with a common suffix. | 0.9.0 |
schema-enum-naming | This rule ensures that the string values of enum lists adhere to a predefined naming convention. | 0.9.0 |
schema-enum-no-duplicates | This rule ensures that enum lists do not contain duplicate values. | 0.9.0 |
schema-enum-types | This rule ensures that all values of an enum list match the declared type. | 0.9.0 |
schema-example-defined | This rule ensures that the schemas of a Swagger 2.0 document provide examples. | 0.9.0 |
schema-format-defined | This rule ensures that numeric objects declare the size 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 an object is one that applies to its type. | 0.9.0 |
schema-format-unknown | This rule reports a format of a Swagger 2.0 document which is neither in the OpenAPI format registry nor declared in openapi.custom_formats of the configuration file. | 0.10.0 |
schema-no-additional-properties | This rule ensures that object schemas do not accept arbitrary 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 |
schema-required-properties-defined | This rule checks that every name listed in required is declared in properties. | 0.9.0 |
schemes-secure | This rule checks whether a Swagger 2.0 document serves its API over secure transfer protocols only, and whether its host is written in lower case. | 0.9.0 |
spell-check | This rule checks the spelling of the texts of a Swagger 2.0 document written for humans: titles, summaries and descriptions. | 0.9.0 |
standard-media-types | This rule checks whether a Swagger 2.0 document uses only well-known media types. | 0.9.0 |
swagger-validation | This rule reports violations of the Swagger 2.0 specification that span several objects, and therefore cannot be detected while a single object is read. | 0.9.0 |
tag-description-defined | This rule checks whether each tag declared in the root tags array of a Swagger 2.0 document has a meaningful description. | 0.9.0 |
tags-sorted | This rule checks whether the tags in the root tags array of a Swagger 2.0 document are sorted by name. | 0.9.0 |
tags-unique | This rule checks whether the tags in the root tags array of a Swagger 2.0 document have unique names, comparing names case-insensitively. | 0.9.0 |
unused-request-body | This rule checks whether GET and HEAD operations of a Swagger 2.0 document declare a request body. | 0.9.0 |
unused-shared-component | This rule checks whether every shared object of a Swagger 2.0 document is actually used. | 0.9.0 |