Importing openapi3 with path variable

The current way that postman imports openapi into :variable notation means that a path variable cannot be set at an environment level.

So for example, this valid spec that requires an orgId in the path for every request
https://api.m3ter.com/spec

requires adding that into the params for every single request in the collection, or in the case of having a different value for an environment, adding the variable name to the path params for orgId for each request

Is there a way to bulk add this value?

It seems odd that you can’t have path params in environment variables, it is not unusual to have this kind of api endpoint be environment specific.

1 Like

Trying out Postman today and running into this same issue. Path parameters are a great feature, but we should be able to map the values to variables on import. Right now I have hundreds of requests that each need to have multiple path parameters manually assigned to map to an environment variable.

I encounter the same issue and I’m surprised too.
Workspace with the spec, collection and environment.
The “1. openEHR REST APIs” collection is a custom collection that shows what I want to achieve.
The “EHR API” collection is generated and shows the :var (e.g. :ehr_id) pattern that makes it cumbersome to map to environment variables.

workaround:
In the end I ended up exporting the collection to GitHub. This gives me a json file. I then did a search and replace of :var with {{var}} and imported this to postman as an replace on the collection (just committing to GitHub get’s overwritten by postman, instead of syncing changes from GitHub to postman).
I also tried find and replace using postman, but somehow my collection is read-only from the find interface (I can edit using the main window..) seems to be a known issue: Collection becomes readonly in the Find & Replace and can't be changed · Issue #12144 · postmanlabs/postman-app-support · GitHub
Postman

Did you have any updates? I think this would be a sensible change to GitHub - postmanlabs/openapi-to-postman: Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format