Importing OAS contract - Parameter examples not loaded

Hello,

I want to create a Postman collection from an API contract.

I need Postman creates samples based on the contract.

However, I’m unable to get Postman to load the parameter values (headers in this case) according to the examples.

Can you help me?

Here is the OAS contract (AI generated):

openapi: 3.0.4
info:
  title: API with Examples
  version: 1.0.0
paths:
  /process:
    post:
      summary: Process data with multiple examples, referencing header from components
      parameters:
        - $ref: '#/components/parameters/RequestIDHeader' 
      requestBody:
        description: Data to be processed
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RequestSchema'
            examples:
              example1:
                $ref: '#/components/examples/Example1Request'
              example2:
                $ref: '#/components/examples/Example2Request'
              example3:
                $ref: '#/components/examples/Example3Request'
      responses:
        '200':
          description: Data processed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ResponseSchema'
              examples:
                example1:
                  $ref: '#/components/examples/Example1Response'
                example2:
                  $ref: '#/components/examples/Example2Response'
                example3:
                  $ref: '#/components/examples/Example3Response'
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string

components:
  parameters:
    RequestIDHeader: 
      name: X-Request-ID
      in: header
      description: Unique identifier for the request
      required: true
      schema:
        type: string
        description: Schema for the X-Request-ID header
      
      examples:
        example1:
          $ref: '#/components/examples/Example1Header'
        example2:
          $ref: '#/components/examples/Example2Header'
        example3:
          $ref: '#/components/examples/Example3Header'

  schemas:
    RequestSchema:
      type: object
      properties:
        inputData:
          type: string
          description: The data string to process.
        config:
          type: object
          properties:
            setting:
              type: integer
              description: A configuration setting.
      required:
        - inputData

    ResponseSchema:
      type: object
      properties:
        outputData:
          type: string
          description: The result after processing.
        status:
          type: string
          description: Status of the operation.
      required:
        - outputData
        - status

  examples:
    Example1Header:
      value: req-12345

    Example1Request:
      value:
        inputData: "Hello World"
        config:
          setting: 1

    Example1Response:
      value:
        outputData: "Processed: Hello World"
        status: "success"

    Example2Header:
      value: req-67890

    Example2Request:
      value:
        inputData: "Another piece of data"
        config:
          setting: 2

    Example2Response:
      value:
        outputData: "Processed: Another piece of data"
        status: "success"

    Example3Header:
      value: req-abcde

    Example3Request:
      value:
        inputData: "Final example"
        config:
          setting: 3
        optionalField: true # Example with an optional field

    Example3Response:
      value:
        outputData: "Processed: Final example"
        status: "completed"

Extra comments:

Hey @syscents :waving_hand:

Welcome to the Postman Community! :postman:

I’m not going to confess to knowing a create deal about this submit and the different schema behave but from reading and researching, I think that this is a limitation with that version of openapi as there’s no built-in mechanism to tie specific header examples to specific requestBody examples.

Hi @danny-dainton , thank you for the information.

Referring your comment about version… I’ve generated a simple example with 3.0.4 version. But I could use any other OAS version.

Do you know if there is any version that is working this nice feature?

It would be great to have this feature because from the contract we would generate the samples and could load the collection into Postman so that it works the first time.

However, thank you for your time and help