Configuration

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

json
{  "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.

PropertyDescription
keyProperty to target. Use dot notation for nested properties, . for the root.
valueNew value.
overwriteDefault true. Replace the value, or with false attach to the original value.
removeDefault false. Remove the property and its value.
insertDefault true. Form bodies only: insert keys not present in OpenAPI.
descriptionForm bodies only: overwrite the form field description.

overwriteRequestQueryParams

PropertyDescription
keyQuery param to target. Supports *, for example filter[*] matches filter[0], filter[1].
valueNew value.
overwriteDefault true. Replace or attach to the original value.
disableDefault false. Disable the param in Postman.
removeDefault false. Remove the param.
insertDefault true. Insert params not present in OpenAPI.
descriptionOverwrite the param description.

overwriteRequestPathVariables

PropertyDescription
keyPath variable to target.
valueNew value.
overwriteDefault true. Replace or attach to the original value.
removeDefault false. Remove the path variable.
insertDefault true. Insert path variables not present in OpenAPI.
descriptionOptional. Overwrite the description.

overwriteRequestHeaders

PropertyDescription
keyHeader to target.
valueNew value.
overwriteDefault true. Replace or attach to the original value.
disableDefault false. Disable the header.
removeDefault false. Remove the header.
insertDefault true. Insert headers not present in OpenAPI.
descriptionOverwrite the header description.

overwriteRequestBaseUrl

An object, not an array.

PropertyDescription
valueNew base URL, for example https://example.com or {{baseUrl}}.
overwriteDefault true. Replace or attach to the original base URL.
removeDefault false. Remove the base URL.
json
{  "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):

json
"overwriteRequestSecurity": {  "apiKey": {    "value": "{{apiKey}}"  }}

Bearer token:

json
"overwriteRequestSecurity": {  "bearer": {    "token": "{{bearerToken}}"  }}

Basic auth:

json
"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.