Globals
Collection-wide Portman settings for variables, scripts, search and replace, request ordering, variable casing and authorization.
The globals section of the Portman config applies to the whole Postman collection. Use it for collection variables, collection-level scripts, mass search and replace, request and folder ordering, variable casing and collection-wide authorization.
Example
{ "version": 1.0, "globals": { "stripResponseExamples": true, "collectionPreRequestScripts": [ "pm.collectionVariables.set('status', pm.iterationData.get('status') || 'open')" ], "collectionTestScripts": [ "pm.collectionVariables.set('applicationId', pm.iterationData.get('applicationId') || '1111');" ], "collectionVariables": { "name": "portman", "version": "1" }, "keyValueReplacements": { "x-apideck-app-id": "{{applicationId}}" }, "valueReplacements": { "<Bearer Token>": "{{bearerToken}}" }, "rawReplacements": [ { "searchFor": "Unify", "replaceWith": "Unify ApiDeck" } ], "portmanReplacements": [ { "searchFor": "]::", "replaceWith": "]:-:" } ] }}Options
| Option | Description |
|---|---|
stripResponseExamples | Default false. Strip the response examples from the generated collection, which keeps it compact when you generate many variations. |
variableCasing | Casing of auto-generated Postman variable names: camelCase, pascalCase, kebabCase, trainCase, snakeCase, adaCase, constantCase, cobolCase, dotNotation. |
separatorSymbol | Default ::. Separator in generated test names, for example [GET]::/crm/leads - Status code is 2xx. Helpful with the postman-to-k6 converter. |
collectionPreRequestScripts | Array of scripts run before every request. Script content or a file: path. |
collectionTestScripts | Array of scripts run after every request. Script content or a file: path. |
collectionVariables | Map of key value pairs added as Postman collection variables. |
keyValueReplacements | Map of parameter key names whose values are replaced with the given Postman variables. |
valueReplacements | Map of values replaced with the given values. |
rawReplacements | Search and replace on the OpenAPI data before Portman generates tests. |
portmanReplacements | Search and replace on the final generated collection right before it is written. |
orderOfOperations | List of operations used to sort requests within each folder. |
orderOfFolders | List of folder names used to sort folders. |
securityOverwrites | Authorization for the whole collection. |
Replacements
keyValueReplacements: any key matchingx-apideck-app-idgets the value{{applicationId}}across the collection.valueReplacements: any value matching<Bearer Token>becomes{{bearerToken}}.rawReplacements: any string or object matchingUnifybecomesUnify ApiDeck, including descriptions. Changes are made before test generation, so they affect the generated tests.portmanReplacements: runs on the final collection, so it can change anything Portman injected, such as test names or parts of the inlined JSON schema. The example above turns[GET]::/crm/leadstest names into[GET]:-:/crm/leads.
Ordering
orderOfOperations sorts requests within their folder. Requests not in the list keep their current order.
{ "version": 1.0, "globals": { "orderOfOperations": [ "POST::/crm/leads", "GET::/crm/leads/{id}", "PATCH::/crm/leads/{id}", "DELETE::/crm/leads/{id}", "GET::/crm/leads" ] }}orderOfFolders sorts folders by name. Folders not in the list keep their current order, after the re-ordered folders.
Variable casing
{ "version": 1.0, "globals": { "variableCasing": "snakeCase" }}With snakeCase, a variable named with the template <tag>Id for the Leads tag becomes leads_id. See Assign variables.
securityOverwrites
Overwrites the OpenAPI security scheme (apiKey, HTTP basic, HTTP bearer) or injects a Postman authorization type on collection level.
"securityOverwrites": { "bearer": { "token": "{{bearerToken}}" }}"securityOverwrites": { "apiKey": { "value": "{{apiKey}}" }}apiKey also accepts optional key and in (header or query).
"securityOverwrites": { "basic": { "username": "{{username}}", "password": "{{password}}" }}Use { "remove": true } to unset the authorization.
Postman authorization types awsv4, digest, edgegrid, ntlm, oauth1 and oauth2 take an array of key, value and type (string or boolean) attributes. The easiest way to get them is to configure auth manually in Postman, export the collection and copy the values:
{ "globals": { "securityOverwrites": { "oauth1": [ { "key": "addEmptyParamsToSign", "value": true, "type": "boolean" }, { "key": "consumerKey", "value": "RKCGzna7bv9YD57c", "type": "string" }, { "key": "signatureMethod", "value": "HMAC-SHA1", "type": "string" }, { "key": "version", "value": "1.0", "type": "string" } ] } }}For authorization on specific requests, use overwriteRequestSecurity in overwrites.