{"action":"created","issue":{"url":"https://api.github.com/repos/GetShopTV/swagger2/issues/80","repository_url":"https://api.github.com/repos/GetShopTV/swagger2","labels_url":"https://api.github.com/repos/GetShopTV/swagger2/issues/80/labels{/name}","comments_url":"https://api.github.com/repos/GetShopTV/swagger2/issues/80/comments","events_url":"https://api.github.com/repos/GetShopTV/swagger2/issues/80/events","html_url":"https://github.com/GetShopTV/swagger2/issues/80","id":178084557,"number":80,"title":"Generic deriving doesn't nest","user":{"login":"parsonsmatt","id":7310112,"avatar_url":"https://avatars.githubusercontent.com/u/7310112?v=3","gravatar_id":"","url":"https://api.github.com/users/parsonsmatt","html_url":"https://github.com/parsonsmatt","followers_url":"https://api.github.com/users/parsonsmatt/followers","following_url":"https://api.github.com/users/parsonsmatt/following{/other_user}","gists_url":"https://api.github.com/users/parsonsmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/parsonsmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parsonsmatt/subscriptions","organizations_url":"https://api.github.com/users/parsonsmatt/orgs","repos_url":"https://api.github.com/users/parsonsmatt/repos","events_url":"https://api.github.com/users/parsonsmatt/events{/privacy}","received_events_url":"https://api.github.com/users/parsonsmatt/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-20T14:57:16Z","updated_at":"2016-09-20T17:01:20Z","closed_at":"2016-09-20T17:01:20Z","body":"Deriving a generic implementation of a data type only considers the top level generic derivation and requires `ToSchema` instances of all data types contained therein, rather than just `Generic` instances.\r\n\r\nSuppose I have a type `Foo` in a library that I want an instance of `ToSchema` for:\r\n\r\n```haskell\r\nmodule Whatever where\r\n\r\ndata Foo = Foo { bar :: Bar }\r\n    deriving Generic\r\n\r\ndata Bar = Bar deriving Generic\r\n```\r\n\r\nIn my own code, I'd write:\r\n\r\n```haskell\r\nnewtype MyFoo = MyFoo Foo\r\n    deriving Generic\r\n\r\ninstance ToSchema MyFoo\r\n```\r\n\r\nThe code now is going to complain that `Foo` doesn't have a `ToSchema` instance. So instead I can do:\r\n\r\n```haskell\r\ninstance ToSchema MyFoo where\r\n    declareNamedSchema _ = genericDeclareNamedSchema defaultSchemaOptions (Proxy :: Proxy Foo)\r\n```\r\n\r\nwhich works for `Foo`, but complains about `Bar`.\r\n\r\nIdeally, the generic derivation should use the `Generic` machinery all the way down."},"comment":{"url":"https://api.github.com/repos/GetShopTV/swagger2/issues/comments/248364681","html_url":"https://github.com/GetShopTV/swagger2/issues/80#issuecomment-248364681","issue_url":"https://api.github.com/repos/GetShopTV/swagger2/issues/80","id":248364681,"user":{"login":"parsonsmatt","id":7310112,"avatar_url":"https://avatars.githubusercontent.com/u/7310112?v=3","gravatar_id":"","url":"https://api.github.com/users/parsonsmatt","html_url":"https://github.com/parsonsmatt","followers_url":"https://api.github.com/users/parsonsmatt/followers","following_url":"https://api.github.com/users/parsonsmatt/following{/other_user}","gists_url":"https://api.github.com/users/parsonsmatt/gists{/gist_id}","starred_url":"https://api.github.com/users/parsonsmatt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/parsonsmatt/subscriptions","organizations_url":"https://api.github.com/users/parsonsmatt/orgs","repos_url":"https://api.github.com/users/parsonsmatt/repos","events_url":"https://api.github.com/users/parsonsmatt/events{/privacy}","received_events_url":"https://api.github.com/users/parsonsmatt/received_events","type":"User","site_admin":false},"created_at":"2016-09-20T17:01:20Z","updated_at":"2016-09-20T17:01:20Z","body":"That's fair. Do you know off hand if there's a reason that the generic instance doesn't fallback to generic if `ToSchema` or `ToJSON` aren't found?"}}
{"actor":{"display_login":"parsonsmatt"}}