{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/8688","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/8688/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/8688/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/8688/events","html_url":"https://github.com/aspnet/Mvc/issues/8688","id":377238347,"node_id":"MDU6SXNzdWUzNzcyMzgzNDc=","number":8688,"title":"Is it possible to provide an independent object validator for Model","user":{"login":"xiaotupansy","id":10205937,"node_id":"MDQ6VXNlcjEwMjA1OTM3","avatar_url":"https://avatars3.githubusercontent.com/u/10205937?v=4","gravatar_id":"","url":"https://api.github.com/users/xiaotupansy","html_url":"https://github.com/xiaotupansy","followers_url":"https://api.github.com/users/xiaotupansy/followers","following_url":"https://api.github.com/users/xiaotupansy/following{/other_user}","gists_url":"https://api.github.com/users/xiaotupansy/gists{/gist_id}","starred_url":"https://api.github.com/users/xiaotupansy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xiaotupansy/subscriptions","organizations_url":"https://api.github.com/users/xiaotupansy/orgs","repos_url":"https://api.github.com/users/xiaotupansy/repos","events_url":"https://api.github.com/users/xiaotupansy/events{/privacy}","received_events_url":"https://api.github.com/users/xiaotupansy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-05T03:31:46Z","updated_at":"2018-11-05T03:47:17Z","closed_at":null,"author_association":"NONE","body":"#### Is this a Bug or Feature request?:\r\nFeature request\r\n\r\nWhat I want is an independent object validator for Model that can be used anywhere without binding to Controller.\r\n\r\nHere's the sample usage:\r\n`ObjectValidator<MyModel>.Validate(myModelEntity) returns true or false.`\r\n\r\nLike json schema.\r\nhttps://github.com/tdegrunt/jsonschema\r\nSample json schema code for validation:\r\nvar validate = require('jsonschema').validate;\r\nconsole.log(validate(4, {\"type\": \"number\"}));\r\n\r\n\r\nAnd I hope that I can specify the properties that should be validated without validating the whole model.\r\nHere's the sample usage:\r\n```\r\nObjectValidator<MyModel>.Validate(m=>m.Name,\"111\") returns true or false.\r\nObjectValidator<MyModel>.Validate(\"Name\",\"111\") returns true or false.\r\n```"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/435747289","html_url":"https://github.com/aspnet/Mvc/issues/8688#issuecomment-435747289","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/8688","id":435747289,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNTc0NzI4OQ==","user":{"login":"rynowak","id":1430011,"node_id":"MDQ6VXNlcjE0MzAwMTE=","avatar_url":"https://avatars1.githubusercontent.com/u/1430011?v=4","gravatar_id":"","url":"https://api.github.com/users/rynowak","html_url":"https://github.com/rynowak","followers_url":"https://api.github.com/users/rynowak/followers","following_url":"https://api.github.com/users/rynowak/following{/other_user}","gists_url":"https://api.github.com/users/rynowak/gists{/gist_id}","starred_url":"https://api.github.com/users/rynowak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rynowak/subscriptions","organizations_url":"https://api.github.com/users/rynowak/orgs","repos_url":"https://api.github.com/users/rynowak/repos","events_url":"https://api.github.com/users/rynowak/events{/privacy}","received_events_url":"https://api.github.com/users/rynowak/received_events","type":"User","site_admin":false},"created_at":"2018-11-05T03:47:17Z","updated_at":"2018-11-05T03:47:17Z","author_association":"MEMBER","body":"We have no plans to provide something like this in the framework. MVC's validation features are deeply tied to details of how the framework understands model objects and how it tracks validation errors. "}}
{"actor":{"display_login":"rynowak"}}