Define & Validate APIsValidation RulesetsOpenAPI Rulesets
OpenAPI v3 Syntax Linting
Linting checks performed on provided OpenAPI v3 file to check its conformance to recommended syntax practices by the OpenAPI v3 official standards document.
| Property | Value |
|---|---|
| Ruleset ID | openapi-v3-syntax-linting |
| Code prefix | OPENAPI3SYNTAX_L |
| Type | Linting |
| Default severity | Warning |
| Rule system | Syntax |
| Rules | 11 |
Licenses
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L001 | valid-identifier-spdx-license-expression | Warning | The License Object must define a valid SPDX license expression when using the identifier property. The license expression must use only alpha-numeric characters, hyphens, spaces, periods, colons, and plus signs. Characters beyond these must not be used. |
Operations
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L020 | valid-operation-id-naming-conventions | Warning | The id of an Operation Object specified using the operationId property is a unique identifier of the operation in the complete API document. This id may be used by tools or libraries e.g. code generators. It is therefore recommended to follow common programming naming conventions e.g. snake case, kebab case, pascal case or camel case. Such conventions use mainly alphanumeric characters, hyphens and underscores. Spaces are not allowed. |
Parameters
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L040 | valid-parameter-content-key | Warning | Key of a parameter content map must be set as a specific media type which is in compliance with RFC6838. |
Request Body
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L060 | valid-request-body-content-key | Warning | The request body content key can be a specific media type (e.g. application/json) or a wildcard media type range (e.g. image/*). Media type definitions must be in compliance with RFC6838. |
Encoding
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L080 | valid-encoding-content-type | Warning | Encoding content type value can be a specific media type (e.g. application/json), a wildcard media type range (e.g. image/*), or a comma-separated list of the two types. Media type definitions must be in compliance with RFC6838. |
Responses
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L100 | valid-response-content-key | Warning | The response content key can be a specific media type (e.g. application/json) or a wildcard media type range (e.g. image/*). Media type definitions must be in compliance with RFC6838. |
Headers
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L120 | valid-header-content-key | Warning | Key of a header content map must be set as a specific media type which is in compliance with RFC6838. |
Schemas
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3SYNTAX_L140 | valid-schema-regex-pattern | Warning | The value of the string validation keyword pattern must be a valid regular expression according to the ECMA 262 regular expression dialect. It is recommended to restrict yourself to following regular expression tokens: individual Unicode characters, as defined by the JSON specification [RFC8259], simple character classes ([abc]), range character classes ([a-z]), complemented character classes ([^abc], [^a-z]), simple quantifiers: + (one or more), * (zero or more), ? (zero or one), and their lazy versions (+?, *?, ??), range quantifiers: {x} (exactly x occurrences), {x,y} (at least x, at most y, occurrences), {x,} (x occurrences or more), and their lazy versions, the beginning-of-input (^) and end-of-input ($) anchors. |
OPENAPI3SYNTAX_L141 | no-schema-dollar-id-empty-fragment | Warning | The value of $id in a Schema Object must be a valid URI that must not contain a fragment value. This means that an empty fragment (only # appended at the end of the URI) should not be used either. |
OPENAPI3SYNTAX_L142 | normalized-schema-dollar-id-uri | Warning | The value of $id in a Schema Object must be a valid normalized URI. |
OPENAPI3SYNTAX_L143 | valid-schema-pattern-properties-key | Warning | The unique key of each entry in the Schema Object patternProperties property must be a valid regular expression, according to the ECMA-262 regular expression dialect. It is recommended to restrict yourself to following regular expression tokens: individual Unicode characters, as defined by the JSON specification [RFC8259], simple character classes ([abc]), range character classes ([a-z]), complemented character classes ([^abc], [^a-z]), simple quantifiers: + (one or more), * (zero or more), ? (zero or one), and their lazy versions (+?, *?, ??), range quantifiers: {x} (exactly x occurrences), {x,y} (at least x, at most y, occurrences), {x,} (x occurrences or more), and their lazy versions, the beginning-of-input (^) and end-of-input ($) anchors. |
Learn more
Swagger v2 Standard Validation
Validation checks performed on provided Swagger v2 file to check its conformance to rules set by the Swagger v2 official standards document.
OpenAPI v3 Standards Linting
Linting checks performed on provided OpenAPI v3 file to check its conformance to recommended practices defined in the OpenAPI standard document.