Skip to main content

required-server-url-variable-value

Overview

This rule belongs to the insomnia-validation ruleset and states that:

If 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.

PropertyValue
EnabledYes
Maximum SeverityError
MessageServer base URL contains a variable with no value available. A default value will be assumed.
CodeINSOMNIA_V100
TypeValidation
Rule SystemSemantic
Broad CategoryAPI Servers
Products ImpactedAPI Transformer, Code Generation, Developer Experience Portal
Tagsinsomnia semantic validation environment variable url request server

Suggested Fixes

  • A variable can be declared in a url using curly braces e.g. {{name}} where name is the name of the variable.
  • If you've used variables in your request URLs, ensure that one or more environment resources also exist in the file. This is possible if environments are configured in your Insomnia application (global or for a resource group).
  • Ensure that for each variable declared in the url, a corresponding entry for the variable and its value is available in each environment's data key-value pairs. The key must match exactly with the variable name used in the URL. Names are compared in a case-sensitive manner.

For More Information