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.

PropertyValue
Ruleset IDopenapi-v3-syntax-linting
Code prefixOPENAPI3SYNTAX_L
TypeLinting
Default severityWarning
Rule systemSyntax
Rules11

Licenses

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L001valid-identifier-spdx-license-expressionWarningThe 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

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L020valid-operation-id-naming-conventionsWarningThe 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

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L040valid-parameter-content-keyWarningKey of a parameter content map must be set as a specific media type which is in compliance with RFC6838.

Request Body

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L060valid-request-body-content-keyWarningThe 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

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L080valid-encoding-content-typeWarningEncoding 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

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L100valid-response-content-keyWarningThe 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

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L120valid-header-content-keyWarningKey of a header content map must be set as a specific media type which is in compliance with RFC6838.

Schemas

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_L140valid-schema-regex-patternWarningThe 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_L141no-schema-dollar-id-empty-fragmentWarningThe 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_L142normalized-schema-dollar-id-uriWarningThe value of $id in a Schema Object must be a valid normalized URI.
OPENAPI3SYNTAX_L143valid-schema-pattern-properties-keyWarningThe 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

On this page