Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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"
* )
like image 947
Andrei Lupuleasa Avatar asked Dec 27 '18 15:12

Andrei Lupuleasa


Video Answer


1 Answers

I've found the solution:

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

The issue was @OA\Schema

like image 141
Andrei Lupuleasa Avatar answered Sep 19 '22 10:09

Andrei Lupuleasa