Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Storing \stdClass object in json_document #88

Open
erop opened this issue May 13, 2020 · 0 comments
Open

Storing \stdClass object in json_document #88

erop opened this issue May 13, 2020 · 0 comments

Comments

@erop
Copy link

erop commented May 13, 2020

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant