postmanlabs / openapi-to-postman

Plugin for converting OpenAPI 3.0 specs to the Postman Collection (v2) format
Apache License 2.0
924 stars 199 forks source link

Feature Request - Link the collection with environment variable via extensions #439

Open raghavgarg1257 opened 2 years ago

raghavgarg1257 commented 2 years ago

We can add support for custom fields like x-env-var, so users can add something like

securitySchemes:
   PostmanAccessTokenAuth:
      type: apiKey
      in: header
      name: x-access-token
      x-env-var: {{env_var_name}}

And instead of adding a placeholder value, we can add this variable if available.

This could be a way to link the generated collection with the environment users provide in the API Version.

Ref, OpenAPI 3.0.3 extensions

akshaydeo commented 1 year ago

@raghavgarg1257, A quick question for you, How would this specification be used outside the Postman ecosystem? I am presuming that this open API spec is generated/written outside the Postman ecosystem and is being used to generate a collection.