{"action":"created","issue":{"url":"https://api.github.com/repos/timothycrosley/hug/issues/627","repository_url":"https://api.github.com/repos/timothycrosley/hug","labels_url":"https://api.github.com/repos/timothycrosley/hug/issues/627/labels{/name}","comments_url":"https://api.github.com/repos/timothycrosley/hug/issues/627/comments","events_url":"https://api.github.com/repos/timothycrosley/hug/issues/627/events","html_url":"https://github.com/timothycrosley/hug/issues/627","id":303179400,"number":627,"title":"when using a marshmallow schema as return type hint, both data and errors are returned","user":{"login":"djoek","id":3184142,"avatar_url":"https://avatars0.githubusercontent.com/u/3184142?v=4","gravatar_id":"","url":"https://api.github.com/users/djoek","html_url":"https://github.com/djoek","followers_url":"https://api.github.com/users/djoek/followers","following_url":"https://api.github.com/users/djoek/following{/other_user}","gists_url":"https://api.github.com/users/djoek/gists{/gist_id}","starred_url":"https://api.github.com/users/djoek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/djoek/subscriptions","organizations_url":"https://api.github.com/users/djoek/orgs","repos_url":"https://api.github.com/users/djoek/repos","events_url":"https://api.github.com/users/djoek/events{/privacy}","received_events_url":"https://api.github.com/users/djoek/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-03-07T16:59:08Z","updated_at":"2018-05-19T08:18:24Z","closed_at":null,"author_association":"NONE","body":"when using:\r\n\r\n```python\r\n\r\n@hug.get()\r\ndef items(_id: hug.types.text) -> item_schema:\r\n    return item_db.find_one(_id)\r\n```\r\n\r\nthe resulting json is \r\n\r\n```json\r\n\r\n{\"data\": {...item...}, \"errors\": {}}\r\n```\r\n\r\nCan this be made analogous to using a marshmallow schema on input ie. if valid, data gets returned, otherwise, error?"},"comment":{"url":"https://api.github.com/repos/timothycrosley/hug/issues/comments/390388816","html_url":"https://github.com/timothycrosley/hug/issues/627#issuecomment-390388816","issue_url":"https://api.github.com/repos/timothycrosley/hug/issues/627","id":390388816,"user":{"login":"dangitall","id":882363,"avatar_url":"https://avatars2.githubusercontent.com/u/882363?v=4","gravatar_id":"","url":"https://api.github.com/users/dangitall","html_url":"https://github.com/dangitall","followers_url":"https://api.github.com/users/dangitall/followers","following_url":"https://api.github.com/users/dangitall/following{/other_user}","gists_url":"https://api.github.com/users/dangitall/gists{/gist_id}","starred_url":"https://api.github.com/users/dangitall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dangitall/subscriptions","organizations_url":"https://api.github.com/users/dangitall/orgs","repos_url":"https://api.github.com/users/dangitall/repos","events_url":"https://api.github.com/users/dangitall/events{/privacy}","received_events_url":"https://api.github.com/users/dangitall/received_events","type":"User","site_admin":false},"created_at":"2018-05-19T08:18:24Z","updated_at":"2018-05-19T08:18:24Z","author_association":"CONTRIBUTOR","body":"@djoek I agree the behavior seems wrong, but instead of getting an errors field returned, wouldn't you expect hug to raise an exception like it does for other return type annotations?"}}
{"actor":{"display_login":"dangitall"}}