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

2.9k Views Asked by At

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 ?

1

There are 1 best solutions below

2
Prabha Rajan On BEST ANSWER

You can send the value of parameter departureAirports array like

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