Skip to content

Storing \stdClass object in json_document #88

@erop

Description

@erop

I have a really non-typed JSON input that successfully decoded into stdClass object with json_decode($json) But after persisting the whole entity in Postgres I can only see {"#type": "stdClass"} without any actual data in JSONB column. If I add $assoc = true parameter to json_decode, it successfully saves an array. That's OK for storing and retrieving data. But using arrows instead of square brackets could be more fun. Moreover I found out that on hitting https://github.com/dunglas/doctrine-json-odm/blob/master/src/Serializer.php#L23 $normalizedData local variable is an empty array while $data is still "well-formed" stdClass with huge amount of properties. Is it feature or bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions