{"action":"created","issue":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/127","labels_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/127/labels{/name}","comments_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/127/comments","events_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/127/events","html_url":"https://github.com/marshmallow-code/marshmallow/issues/127","id":54613661,"number":127,"title":"Turn off automatic skipping of unknown fields","user":{"login":"ryanlowe0","id":1004148,"avatar_url":"https://avatars.githubusercontent.com/u/1004148?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanlowe0","html_url":"https://github.com/ryanlowe0","followers_url":"https://api.github.com/users/ryanlowe0/followers","following_url":"https://api.github.com/users/ryanlowe0/following{/other_user}","gists_url":"https://api.github.com/users/ryanlowe0/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanlowe0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanlowe0/subscriptions","organizations_url":"https://api.github.com/users/ryanlowe0/orgs","repos_url":"https://api.github.com/users/ryanlowe0/repos","events_url":"https://api.github.com/users/ryanlowe0/events{/privacy}","received_events_url":"https://api.github.com/users/ryanlowe0/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/labels/ready+to+claim","name":"ready to claim","color":"009800"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/milestones/3","labels_url":"https://api.github.com/repos/marshmallow-code/marshmallow/milestones/3/labels","id":890875,"number":3,"title":"2.0-a","description":"","creator":{"login":"sloria","id":2379650,"avatar_url":"https://avatars.githubusercontent.com/u/2379650?v=3","gravatar_id":"","url":"https://api.github.com/users/sloria","html_url":"https://github.com/sloria","followers_url":"https://api.github.com/users/sloria/followers","following_url":"https://api.github.com/users/sloria/following{/other_user}","gists_url":"https://api.github.com/users/sloria/gists{/gist_id}","starred_url":"https://api.github.com/users/sloria/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sloria/subscriptions","organizations_url":"https://api.github.com/users/sloria/orgs","repos_url":"https://api.github.com/users/sloria/repos","events_url":"https://api.github.com/users/sloria/events{/privacy}","received_events_url":"https://api.github.com/users/sloria/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":6,"state":"open","created_at":"2014-12-04T02:25:18Z","updated_at":"2015-01-18T18:15:56Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2015-01-16T19:19:15Z","updated_at":"2015-01-19T18:59:26Z","closed_at":null,"body":"When loading/deserializing, unknown field names are skipped. It would be nice to be able to raise an error instead, particularly when calling ```.validate()```. Currently this doesnt seem possible, even with a custom validator, because the field filtering appears to already have occurred by the time the validator gets a hold of it, e.g.\r\n\r\n```python\r\nclass MySchema:\r\n    foo = field.String()\r\n\r\n@MySchema.validator\r\ndef check_unknown_fields(schema, data):\r\n    for k in data:\r\n        if k not in schema.fields:\r\n            raise ValidationError(\"Unknown field name: '{}'\".format(k))\r\n\r\nerrors = MySchema().validate({'bar': 'abc'})\r\n```\r\n\r\ndoesnt work because data will be an empty ```{}``` by the time ```check_unknown_fields()``` is called."},"comment":{"url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/comments/70543119","html_url":"https://github.com/marshmallow-code/marshmallow/issues/127#issuecomment-70543119","issue_url":"https://api.github.com/repos/marshmallow-code/marshmallow/issues/127","id":70543119,"user":{"login":"ryanlowe0","id":1004148,"avatar_url":"https://avatars.githubusercontent.com/u/1004148?v=3","gravatar_id":"","url":"https://api.github.com/users/ryanlowe0","html_url":"https://github.com/ryanlowe0","followers_url":"https://api.github.com/users/ryanlowe0/followers","following_url":"https://api.github.com/users/ryanlowe0/following{/other_user}","gists_url":"https://api.github.com/users/ryanlowe0/gists{/gist_id}","starred_url":"https://api.github.com/users/ryanlowe0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryanlowe0/subscriptions","organizations_url":"https://api.github.com/users/ryanlowe0/orgs","repos_url":"https://api.github.com/users/ryanlowe0/repos","events_url":"https://api.github.com/users/ryanlowe0/events{/privacy}","received_events_url":"https://api.github.com/users/ryanlowe0/received_events","type":"User","site_admin":false},"created_at":"2015-01-19T18:59:26Z","updated_at":"2015-01-19T18:59:26Z","body":"@sloria I started to implement adding the proposed raw_data argument, however I have a concern before putting it into a PR.\r\n\r\nSending a second ```raw_data``` arg rather than changing the behavior of ```data``` arg sounds great from a backwards compatibility standpoint, but only if it were optional. Unfortunately, this is proving tricky due to the way validators are collected and stored before being called. I thought maybe I could use ```inspect.getargspec``` to detect whether the additional arg was present, but apparently it doesnt work properly with partials in Python 2.6/7 (perhaps only in 3.4).\r\n\r\nThere may yet some way to get around this, but it may get ugly. An alternative idea would be to introduce some optional meta attribute or something that would cause raw data to be sent to validators *instead* of filtered data.\r\n\r\nIn short, which of these sounds best?\r\n\r\n1. Figure out some way to make raw_data be an optional third arg to user-defined validators\r\n2. Keep the ```(schema, data)``` arg signature but add a meta-level flag to toggle between raw/filtered data\r\n3. Always require the third raw_data arg\r\n4. Stop filtering data altogether\r\n\r\nNumbers 3 and 4 are simplest but break backwards compatibility..\r\n\r\n\r\n"}}