Define & Validate APIsValidation RulesetsOpenAPI Rulesets

OpenAPI v3 Syntax Validation

Validation checks performed on provided OpenAPI v3 file to check its conformance to OpenAPI 3.n syntax rules.

PropertyValue
Ruleset IDopenapi-v3-syntax-validation
Code prefixOPENAPI3SYNTAX_V
TypeValidation
Default severityError
Rule systemSyntax
Rules21

Servers

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V001valid-server-url-formatErrorValue must be in the format of a URL. A URL can either be absolute or relative and can contain variables wrapped in {}.

Components

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V020valid-component-nameErrorComponent name must contain only alphanumeric, dash (-), underscore (_) and period (.) characters. Spaces are not allowed.

Paths

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V040path-name-begin-with-forward-slashErrorA path name represents a relative path from the server at which the API is served. Therefore, it must start with a forward slash (/).

Responses

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V060valid-response-status-code-or-rangeErrorThe Responses Object key must be a valid HTTP status code/range or set to default. The key must be enclosed in quotation marks for compatibility between JSON and YAML. If the key is an explicit HTTP status code, then it must be valid according to RFC7231 and possibly listed in the registered status codes in the IANA Status Code Registry. if the key represents a range of status codes it must contain the uppercase wildcard character X e.g. 2XX represents all response codes between [200-299]. Only the following range definitions are allowed: 1XX, 2XX, 3XX, 4XX, and 5XX. To represent undeclared responses, the key default can be used.
OPENAPI3SYNTAX_V061valid-response-link-keyErrorThe key of response links map is a name for the link which must contain only alphanumeric, dash (-), underscore (_) and period (.) characters. Spaces are not allowed.

Callbacks

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V080valid-callback-key-expressionWarningCallback key is a string used for identifying the Path Item Object and is capable of supporting runtime expressions which are evaluated in the context of a runtime HTTP request/response to identify the URL to be used for the callback request. The key must use valid runtime expression syntax. Expressions can be embedded into string values by surrounding the expression with {} curly braces.
CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V100valid-operation-refErroroperationRef must be a valid relative or absolute URI reference to an OAS operation. In the use of operationRef, the escaped forward-slash is necessary when using JSON references.
OPENAPI3SYNTAX_V101valid-link-parameter-expressionWarningLink parameter value is a string used for determining the parameter value that needs to be sent as part of the callback request. This value is capable of supporting runtime expressions which are evaluated in the context of a runtime HTTP request/response. The value must use valid runtime expression syntax. Expressions can be embedded into string values by surrounding the expression with {} curly braces.
OPENAPI3SYNTAX_V102valid-link-request-body-expressionWarningLink request body value is a string used for determining the request body value that needs to be sent as part of the callback request. This value is capable of supporting runtime expressions which are evaluated in the context of a runtime HTTP request/response. The value must use valid runtime expression syntax. Expressions can be embedded into string values by surrounding the expression with {} curly braces.

References

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V120valid-dollar-ref-pathError$ref values must be RFC3986-compliant percent-encoded URIs.

Schemas

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V140valid-schema-dollar-id-formatErrorThe value of $id in a Schema Object must be a URI-reference (absolute URI or relative reference). If a relative path is used it must resolve to an absolute URI. $id must not contain a non-empty fragment value.
OPENAPI3SYNTAX_V141valid-schema-dollar-anchor-formatErrorProperty $anchor in a Schema Object is an identifier keyword used for creation of named fragments. The value of this property must start with a letter ([A-Za-z]) or underscore (_), followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), and periods (.).
OPENAPI3SYNTAX_V142valid-schema-dollar-dynamic-anchor-formatErrorProperty $dynamicAnchor in a Schema Object is an identifier keyword used for creation of named fragments. The value of this property must start with a letter ([A-Za-z]) or underscore (_), followed by any number of letters, digits ([0-9]), hyphens (-), underscores (_), and periods (.).
OPENAPI3SYNTAX_V143valid-schema-content-media-typeErrorMedia type of string content can be defined using the contentMediaType property of a Schema Object which must be in compliance with RFC2046.

Discriminators

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V160valid-discriminator-mapping-keyErrorDiscriminator mapping keys must be string values.

XML

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V180valid-xml-namespaceErrorThe XML namespace value must be a proper URI with an absolute path.

Specification Extensions

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V200specification-extension-name-begin-with-x-dashErrorIf any additional property needs to be added in the OpenAPI specification that is otherwise not part of the actual standard, specification extensions can be used for this purpose at certain points. The extension name must begin with x- (e.g. x-internal-id). An exception to this rule is only for Schema Objects of OpenAPI v3.1.x documents that allows extension names to start even without x-.

Miscellaneous

CodeRuleSeverityWhat it checks
OPENAPI3SYNTAX_V220valid-url-formatErrorString value should be in the format of a proper URL. The URL path can be relative only if a server URL exists in the API document to help resolve the URL path into an absolute path.
OPENAPI3SYNTAX_V221valid-email-addressErrorString value must be in the format of an email.
OPENAPI3SYNTAX_V222valid-property-value-typeErrorValue of an OpenAPI standard property must be in accordance with the type set by the standard for that property.
OPENAPI3SYNTAX_V223valid-uri-formatErrorString value should be in the format of a proper URI. The URI path can be relative if the Base URI of the referring document is known to help resolve the URI path into an absolute path.

Learn more

On this page