question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

overwriteRequestPathVariables not working

See original GitHub issue

Portman version: 1.13.1

Sample spec:

...
    "/api/v2/projects/{projectKey}/environments": {
      "post": {
        "responses": {
          "201": {
            "description": "Successful environment response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "projectKey",
            "in": "path",
            "description": "The project key",
            "required": true,
            "schema": {
              "type": "string",
              "format": "string",
              "description": "The project key"
            }
          }
        ],
          "required": true
        },
        "operationId": "postEnvironment"
      }
    },
...

Sample portman config - global valueReplacements IS working

{
  "globals": {
    "valueReplacements": {
      "<API Key>": "{{apiToken}}"
    },
  "overwrites": [{
    "openApiOperationId": "postEnvironment",
    "overwriteRequestPathVariables": [
      {
        "key": "projectKey",
        "value": "{{projectKey}}",
        "overwrite": true
      }
    ]
  }]
}

postman collection config

{
  "requestNameSource": "Fallback",
  "indentCharacter": "Space",
  "collapseFolders": true,
  "requestParametersResolution": "Schema",
  "exampleParametersResolution": "Example",
  "folderStrategy": "Tags",
  "schemaFaker": true,
  "includeAuthInfoInExample": true,
  "shortValidationErrors": false,
  "validationPropertiesToIgnore": [],
  "showMissingInSchemaErrors": true,
  "detailedBlobValidation": false,
  "keepImplicitHeaders": false,
  "disableOptionalParameters": true,
  "optimizeConversion": true
}

Output - Value is set as <string>, but I want it it to be {{projectKey}}

...
"url": {
              "path": [
                "api",
                "v2",
                "projects",
                ":projectKey",
                "environments"
              ],
              "host": [
                "{{baseUrl}}"
              ],
              "query": [],
              "variable": [
                {
                  "disabled": false,
                  "description": {
                    "content": "(Required) The project key",
                    "type": "text/plain"
                  },
                  "type": "any",
                  "value": "<string>",
                  "key": "projectKey"
                }
              ]
            },
...

I have tried with a number of different Value strings and targeting options

Any help would be greatly appreciated!

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
thim81commented, Feb 9, 2022

Glad to hear. If you have more feedback (good or bad) or questions, feel free to post them in our discussions.

1reaction
jazannecommented, Feb 9, 2022

BLESS YOU 🙏 I missed that setting

Read more comments on GitHub >

github_iconTop Results From Across the Web

Override System Environment variable path in windows (not ...
Open Powershell; Set the path variable to be your node folder $env:Path = "C:\yournodefolder";; Running node --version should now display ...
Read more >
How path variable retain its old value after overwrite it
when I close and open another command prompt , now taskkill , ping commands are working. Also now path command displays same lists...
Read more >
My $PATH variable is messed up. How to change it back?
I suspect I messed up the $PATH variable when trying to install Stata. I've tried export PATH="/usr/bin:$PATH" which fixes the problem ...
Read more >
linux - Why did PATH='$PATH:/Path/to/bin' overwrite my PATH?
In the command line, I appended a directory to my PATH without exporting it: $ PATH='$PATH ...
Read more >
Path variables not resolved in Example Documentation #5133
Notice that on the Example Request it resolves the query param, but still has the path param as :pathParam. The problem this creates...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found