-
-
Notifications
You must be signed in to change notification settings - Fork 42
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
Bug: stored JSON value may be integer/float/string #58
Comments
Can you share an example with the actual outcome and the expected one? |
JSON is not always objects or arrays. String or numeric values are valid JSON too. So this code json_decode("\"string\"", true); returns string result and leads to type exception here https://github.com/martin-georgiev/postgresql-for-doctrine/blob/master/src/MartinGeorgiev/Doctrine/DBAL/Types/JsonTransformer.php#L33. |
@strider2038 do you mind confirming the changes in #66 will fix the use-case you have? |
Yes, this solves our issue. Thanks. |
Cool, it is released in the last version published for Composer. |
We are storing variable type of data in JSONB field. It can be object, integer, float or string. So we have an issue with Jsonb and primitive types. I think array type must be removed from these methods.
https://github.com/martin-georgiev/postgresql-for-doctrine/blob/master/src/MartinGeorgiev/Doctrine/DBAL/Types/Jsonb.php#L45
https://github.com/martin-georgiev/postgresql-for-doctrine/blob/master/src/MartinGeorgiev/Doctrine/DBAL/Types/JsonTransformer.php#L33
The text was updated successfully, but these errors were encountered: