Overwrites
Change Postman request data generated from OpenAPI with Portman overwrites for body, query params, path variables, headers, base URL and auth.
overwrites modifies the requests Portman generates from your OpenAPI document: request body, query parameters, path variables, headers, base URL and authorization. Use it to insert specific or randomized values, reuse assigned variables, or remove fields.
Example
{ "version": 1.0, "overwrites": [ { "openApiOperationId": "leadsAdd", "overwriteRequestBody": [ { "key": "company_name", "value": "{{$randomCompanyName}} {{$randomColor}}", "overwrite": true }, { "key": "monetary_amount", "value": "{{$randomInt}}", "overwrite": true }, { "key": "websites[0]", "remove": true } ] }, { "openApiOperationId": "leadsAll", "overwriteRequestQueryParams": [ { "key": "limit", "disable": true }, { "key": "cursor", "remove": true } ] }, { "openApiOperationId": "leadsUpdate", "overwriteRequestHeaders": [ { "key": "x-apideck-consumer-id", "value": "portman-id-{{$randomInt}}", "overwrite": true } ], "overwriteRequestPathVariables": [ { "key": "id", "value": "123456789", "overwrite": true, "description": "Lead ID" } ] } ]}Targeting
Use openApiOperationId, openApiOperationIds, openApiOperation and optionally excludeForOperations. See targeting.
Values
Values can be:
- static strings, numbers, booleans, arrays or objects (body only)
- Postman dynamic variables like
{{$guid}}or{{$randomInt}} - Postman variables like
{{leadsAdd.id}} - template expressions like
<operationId>or<tag>, see Assign variables
In the request body, {{variable}} is inserted as a string. To insert a variable as a number, boolean or array, use three braces and keep the quotes: "{{{newMonetaryAmount}}}".
overwriteRequestBody
Applies to JSON, form-data and x-www-form-urlencoded bodies.
| Property | Description |
|---|---|
key | Property to target. Use dot notation for nested properties, . for the root. |
value | New value. |
overwrite | Default true. Replace the value, or with false attach to the original value. |
remove | Default false. Remove the property and its value. |
insert | Default true. Form bodies only: insert keys not present in OpenAPI. |
description | Form bodies only: overwrite the form field description. |
overwriteRequestQueryParams
| Property | Description |
|---|---|
key | Query param to target. Supports *, for example filter[*] matches filter[0], filter[1]. |
value | New value. |
overwrite | Default true. Replace or attach to the original value. |
disable | Default false. Disable the param in Postman. |
remove | Default false. Remove the param. |
insert | Default true. Insert params not present in OpenAPI. |
description | Overwrite the param description. |
overwriteRequestPathVariables
| Property | Description |
|---|---|
key | Path variable to target. |
value | New value. |
overwrite | Default true. Replace or attach to the original value. |
remove | Default false. Remove the path variable. |
insert | Default true. Insert path variables not present in OpenAPI. |
description | Optional. Overwrite the description. |
overwriteRequestHeaders
| Property | Description |
|---|---|
key | Header to target. |
value | New value. |
overwrite | Default true. Replace or attach to the original value. |
disable | Default false. Disable the header. |
remove | Default false. Remove the header. |
insert | Default true. Insert headers not present in OpenAPI. |
description | Overwrite the header description. |
overwriteRequestBaseUrl
An object, not an array.
| Property | Description |
|---|---|
value | New base URL, for example https://example.com or {{baseUrl}}. |
overwrite | Default true. Replace or attach to the original base URL. |
remove | Default false. Remove the base URL. |
{ "openApiOperation": "*::/crm/*", "overwriteRequestBaseUrl": { "value": "{{baseUrl}}", "overwrite": true }}overwriteRequestSecurity
Sets the Postman authorization for the targeted requests. Supported forms:
API key, with optional key and in (header or query):
"overwriteRequestSecurity": { "apiKey": { "value": "{{apiKey}}" }}Bearer token:
"overwriteRequestSecurity": { "bearer": { "token": "{{bearerToken}}" }}Basic auth:
"overwriteRequestSecurity": { "basic": { "username": "{{username}}", "password": "{{password}}" }}Remove the authorization: { "remove": true }.
Postman authorization types awsv4, digest, edgegrid, ntlm, oauth1 and oauth2 are also supported, as an array of key, value and type attributes as exported by Postman. See the example under Globals. To set authorization for the whole collection, use securityOverwrites in globals.
In variations
Variations accept the same overwrite options in their overwrites array, without a target.