Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Serializer] Allow using generic annotations and not parsing them as an array #41996

Closed
@awd-studio

Description

@awd-studio

Symfony version(s) affected: 5.3.3

Description
Denormalizer breaks with an error Data expected to be an array, string given. when it handles an object, which contains a generic-like annotation, but is not an array or iterable.

How to reproduce

interface Foo {}

/** @template TFoo of Foo */
interface Bar {}

final class FooBar {
    /** @var Bar<Foo> */
    public Bar $bar; // This prop will fail
    // ...
}

Possible Solution
I digged it in PhpDocTypeHelper, which is part of phpDocumentor, so I don't know how to solve it. 😟

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions