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.
| Property | Value |
|---|---|
| Ruleset ID | openapi-v3-apimatic-syntax-linting |
| Code prefix | OPENAPI3APIMATICSYNTAX_L |
| Type | Linting |
| Default severity | Warning |
| Rule system | Syntax |
| Rules | 24 |
Rules marked (disabled) are turned off by default, so they don't report issues.
OpenAPI Info
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L040 | no-trailing-leading-spaces-in-info-title | Warning | Title inside info object should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L041 | valid-info-version | Warning | The API version specified in the info object must be non-null, non-empty and follow semantic versioning rules. |
OPENAPI3APIMATICSYNTAX_L042 | valid-image-uri | Error | The display image URI for the API must be a non-null and non-empty URI string. |
OpenAPI Servers
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L100 | no-trailing-leading-spaces-in-environment-name | Warning | The environment name should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L101 | no-trailing-leading-spaces-in-server-name | Warning | The name of the server should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L102 | no-server-url-trailing-slash | Warning | Some 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_L103 | no-trailing-leading-spaces-in-server-variable-name | Warning | The name or the key of the server variable should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L104 | no-trailing-leading-spaces-in-server-parameter-name | Warning | The name of the server parameter should not contain any leading or trailing white-space characters. |
OpenAPI Paths
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L180 | no-paths-key-trailing-slash | Warning | Keep 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_L181 | non-empty-parameter-name-in-path-url-template-expression | Error | In 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
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L230 | no-trailing-leading-spaces-in-operation-id | Warning | The operation id should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L231 | no-trailing-leading-spaces-in-operation-summary | Warning | The operation summary should not contain any leading or trailing white-space characters. |
OpenAPI Parameters
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L330 | no-trailing-leading-spaces-in-parameter-name | Warning | The name of a parameter should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L331 | valid-rfc-6570-parameter-Name | Warning (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_L332 | valid-boolean-parameter-name | Warning (disabled) | Name fields of parameters with type boolean should have a is, has or can prefix. You can specify different prefixes. |
OpenAPI Tags
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L600 | no-trailing-leading-spaces-in-tag-name | Warning | The name of the tag should not contain any leading or trailing white-space characters. |
OpenAPI Schemas
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L660 | no-trailing-leading-spaces-in-schema-title | Warning | The title of the schema should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L661 | no-trailing-leading-spaces-in-schema-properties-key | Warning | The keys of a schema properties should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L662 | valid-schema-enum-item-type | Error | Each 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
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L840 | no-trailing-leading-spaces-in-xml-name | Error | The name of an XML object should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L841 | valid-xml-name | Error | Name assigned to an XML entity must follow W3C Extensible Markup Language recommendations. |
OpenAPI Security Schemes
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L870 | no-trailing-leading-spaces-in-api-key-security-scheme-name | Warning | The name of an ApiKey Security Scheme should not contain any leading or trailing white-space characters. |
OPENAPI3APIMATICSYNTAX_L871 | no-trailing-leading-spaces-in-additional-header-name | Warning | Name of the additional header in security scheme object should not contain any leading or trailing white-space characters. |
OpenAPI OAuth 2.0 Flows
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3APIMATICSYNTAX_L910 | no-trailing-leading-spaces-in-oauth-flow-scope-name | Warning | The name of an OAuthFlow Scope should not contain any leading or trailing white-space characters. |
Learn more
OpenAPI v3 APIMatic Linting
Linting checks performed by APIMatic on provided OpenAPI v3 file to check its conformance to recommended practices for better API consumption.
OpenAPI v3 Linting for APIMatic Code Generation
Linting checks performed by APIMatic on provided OpenAPI v3 file to check its conformance to recommended practices for better code generation experience.