如何在邮递员中发送get请求的查询参数中的字符串数组

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

我有带集合的邮递员模拟服务器,其中一个请求的参数类型为 array

这是 API ymal 文件中此查询参数的定义:

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

当我从邮递员发送这个请求时,值是这样的["123"]

,我得到这个错误:

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

那么,如何在 get 请求的查询参数中发送字符串数组?

您可以发送参数 departureAirports 数组的值,例如

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