Define & Validate APIsValidation Rulesets

Insomnia Rulesets

The ruleset APIMatic uses to validate Insomnia documents.

APIMatic validates Insomnia export documents against the ruleset below. These include rules defined by the standard as well as additional checks APIMatic enforces for better output.

Insomnia Validation

Validation checks performed on an Insomnia Export file.

PropertyValue
Ruleset IDinsomnia-validation
Code prefixINSOMNIA_V
TypeValidation
Default severityError
Rule systemSemantic
Rules6

Basic Structure

CodeRuleSeverityWhat it checks
INSOMNIA_V001valid-insomnia-syntaxBlockingThe provided Insomnia file must not contain any syntax/semantic issues and use only valid JSON/YAML. Each property in the file must have a type as defined in the standard.

API Servers

CodeRuleSeverityWhat it checks
INSOMNIA_V100required-server-url-variable-valueErrorIf a url defined in an Insomnia request resource contains a variable using curly braces {{name}}, a corresponding value for the variable must be available in each environment resource's data. The variable name used in the URL must match exactly with the name of the variable in the environment resource data and the value provided this way must be non-empty. If an environment entry does not exist or the value is empty, a dummy value will be assumed for the variable automatically during import/transformations in APIMatic.

Requests

CodeRuleSeverityWhat it checks
INSOMNIA_V200absolute-request-url-pathErrorThe url defined in an Insomnia request resource must be non-empty and an absolute path. Relative paths are not allowed. This is essential for determining the base URLs of one or more servers that serve the current API.
INSOMNIA_V201no-body-in-request-with-get-methodWarningA request resource with method GET must not define a body (i.e. the request payload). This is because such methods do not expect a body and, therefore, all related information will be ignored automatically during import/transformations in APIMatic.

Request Authentication

CodeRuleSeverityWhat it checks
INSOMNIA_V400required-oauth2-authorization-urlErrorIf the request authentication type is oauth2 and grantType is set as implicit or authorization_code, then the authentication object must specify a non-empty authorization URL to be used for this grant type, using the authorizationUrl property. If the URL is not provided, a dummy value will be assigned automatically during import/transformations in APIMatic.
INSOMNIA_V401required-oauth2-access-token-urlErrorIf the request authentication type is oauth2 and grantType is set as client_credentials, password or authorization_code, then the authentication object must specify a non-empty access token URL to be used for this grant type, using the accessTokenUrl property. If the URL is not provided, a dummy value will be assigned automatically during import/transformations in APIMatic.

Learn more

On this page