how to pass multi value query params in swagger

前端 未结 2 848
时光说笑
时光说笑 2021-01-17 14:24

I have following service in swagger.yml. The service is written so that page_id can be passed multiple times. e.g /pages?page_id[]=123&page_id[]=542

2条回答
  •  逝去的感伤
    2021-01-17 15:00

    From the docs:

    parameters:
    - name: id
      in: path
      description: ID of pet to use
      required: true
      schema:
        type: array
        style: simple
        items:
          type: string
    

    You have to define the parameter as array.

提交回复
热议问题