required-environment-or-data-file-for-variables
Overview
This rule belongs to the postman-validation ruleset and states that:
If a value in the Postman Collection contains a variable using curly braces {{name}}, a corresponding value for the variable must be provided in either of the following: collection variables, enviroment variables or data variables. If you've used environment or data variables, their information must be exported from the Postman application in the form of external data/environment files and uploaded along with the Postman Collection in a ZIP file. The variable name used must match exactly with the pre-defined variable and the value provided this way must be non-empty.
| Property | Value |
|---|---|
| Enabled | Yes |
| Maximum Severity | Information |
| Message | Postman Collection contains one or more variable references but no data/environment variables file is provided. |
| Code | POSTMAN_V600 |
| Type | Validation |
| Rule System | Semantic |
| Broad Category | Miscellaneous |
| Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
| Tags | postman api semantic validation variable environment data |
Suggested Fixes
- A variable can be declared in a value using curly braces e.g. {{name}} where
nameis the name of the variable. - If you've used variables anywhere in the Postman Collection definition, ensure that the value for the variable is available in one or more of the following: collection variables, environment or data variables.
- Ensure that the variable name matches exactly with an entry in the collection/environment/data variables and has no typos. Names are compared in a case-sensitive manner.
- If values are available in data or environment files, make sure all such relevant files are uploaded along with the Postman Collection in a ZIP file.