getyamlpostmanpostman-mocks

How to send array of strings in query parameters of get request in postman


I have postman mock server with collection, and one of the requests has parameter with type array.

Here is the definition for this query parameter in the API ymal file:

- name: departureAirports
          required: false
          in: query
          explode: true
          schema:
            type: array
            items:
              type: string
              pattern: ^[A-Z]{3}$

When I send this request from postman with value like this ["123"]

enter image description here

, I got this error:

The query parameter "departureAirports" needs to be of type array, but we found "["123"]"

enter image description here

So, How can I send array of strings in the query parameters in get request ?


Solution

  • You can send the value of parameter departureAirports array like

    departureAirports[1]:1
    departureAirports[2]:2
    departureAirports[3]:3