I have a problem with JSON. Before we discovered the error, the column data in the mysql database was of type VARCHAR (255), where the serialized json was stored. About 2 months it worked well, but when the project began to grow, 255 characters - it was not enough. But we forget to change the type to TEXT. Now we have a problem that our serialized json is disabled up to 255 characters and is now invalid. I don't care about lost data, but I need to make minimal parsed / valid json.
for ex:
data = '{"state_id":[null,20],"dispatcher_id":[null,6057525],"uir":[null,{"level":"2"'
I need to do it right, for example
data = '{"state_id":[null,20],"dispatcher_id":[null,6057525],"uir":[null,{"level":"2"}]}'
add }]} to the end of json.
Is there any quick way to do this? Or should I write my own parser / commit?
source share