Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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

Copy link
Copy link
Closed
@awd-studio

Description

@awd-studio
Issue body actions

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

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.