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

Skip to content

[Serializer] Fails to denormalize into php 8 mixed property #39947

Closed
@vudaltsov

Description

@vudaltsov

Symfony version(s) affected: 5.2.1

How to reproduce

final class DTO
{
    public mixed $a;
}

$serializer->deserialize('{"a": 1}', DTO::class, 'json');

gives error The type of the "a" attribute for class "DTO" must be one of "" ("int" given).

Additional context
Works well if phpdoc mixed type is used instead.

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