{"action":"created","issue":{"url":"https://api.github.com/repos/guardian/scanamo/issues/78","repository_url":"https://api.github.com/repos/guardian/scanamo","labels_url":"https://api.github.com/repos/guardian/scanamo/issues/78/labels{/name}","comments_url":"https://api.github.com/repos/guardian/scanamo/issues/78/comments","events_url":"https://api.github.com/repos/guardian/scanamo/issues/78/events","html_url":"https://github.com/guardian/scanamo/pull/78","id":198067841,"number":78,"title":"Support derivation of coproducts","user":{"login":"cb372","id":106760,"avatar_url":"https://avatars.githubusercontent.com/u/106760?v=3","gravatar_id":"","url":"https://api.github.com/users/cb372","html_url":"https://github.com/cb372","followers_url":"https://api.github.com/users/cb372/followers","following_url":"https://api.github.com/users/cb372/following{/other_user}","gists_url":"https://api.github.com/users/cb372/gists{/gist_id}","starred_url":"https://api.github.com/users/cb372/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cb372/subscriptions","organizations_url":"https://api.github.com/users/cb372/orgs","repos_url":"https://api.github.com/users/cb372/repos","events_url":"https://api.github.com/users/cb372/events{/privacy}","received_events_url":"https://api.github.com/users/cb372/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-29T20:59:21Z","updated_at":"2017-01-05T22:03:02Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/guardian/scanamo/pulls/78","html_url":"https://github.com/guardian/scanamo/pull/78","diff_url":"https://github.com/guardian/scanamo/pull/78.diff","patch_url":"https://github.com/guardian/scanamo/pull/78.patch"},"body":"Coproducts are encoded as a map with one field, whose key is the type hint.\n\ne.g. given\n\n```scala\nsealed trait Animal\ncase class Cat(name: String, legs: Int) extends Animal\n\nval cat = Cat(\"Eric\", 4)\n```\n\n`cat` would be encoded in Dynamo as (using jsony syntax) `{ \"Cat\": { \"name\": \"Eric\", \"legs\": 4 } }`\n\nI feel like there must be a good reason why @philwills decided not to implement this until now, but I think it is pretty useful. For example it means you can encode enumerations using a sealed trait + case objects, which is a very common thing to do, without having to write a boilerplate-y custom `DynamoFormat`."},"comment":{"url":"https://api.github.com/repos/guardian/scanamo/issues/comments/270770674","html_url":"https://github.com/guardian/scanamo/pull/78#issuecomment-270770674","issue_url":"https://api.github.com/repos/guardian/scanamo/issues/78","id":270770674,"user":{"login":"philwills","id":68329,"avatar_url":"https://avatars.githubusercontent.com/u/68329?v=3","gravatar_id":"","url":"https://api.github.com/users/philwills","html_url":"https://github.com/philwills","followers_url":"https://api.github.com/users/philwills/followers","following_url":"https://api.github.com/users/philwills/following{/other_user}","gists_url":"https://api.github.com/users/philwills/gists{/gist_id}","starred_url":"https://api.github.com/users/philwills/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/philwills/subscriptions","organizations_url":"https://api.github.com/users/philwills/orgs","repos_url":"https://api.github.com/users/philwills/repos","events_url":"https://api.github.com/users/philwills/events{/privacy}","received_events_url":"https://api.github.com/users/philwills/received_events","type":"User","site_admin":false},"created_at":"2017-01-05T22:03:02Z","updated_at":"2017-01-05T22:03:02Z","body":"Eek, that is a bit terrifying.  I do wonder whether this would be better as an opt-in, rather than a default behaviour, but it does seem a bit strange for that to be different from what we do for Products."}}
{"actor":{"display_login":"philwills"}}