Skip to content

[Bug]: @OA\Items() parent type must be "array" when using Choice assert with multiple: true #2664

@qconer

Description

@qconer

Version

5.9.0

Description

User Warning: @OA\Items() parent type must be "array" in

with this declaration:

#[Assert\Choice(callback: [SomeEnum::class, 'getValues'], multiple: true)]
/** @var string[] */
public array $field,

with list declaration all works fine:

#[Assert\Choice(callback: [SomeEnum::class, 'getValues'], multiple: true)]
/** @var list<string> */
public array $field,

JSON OpenApi

No response

Additional context

reproduced only with type_info: true. with type_info: false all works fine

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions