How to fix ErrorException: @OA\Items() is required when @OA\Property() has type "array"?

Andrei Lupuleasa picture Andrei Lupuleasa · Dec 27, 2018 · Viewed 8.1k times · Source

I've tried to add a nested array of arbitrary types. These are my annotations:

* @OA\Property(
*      @OA\Schema(
*          type="array",
*          @OA\Items(
*              type="array",
*              @OA\Items(type={})
*          )
*      ),
*      description="bla bla bla"
* )

Answer

Andrei Lupuleasa picture Andrei Lupuleasa · Dec 28, 2018

I've found the solution:

 * @OA\Property(
 *      type="array",
 *      @OA\Items(
 *          type="array",
 *          @OA\Items()
 *      ),
 *      description="bla bla bla"
 * )

The issue was @OA\Schema