{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2-gii/issues/351","repository_url":"https://api.github.com/repos/yiisoft/yii2-gii","labels_url":"https://api.github.com/repos/yiisoft/yii2-gii/issues/351/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2-gii/issues/351/comments","events_url":"https://api.github.com/repos/yiisoft/yii2-gii/issues/351/events","html_url":"https://github.com/yiisoft/yii2-gii/issues/351","id":313582448,"number":351,"title":"Mysql JSON fields are validated by string validator, which throws error on save","user":{"login":"yavuzg2","id":13781075,"avatar_url":"https://avatars1.githubusercontent.com/u/13781075?v=4","gravatar_id":"","url":"https://api.github.com/users/yavuzg2","html_url":"https://github.com/yavuzg2","followers_url":"https://api.github.com/users/yavuzg2/followers","following_url":"https://api.github.com/users/yavuzg2/following{/other_user}","gists_url":"https://api.github.com/users/yavuzg2/gists{/gist_id}","starred_url":"https://api.github.com/users/yavuzg2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yavuzg2/subscriptions","organizations_url":"https://api.github.com/users/yavuzg2/orgs","repos_url":"https://api.github.com/users/yavuzg2/repos","events_url":"https://api.github.com/users/yavuzg2/events{/privacy}","received_events_url":"https://api.github.com/users/yavuzg2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-04-12T05:29:57Z","updated_at":"2018-04-13T08:00:58Z","closed_at":null,"author_association":"NONE","body":"<!--\r\nPlease use this issue tracker for bugs and feature requests only. In case you need support please use one of\r\nYii communities listed at https://github.com/yiisoft/yii2/wiki/communities\r\n-->\r\n\r\n### What steps will reproduce the problem?\r\n1. Define a json column in a mysql table.\r\n2. Generate the model and crud files.\r\n3. Fill the JSON column for a row with valid json data in the database.\r\n4. Remove the json field from crud form.\r\n5. Execute $model->save() on the row without changing the json column.\r\n\r\n### What's expected?\r\nAdd the safe validator instead of string validator, or define a custom validator for json data\r\n\r\n### What do you get instead?\r\nGii adds a string validator for json columns which throws an error while validating, e.g. catalog_tree must be a string.\r\nThis error is thrown even if the column is not changed at all, e.g. it cannot validate the valid existing data.\r\n\r\n### Additional info\r\n\r\n| Q                | A\r\n| ---------------- | ---\r\n| Yii version      | 2.0.14 and above\r\n| PHP version      | 7.1 \r\n| Operating system | debian 8\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2-gii/issues/comments/381056689","html_url":"https://github.com/yiisoft/yii2-gii/issues/351#issuecomment-381056689","issue_url":"https://api.github.com/repos/yiisoft/yii2-gii/issues/351","id":381056689,"user":{"login":"schmunk42","id":649031,"avatar_url":"https://avatars1.githubusercontent.com/u/649031?v=4","gravatar_id":"","url":"https://api.github.com/users/schmunk42","html_url":"https://github.com/schmunk42","followers_url":"https://api.github.com/users/schmunk42/followers","following_url":"https://api.github.com/users/schmunk42/following{/other_user}","gists_url":"https://api.github.com/users/schmunk42/gists{/gist_id}","starred_url":"https://api.github.com/users/schmunk42/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/schmunk42/subscriptions","organizations_url":"https://api.github.com/users/schmunk42/orgs","repos_url":"https://api.github.com/users/schmunk42/repos","events_url":"https://api.github.com/users/schmunk42/events{/privacy}","received_events_url":"https://api.github.com/users/schmunk42/received_events","type":"User","site_admin":false},"created_at":"2018-04-13T08:00:58Z","updated_at":"2018-04-13T08:00:58Z","author_association":"CONTRIBUTOR","body":"Is the column required (NOT NULL)?"}}
{"actor":{"display_login":"schmunk42"}}