Define & Validate APIsValidation Rulesets

HAR Rulesets

The ruleset APIMatic uses to validate HAR documents.

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

HAR Validation

Validation checks performed on a HAR (HTTP Archive) file.

PropertyValue
Ruleset IDhar-validation
Code prefixHAR_V
TypeValidation
Default severityError
Rule systemSemantic
Rules7

Basic Structure

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

Requests

CodeRuleSeverityWhat it checks
HAR_V100required-request-server-base-urlErrorThe url defined in a HAR entry request must be non-empty and an absolute path. This is essential for determining the base URLs of one or more servers that serve the current API. If a base URL cannot be determined, a default dummy value for base URL will be assumed automatically during import/transformations in APIMatic.
HAR_V101no-post-data-for-get-requestWarningAn entry request with method GET must not define a postData (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 Parameters

CodeRuleSeverityWhat it checks
HAR_V300required-request-header-nameErrorWhen a request header is defined in the headers list, a non-empty non-null name must be specified for it using the name property.
HAR_V301required-request-query-parameter-nameErrorWhen a request query string is defined, a non-empty non-null name must be specified for each query parameter using the name property. If a name is not found, the parameter definition will be ignored automatically during import/transformations in APIMatic.
HAR_V302required-request-post-data-parameter-nameErrorWhen a request postData is defined with params, a non-empty non-null name must be specified for each parameter using the name property.

Responses

CodeRuleSeverityWhat it checks
HAR_V500supported-response-status-codeWarningIf multiple responses are disabled via import settings provided in the APIMatic Metadata file, only response definitions belonging to status code ranges 200-208 and 400-599 will be imported. Those outside the supported range will be ignored automatically during import/transformations in APIMatic.

Learn more

On this page