{"action":"opened","issue":{"url":"https://api.github.com/repos/schematics/schematics/issues/307","labels_url":"https://api.github.com/repos/schematics/schematics/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/schematics/schematics/issues/307/comments","events_url":"https://api.github.com/repos/schematics/schematics/issues/307/events","html_url":"https://github.com/schematics/schematics/issues/307","id":84472387,"number":307,"title":"Return index of invalid objects","user":{"login":"netcriptus","id":66514,"avatar_url":"https://avatars.githubusercontent.com/u/66514?v=3","gravatar_id":"","url":"https://api.github.com/users/netcriptus","html_url":"https://github.com/netcriptus","followers_url":"https://api.github.com/users/netcriptus/followers","following_url":"https://api.github.com/users/netcriptus/following{/other_user}","gists_url":"https://api.github.com/users/netcriptus/gists{/gist_id}","starred_url":"https://api.github.com/users/netcriptus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/netcriptus/subscriptions","organizations_url":"https://api.github.com/users/netcriptus/orgs","repos_url":"https://api.github.com/users/netcriptus/repos","events_url":"https://api.github.com/users/netcriptus/events{/privacy}","received_events_url":"https://api.github.com/users/netcriptus/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-06-03T09:56:13Z","updated_at":"2015-06-03T09:56:13Z","closed_at":null,"body":"So, in my models I define a `user`, and a `user` has many `addresses`, which are defined in their own class. So when mapping the model to a schematics class, it becomes something like this\r\n\r\n```\r\nclass UserResource(BaseSchema):\r\n\r\n    \"\"\"User resource.\"\"\"\r\n\r\n    __entity__ = User\r\n    user_addresses = ListType(ModelType(UserAddressResource))\r\n```\r\n\r\nHere's the problem: imagine I have a user with 5 addresses, but 2 of them are invalid. Currently, schematics returns something like `UserAddresses: [{'street': ['Not a well formed street name.']}, {'street': ['Not a well formed street name.']}]`.\r\n\r\nIt would be great to have the index of those invalid objects in the list. My only current option is to run the validation again on each object until I find the invalid ones. But this is not practical, considering it will be doing the same work twice, and models usually have more than one relationship, so it's linked to many other models."}}