Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing OpenAPIv3 spec with identically named URL parameters causes duplicate collection variables to be created #11884

Closed
1 task done
iCodeSometime opened this issue Mar 31, 2023 · 1 comment · Fixed by postmanlabs/openapi-to-postman#796

Comments

@iCodeSometime
Copy link

iCodeSometime commented Mar 31, 2023

Is there an existing issue for this?

  • I have searched the tracker for existing similar issues and I know that duplicates will be closed

Describe the Issue

I've seen some duplicate variable issues reported in the past, but all seem to have been resolved, so I assume this issue is separate.
I've created a minimal reproducible example (below).

The issue is that I am getting duplicate collection variables created when I import my OpenAPI 3.0 spec if multiple paths have identically named path parameters.

I'm able to work around this issue by bulk deleting all collection variables and re-adding them as I use them.

Here's the example spec:

{
  "openapi": "3.0.1",
  "info": {
    "title": "MyTitle",
    "description": "My Description",
    "version": "1.0.0",
    "x-ms-generated-by": {
      "toolName": "Microsoft.OpenApi.OData",
      "toolVersion": "1.0.9.0"
    }
  },
  "paths": {
    "/Path1({MyParam})": {
      "description": "My path1 description",
      "get": {
        "tags": [
          "MyTag"
        ],
        "summary": "does path1",
        "operationId": "Path1",
        "parameters": [
          {
            "name": "MyParam",
            "in": "path",
            "description": "My Param",
            "schema": {
              "type": "string",
              "nullable": true
            }
          }
        ]
      }
    },
    "/Path2({MyParam})": {
      "description": "My path2 description",
      "get": {
        "tags": [
          "MyTag"
        ],
        "summary": "does path2",
        "operationId": "Path2",
        "parameters": [
          {
            "name": "MyParam",
            "in": "path",
            "description": "My Param",
            "schema": {
              "type": "string",
              "nullable": true
            }
          }
        ]
      }
    }
  }
}

Steps To Reproduce

  1. Click import
  2. Use the example OpenAPI spec above
  3. Check the collection variables after import is complete - you will see two MyParam variables

Screenshots or Videos

No response

Operating System

Windows

Postman Version

10.12.9

Postman Platform

Postman App

User Account Type

Signed In User

Additional Context?

No response

@VShingala
Copy link
Member

@iCodeSometime Thanks for reporting the issue! We've identified the issue and will work towards fix for the same. I'll add more updates here, once we have this issue fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants