-
API Platform can deserialize an array into a list of objects. Example: class ProductCreateInput
{
public function __construct(
#[ApiProperty(identifier: true)] public string $id,
#[ApiProperty] public string $title,
#[ApiProperty] public string $source,
/** @var Tag[] */
#[ApiProperty] public array $tags = []
) {
}
} Here API Platform will automatically convert tags IRI array into a list of Tag objects based on PHP DocBlock. Where can I read about it? Does it support union types like |
Beta Was this translation helpful? Give feedback.
Answered by
kubk
Sep 8, 2021
Replies: 1 comment
-
I see that |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
kubk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I see that
phpdocumentor/reflection-docblock
is responsible for it.