Define & Validate APIsValidation RulesetsOpenAPI Rulesets

OpenAPI v3 APIMatic Syntax Linting

Linting checks performed by APIMatic on provided OpenAPI v3 file to check its conformance to recommended syntax practices for better API consumption.

PropertyValue
Ruleset IDopenapi-v3-apimatic-syntax-linting
Code prefixOPENAPI3APIMATICSYNTAX_L
TypeLinting
Default severityWarning
Rule systemSyntax
Rules24

Rules marked (disabled) are turned off by default, so they don't report issues.

OpenAPI Info

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L040no-trailing-leading-spaces-in-info-titleWarningTitle inside info object should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L041valid-info-versionWarningThe API version specified in the info object must be non-null, non-empty and follow semantic versioning rules.
OPENAPI3APIMATICSYNTAX_L042valid-image-uriErrorThe display image URI for the API must be a non-null and non-empty URI string.

OpenAPI Servers

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L100no-trailing-leading-spaces-in-environment-nameWarningThe environment name should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L101no-trailing-leading-spaces-in-server-nameWarningThe name of the server should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L102no-server-url-trailing-slashWarningSome tooling forgets to strip trailing slashes off when it's joining the servers.url with paths, and you can get awkward URLs like https://example.com/api//pets. Best to just strip them off yourself.
OPENAPI3APIMATICSYNTAX_L103no-trailing-leading-spaces-in-server-variable-nameWarningThe name or the key of the server variable should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L104no-trailing-leading-spaces-in-server-parameter-nameWarningThe name of the server parameter should not contain any leading or trailing white-space characters.

OpenAPI Paths

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L180no-paths-key-trailing-slashWarningKeep trailing slashes off of paths, as it can cause some confusion. Some web tooling (like mock servers, real servers, code generators, application frameworks, etc.) will treat example.com/foo and example.com/foo/ as the same thing, but other tooling will not. Avoid any confusion by just documenting them without the slash, and maybe some tooling will let people shove a / on there when they're using it or maybe not, but at least the docs are suggesting how it should be done properly.
OPENAPI3APIMATICSYNTAX_L181non-empty-parameter-name-in-path-url-template-expressionErrorIn OpenAPI specifications, path parameters are defined by enclosing the parameter name in curly braces {} within the URL path. This rule enforces the requirement that path parameter declarations cannot be empty, as an empty path parameter declaration does not provide any useful information about the parameter.

OpenAPI Operations

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L230no-trailing-leading-spaces-in-operation-idWarningThe operation id should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L231no-trailing-leading-spaces-in-operation-summaryWarningThe operation summary should not contain any leading or trailing white-space characters.

OpenAPI Parameters

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L330no-trailing-leading-spaces-in-parameter-nameWarningThe name of a parameter should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L331valid-rfc-6570-parameter-NameWarning (disabled)The OpenAPI specification uses parameter names to identify parameters in various parts of the API, such as path, query, header, and cookie parameters. To ensure interoperability and consistency across API implementations, this rule enforces the requirement that parameter names must follow the URI template syntax specified in RFC6570.
OPENAPI3APIMATICSYNTAX_L332valid-boolean-parameter-nameWarning (disabled)Name fields of parameters with type boolean should have a is, has or can prefix. You can specify different prefixes.

OpenAPI Tags

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L600no-trailing-leading-spaces-in-tag-nameWarningThe name of the tag should not contain any leading or trailing white-space characters.

OpenAPI Schemas

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L660no-trailing-leading-spaces-in-schema-titleWarningThe title of the schema should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L661no-trailing-leading-spaces-in-schema-properties-keyWarningThe keys of a schema properties should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L662valid-schema-enum-item-typeErrorEach item within the enum list should match the expected schema type. In case an item does not conform to the specified type, it may lead to unexpected behavior or errors when consuming the API.

OpenAPI XML

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L840no-trailing-leading-spaces-in-xml-nameErrorThe name of an XML object should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L841valid-xml-nameErrorName assigned to an XML entity must follow W3C Extensible Markup Language recommendations.

OpenAPI Security Schemes

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L870no-trailing-leading-spaces-in-api-key-security-scheme-nameWarningThe name of an ApiKey Security Scheme should not contain any leading or trailing white-space characters.
OPENAPI3APIMATICSYNTAX_L871no-trailing-leading-spaces-in-additional-header-nameWarningName of the additional header in security scheme object should not contain any leading or trailing white-space characters.

OpenAPI OAuth 2.0 Flows

CodeRuleSeverityWhat it checks
OPENAPI3APIMATICSYNTAX_L910no-trailing-leading-spaces-in-oauth-flow-scope-nameWarningThe name of an OAuthFlow Scope should not contain any leading or trailing white-space characters.

Learn more

On this page