Undesirable escaping happens after changing field type in mysql from text to json (insert json without additional escaping))

After changing field type in mysql 5.7 from text to json, data got undesirably escaped on insert. So I get this in db:

| "{\"zipcode\":\"23231\",\"city\":\"HENRICO\"}"  |
| "{\"zipcode\":\"10001\",\"city\":\"NEW YORK\"}" |
| {"city": "DETROIT", "zipcode": "48223"}         |
| {"city": "CINCINNATI", "zipcode": "45231"}      |

where lower rows have been inserted before type conversion, and uppder ones - after.

data in the field are set in a usual way with
$this->data = json_encode(['zip' => 10001, ...]);

I tried to change validation rule for ‘data’ field from ‘string’ to ‘safe’ but nothing helps

How to insert json data into json field in db without additional escaping with yii active record ?