{"action":"created","issue":{"url":"https://api.github.com/repos/mapbox/mapbox-sdk-py/issues/96","labels_url":"https://api.github.com/repos/mapbox/mapbox-sdk-py/issues/96/labels{/name}","comments_url":"https://api.github.com/repos/mapbox/mapbox-sdk-py/issues/96/comments","events_url":"https://api.github.com/repos/mapbox/mapbox-sdk-py/issues/96/events","html_url":"https://github.com/mapbox/mapbox-sdk-py/pull/96","id":122107005,"number":96,"title":"Validation","user":{"login":"perrygeo","id":1151287,"avatar_url":"https://avatars.githubusercontent.com/u/1151287?v=3","gravatar_id":"","url":"https://api.github.com/users/perrygeo","html_url":"https://github.com/perrygeo","followers_url":"https://api.github.com/users/perrygeo/followers","following_url":"https://api.github.com/users/perrygeo/following{/other_user}","gists_url":"https://api.github.com/users/perrygeo/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygeo/subscriptions","organizations_url":"https://api.github.com/users/perrygeo/orgs","repos_url":"https://api.github.com/users/perrygeo/repos","events_url":"https://api.github.com/users/perrygeo/events{/privacy}","received_events_url":"https://api.github.com/users/perrygeo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-12-14T18:57:00Z","updated_at":"2015-12-14T22:00:42Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-sdk-py/pulls/96","html_url":"https://github.com/mapbox/mapbox-sdk-py/pull/96","diff_url":"https://github.com/mapbox/mapbox-sdk-py/pull/96.diff","patch_url":"https://github.com/mapbox/mapbox-sdk-py/pull/96.patch"},"body":"The primary aim of this PR is to clean up the the validation of inputs and make sure they raise a `MapboxValidationError`. This allows the CLI to catch know validation errors and expose them as clean command line help, rather than python stack traces.\r\n\r\nIt's fully tested and working but needs review.\r\n\r\n* I'm not convinced that the exception naming is all that great\r\n* I implemented most of the logic in the the service classes rather than in the validation module which makes me wonder why have a validation module at all."},"comment":{"url":"https://api.github.com/repos/mapbox/mapbox-sdk-py/issues/comments/164573361","html_url":"https://github.com/mapbox/mapbox-sdk-py/pull/96#issuecomment-164573361","issue_url":"https://api.github.com/repos/mapbox/mapbox-sdk-py/issues/96","id":164573361,"user":{"login":"perrygeo","id":1151287,"avatar_url":"https://avatars.githubusercontent.com/u/1151287?v=3","gravatar_id":"","url":"https://api.github.com/users/perrygeo","html_url":"https://github.com/perrygeo","followers_url":"https://api.github.com/users/perrygeo/followers","following_url":"https://api.github.com/users/perrygeo/following{/other_user}","gists_url":"https://api.github.com/users/perrygeo/gists{/gist_id}","starred_url":"https://api.github.com/users/perrygeo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/perrygeo/subscriptions","organizations_url":"https://api.github.com/users/perrygeo/orgs","repos_url":"https://api.github.com/users/perrygeo/repos","events_url":"https://api.github.com/users/perrygeo/events{/privacy}","received_events_url":"https://api.github.com/users/perrygeo/received_events","type":"User","site_admin":false},"created_at":"2015-12-14T22:00:42Z","updated_at":"2015-12-14T22:00:42Z","body":">  take a file object here and not a filename\r\n\r\nThis is a breaking change to the API (effects both `.upload` and `.stage` methods of the service) so I wanted to double-check. Will require changing tests and docs.\r\n\r\n> KeyError\r\n\r\nis it sufficient or even desirable to say `class ValidationError(KeyError, ValueError)`? Then every validation error can be caught by KeyError which seems odd since most validation errors have nothing to do with dicts."}}