Как описать массив записей в zircote / swagger-php - PullRequest
0 голосов
/ 15 октября 2018

Я хочу отправить массив методом POST в мой API.

Это мой код:

 /**
 * @OA\Post(path="/test/bulk/{edition}/{company}", tags={"Test"}, summary="Test",
 *     @OA\Parameter(
 *          name="company", required=true, in="path", @OA\Schema(type="integer")
 *     ),
 *     @OA\Parameter(
 *          name="edition", required=true, in="path", @OA\Schema(type="integer")
 *     ),
 *     @OA\RequestBody(
 *          @OA\MediaType(mediaType="multipart/form-data",
 *              @OA\Schema(
 *                  @OA\Property(property="key[]", type="array", collectionFormat="multi", @OA\Items(type="string")),
 *                  @OA\Property(property="value[]", type="array", collectionFormat="multi", @OA\Items(type="string")),
 *                  @OA\Property(property="file[]", type="array", collectionFormat="multi", @OA\Items(type="string", format="binary")),
 *                  @OA\Property(property="confirmed[]", type="array", collectionFormat="multi", @OA\Items(type="integer")),
 *                  required={"key", "confirmed"}
 *             )
 *         )
 *      ),
 *     @OA\Response(response=201, description="OK"),
 *     @OA\Response(response=400, description="Not Found or Validation Error"),
 * )
 */

Но я не знаю, почему swagger посылает это так:

key[]: key1,key2,
value[]: value1,value2
file[]: 
confirmed[]: 1,0

Итак, как мне описать это

...