How to describe array of arrays in request in swagger-lume

Viewed 803

There's form with some inputs like 'firstname', 'lastname', 'middlename' etc. They are sent via post-request as array and it looks like:

passengers[0][firstname]

passengers[0][lastname]

passengers[0][middlename]

passengers[1][firstname]

passengers[1][lastname]

passengers[1][middlename].

How to describe it in swagger for php (v3.0.2)? I've tried to do this something like:

 *     @OA\Parameter(name="passengers", required=true, description="passenger information", in="query",
 *          @OA\Schema(
 *              type="array",
 *              @OA\Items(
 *                  type="object",
 *                  @OA\Property(
 *                      property="firstName",
 *                      description="The product name",
 *                      @OA\Schema(type="string")
 *                  ),
 *                  @OA\Property(
 *                      property="lastName",
 *                      @OA\Schema(type="string")
 *                  ),
 *                  @OA\Property(
 *                      property="middleName",
 *                      @OA\Schema(type="string")
 *                  )
 *              )
 *          )
 *     ),

but it just shows textarea with JSON.

How can I do a parameter of array type with items of different types(string, int, etc)? I dont need to sent data as JSON, it should be sent as array of form elements.

0 Answers
Related