Unable to set parameter values from OpenAPI examples when importing spec into Postman

Viewed 266

I'm currently trying to import an OpenAPI spec into Postman to generate a collection. I am using OpenAPI 3.0 and using Postman v7.25.0. I'm having an issue where I'm trying to automatically have the Value of one of my path parameters in Postman automatically set based on an example that I define in the spec. Here's a little snippet (YAML) of how I've implemented an example for one of my parameters:

...
parameters:
  - name: id
    in: path
    required: true
    schema:
      type: string
      example: TEST_VALUE
    description: Generic description for ID
...

It does look like I'm adding the example value to the correct spot according to the OpenAPI 3.0 spec. Additionally, it does appear that Postman supports this functionality -- there's an option when I import the spec that says this:

Request parameter generation

Select whether to generate the request parameters based on the schema or the example in the schema.

I am making sure to set that option's value to Example rather than the default value of Schema. However, once I generate the collection and open up this specific request with the examples, the value of the parameter is just <string> rather than the expected value of TEST_VALUE. Every other part of the request generates correctly according to my spec, but it's just the parameter values that I'm having a tough time to get mapped to my example values.

Greatly appreciate any help I can get on this. Thanks!

0 Answers
Related