NelmioApiDocBundle
NelmioApiDocBundle copied to clipboard
Property type array attribute does not work, annotation does
Hi, so i have a doctrine User entity with property roles = []
use OpenApi\Attributes as OA;
use OpenApi\Annotations as OAA;
class User {
/**
* @ORM\Column(type="array")
*/
#[Groups(groups: ["current_user"])]
#[OA\Property(type: "array", items: new OA\Items(type: "string"))] #doesn't work
///** @OAA\Property(type="array", @OAA\Items(type="string")) */ does work
private array $roles = [];
}
with the attribute defined like that i get error
Property "User::roles" is an array, but its items type isn't specified. You can specify that by using the type string[] for instance or @OA\Property(type="array", @OA\Items(type="string")).
when using annotation, no warning
how can i make the attribute work?
thanks
Can't reproduce this issue.
Same problem