{"action":"created","issue":{"url":"https://api.github.com/repos/vuejs/vue-validator/issues/221","repository_url":"https://api.github.com/repos/vuejs/vue-validator","labels_url":"https://api.github.com/repos/vuejs/vue-validator/issues/221/labels{/name}","comments_url":"https://api.github.com/repos/vuejs/vue-validator/issues/221/comments","events_url":"https://api.github.com/repos/vuejs/vue-validator/issues/221/events","html_url":"https://github.com/vuejs/vue-validator/issues/221","id":154170797,"number":221,"title":"Vue resource in async validation","user":{"login":"jonas8","id":743166,"avatar_url":"https://avatars.githubusercontent.com/u/743166?v=3","gravatar_id":"","url":"https://api.github.com/users/jonas8","html_url":"https://github.com/jonas8","followers_url":"https://api.github.com/users/jonas8/followers","following_url":"https://api.github.com/users/jonas8/following{/other_user}","gists_url":"https://api.github.com/users/jonas8/gists{/gist_id}","starred_url":"https://api.github.com/users/jonas8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jonas8/subscriptions","organizations_url":"https://api.github.com/users/jonas8/orgs","repos_url":"https://api.github.com/users/jonas8/repos","events_url":"https://api.github.com/users/jonas8/events{/privacy}","received_events_url":"https://api.github.com/users/jonas8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-11T06:42:10Z","updated_at":"2016-05-11T08:15:20Z","closed_at":null,"body":"Hi,\r\n\r\nI use vue-resource in an async validation field, but Vue.http or this.$http.post always return a resolved promise, the partials code is following:\r\n\r\nThe template markup is like this:\r\n```html\r\n <input id=\"sms\" type=\"text\" \r\n          detect-change=\"off\" v-validate:sms=\"{\r\n          required: { rule: true},\r\n          smsVerify: { rule: true, initial: 'off' }\r\n        }\" />\r\n```\r\nJavascript is like this:\r\n```javascript\r\nexport default {\r\n  data () {\r\n    return {\r\n      ...\r\n    }\r\n  },\r\n  validators: {\r\n    smsVerify (val) {\r\n      let promise = this.vm.$http.post(API_CONTEXT.SMS_VALIDATE.resource,..)\r\n      console.log(promise) \r\n      // the promise here is always resolved, \r\n      // even if my rest api return http code 403\r\n      ...\r\n    }\r\n  },\r\n  methods: {\r\n    smsVerifyInMethods () {\r\n      let promise = this.$http.post(API_CONTEXT.SMS_VALIDATE.resource,...)\r\n      console.log(promise) \r\n      // the promise here returns the expectation resolved or rejected\r\n      ...\r\n    }\r\n    ...\r\n  }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/vuejs/vue-validator/issues/comments/218392089","html_url":"https://github.com/vuejs/vue-validator/issues/221#issuecomment-218392089","issue_url":"https://api.github.com/repos/vuejs/vue-validator/issues/221","id":218392089,"user":{"login":"kazupon","id":72989,"avatar_url":"https://avatars.githubusercontent.com/u/72989?v=3","gravatar_id":"","url":"https://api.github.com/users/kazupon","html_url":"https://github.com/kazupon","followers_url":"https://api.github.com/users/kazupon/followers","following_url":"https://api.github.com/users/kazupon/following{/other_user}","gists_url":"https://api.github.com/users/kazupon/gists{/gist_id}","starred_url":"https://api.github.com/users/kazupon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kazupon/subscriptions","organizations_url":"https://api.github.com/users/kazupon/orgs","repos_url":"https://api.github.com/users/kazupon/repos","events_url":"https://api.github.com/users/kazupon/events{/privacy}","received_events_url":"https://api.github.com/users/kazupon/received_events","type":"User","site_admin":false},"created_at":"2016-05-11T08:15:20Z","updated_at":"2016-05-11T08:15:20Z","body":"You need to implement custom validation that **return a promise**. \r\nhttp://vuejs.github.io/vue-validator/en/async.html\r\n\r\nIn the above partials code, You don't return a promise.\r\nIn real code, You return a promise, don't you?"}}