Skip to content

[Serializer] Wrong deserialization with object as constructor parameter #20670

Closed
@tyx

Description

@tyx

Hello,

I start with a bug before a PR because I have no time for now and it looks very weird.

In the latest RC this line looks very weird : https://github.com/symfony/symfony/blob/v3.2.0-RC2/src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php#L340

I don't get how it could work (and it definitively do not work in my app).

We should run a denormalize operation instead of deserialize operation. All data should be at least decoded from json, no ?

I get also Warning: json_decode() expects parameter 1 to be string, array given in /var/app/vendor/symfony/symfony/src/Symfony/Component/Serializer/Encoder/JsonDecode.php on line 88 that which make me say I'm right.

Thanks

edit: Replacing the deserialize by denormalize make my app working

Here is a gist to reproduce : https://gist.github.com/tyx/ed50f6e525494909249b571c76360c36

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