{"action":"created","issue":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/3208","labels_url":"https://api.github.com/repos/sequelize/sequelize/issues/3208/labels{/name}","comments_url":"https://api.github.com/repos/sequelize/sequelize/issues/3208/comments","events_url":"https://api.github.com/repos/sequelize/sequelize/issues/3208/events","html_url":"https://github.com/sequelize/sequelize/issues/3208","id":58697280,"number":3208,"title":"Validation of array input to array field failed for PostgreSQL","user":{"login":"cithukyaw","id":4285555,"avatar_url":"https://avatars.githubusercontent.com/u/4285555?v=3","gravatar_id":"","url":"https://api.github.com/users/cithukyaw","html_url":"https://github.com/cithukyaw","followers_url":"https://api.github.com/users/cithukyaw/followers","following_url":"https://api.github.com/users/cithukyaw/following{/other_user}","gists_url":"https://api.github.com/users/cithukyaw/gists{/gist_id}","starred_url":"https://api.github.com/users/cithukyaw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cithukyaw/subscriptions","organizations_url":"https://api.github.com/users/cithukyaw/orgs","repos_url":"https://api.github.com/users/cithukyaw/repos","events_url":"https://api.github.com/users/cithukyaw/events{/privacy}","received_events_url":"https://api.github.com/users/cithukyaw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-02-24T06:01:32Z","updated_at":"2015-03-18T21:29:08Z","closed_at":null,"body":"I'm using [Node.js](http://nodejs.org) + [PostgreSQL](http://www.postgresql.org/) + [Sequelize.js 2.0.2](http://sequelizejs.com/). I have the following schema definition for the phone field which could be array of strings, but only number is allowed:\r\n\r\n\tvar User = sequelize.define(\"User\", {\r\n\t\t....\r\n\t\t....\r\n\t\t/** Phone number\r\n\t\t * Multiple numbers should be registered due to\r\n\t\t */\r\n\t\tphone: {\r\n\t\t\ttype: Sequelize.ARRAY(Sequelize.STRING),\r\n\t\t\tallowNull: false,\r\n\t\t\tunique: true,\r\n\t\t\tvalidate: {\r\n\t\t\t\tisNumeric: true\r\n\t\t\t}\r\n\t\t},\r\n\t\t....\r\n\t\t....\r\n\t});\r\n\r\nThe array of numeric phone numbers is not passed for validation.\r\n\r\n**Input**: `[ '9252522525', '9252525555' ]`  \r\n\r\n**Error**:\r\n\r\n\t{ [SequelizeValidationError: Validation error]\r\n\t  name: 'SequelizeValidationError',\r\n\t  message: 'Validation error',\r\n\t  errors: \r\n\t   [ { message: 'Validation isNumeric failed',\r\n\t\t   type: 'Validation error',\r\n\t\t   path: 'phone',\r\n\t\t   value: 'Validation isNumeric failed',\r\n\t\t   __raw: 'Validation isNumeric failed' } ] }\r\n\r\n\r\nHowever, the single-value array input `[ '9252522525' ]` is successful. Is it Sequelize's bug or what am I wrong?\r\n\r\nI changed the validator to `is`, but no success.\r\n\r\n\tvalidate: {\r\n\t\tis: [\"^[0-9]+$\", \"i\"]\r\n\t}\r\n\r\nI got the following error.\r\n\r\n\t{ [SequelizeValidationError: Validation error]\r\n\t  name: 'SequelizeValidationError',\r\n\t  message: 'Validation error',\r\n\t  errors: \r\n\t   [ { message: 'Validation is failed',\r\n\t\t   type: 'Validation error',\r\n\t\t   path: 'phone',\r\n\t\t   value: 'Validation is failed',\r\n\t\t   __raw: 'Validation is failed' } ] }\r\n\r\n**Expected:** Applying the validator to each item of the array."},"comment":{"url":"https://api.github.com/repos/sequelize/sequelize/issues/comments/83186549","html_url":"https://github.com/sequelize/sequelize/issues/3208#issuecomment-83186549","issue_url":"https://api.github.com/repos/sequelize/sequelize/issues/3208","id":83186549,"user":{"login":"wavded","id":26638,"avatar_url":"https://avatars.githubusercontent.com/u/26638?v=3","gravatar_id":"","url":"https://api.github.com/users/wavded","html_url":"https://github.com/wavded","followers_url":"https://api.github.com/users/wavded/followers","following_url":"https://api.github.com/users/wavded/following{/other_user}","gists_url":"https://api.github.com/users/wavded/gists{/gist_id}","starred_url":"https://api.github.com/users/wavded/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wavded/subscriptions","organizations_url":"https://api.github.com/users/wavded/orgs","repos_url":"https://api.github.com/users/wavded/repos","events_url":"https://api.github.com/users/wavded/events{/privacy}","received_events_url":"https://api.github.com/users/wavded/received_events","type":"User","site_admin":false},"created_at":"2015-03-18T21:29:08Z","updated_at":"2015-03-18T21:29:08Z","body":"Chiming in here late but is there a way to validate array elements?  Or no?  I'm not having any luck."}}