required-request-server-url-variable-value
Overview
This rule belongs to the postman-validation
ruleset and states that:
If a url
defined in a Postman Collection request resource 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 in the URL must match exactly with the pre-defined variable and the value provided this way must be non-empty. If a variable entry does not exist or the value is empty, a default value will be assumed for the variable automatically during import/transformations in APIMatic.
Property | Value |
---|---|
Enabled | Yes |
Maximum Severity | Error |
Message | Server base URL contains a variable with no value available. |
Code | POSTMAN_V151 |
Type | Validation |
Rule System | Semantic |
Broad Category | API Servers |
Products Impacted | API Transformer, Code Generation, Developer Experience Portal |
Tags | postman api semantic validation variable url request server environment data |
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 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.
For More Information
- https://learning.postman.com/docs/sending-requests/variables/
- https://learning.postman.com/docs/sending-requests/managing-environments/
- https://learning.postman.com/docs/sending-requests/requests/#setting-request-urls
- https://learning.postman.com/docs/sending-requests/requests/
- https://learning.postman.com/collection-format/getting-started/structure-of-a-collection/#request
- https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html
- https://schema.postman.com/collection/json/v2.1.0/draft-07/collection.json
- https://schema.postman.com/collection/json/v2.0.0/draft-07/docs/index.html
- https://schema.postman.com/collection/json/v2.0.0/draft-07/collection.json
- https://schema.postman.com/collection/json/v1.0.0/draft-07/docs/index.html
- https://schema.postman.com/collection/json/v1.0.0/draft-07/collection.json
- https://learning.postman.com/docs/introduction/overview/
- https://docs.apimatic.io/rulesets/overview/