{"action":"created","issue":{"url":"https://api.github.com/repos/sksamuel/avro4s/issues/37","repository_url":"https://api.github.com/repos/sksamuel/avro4s","labels_url":"https://api.github.com/repos/sksamuel/avro4s/issues/37/labels{/name}","comments_url":"https://api.github.com/repos/sksamuel/avro4s/issues/37/comments","events_url":"https://api.github.com/repos/sksamuel/avro4s/issues/37/events","html_url":"https://github.com/sksamuel/avro4s/issues/37","id":163839797,"number":37,"title":"ADT doesn't give a enum","user":{"login":"Fristi","id":141265,"avatar_url":"https://avatars.githubusercontent.com/u/141265?v=3","gravatar_id":"","url":"https://api.github.com/users/Fristi","html_url":"https://github.com/Fristi","followers_url":"https://api.github.com/users/Fristi/followers","following_url":"https://api.github.com/users/Fristi/following{/other_user}","gists_url":"https://api.github.com/users/Fristi/gists{/gist_id}","starred_url":"https://api.github.com/users/Fristi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fristi/subscriptions","organizations_url":"https://api.github.com/users/Fristi/orgs","repos_url":"https://api.github.com/users/Fristi/repos","events_url":"https://api.github.com/users/Fristi/events{/privacy}","received_events_url":"https://api.github.com/users/Fristi/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-05T12:33:43Z","updated_at":"2016-07-05T12:49:11Z","closed_at":null,"body":"Given (defined in a different module, nesting the case class in a companion object `UserEvent` also doesn't work)\r\n\r\n```scala\r\nsealed trait UserEvent\r\ncase class Registered(id: UUID, name: String, email: String, password: String) extends UserEvent\r\ncase class EmailUpdated(id: UUID, email: String) extends UserEvent\r\ncase class PasswordUpdated(id: UUID, newPassword: String) extends UserEvent\r\ncase class LoggedIn(id: UUID, newPassword: String) extends UserEvent\r\n```\r\n\r\nRunning\r\n```scala\r\n  val schema = AvroSchema[UserEvent]\r\n\r\n  println(schema.toString(true))\r\n```\r\n\r\nGives\r\n```\r\n{\r\n  \"type\" : \"record\",\r\n  \"name\" : \"UserEvent\",\r\n  \"namespace\" : \"statements.example\",\r\n  \"fields\" : [ {\r\n    \"name\" : \"newPassword\",\r\n    \"type\" : [ \"null\", \"string\" ]\r\n  }, {\r\n    \"name\" : \"name\",\r\n    \"type\" : [ \"null\", \"string\" ]\r\n  }, {\r\n    \"name\" : \"email\",\r\n    \"type\" : [ \"null\", \"string\" ]\r\n  }, {\r\n    \"name\" : \"id\",\r\n    \"type\" : [ \"string\" ]\r\n  }, {\r\n    \"name\" : \"password\",\r\n    \"type\" : [ \"null\", \"string\" ]\r\n  } ]\r\n}\r\n```\r\n\r\nI would expect a enum here. It should also include a discriminator field (like `type` or something)\r\n\r\nAs a side note, can't we use the shapeless type class derivation trick to create product and coproduct instances for `SchemaFor[T]` ?\r\n\r\nWDYT?"},"comment":{"url":"https://api.github.com/repos/sksamuel/avro4s/issues/comments/230468625","html_url":"https://github.com/sksamuel/avro4s/issues/37#issuecomment-230468625","issue_url":"https://api.github.com/repos/sksamuel/avro4s/issues/37","id":230468625,"user":{"login":"Fristi","id":141265,"avatar_url":"https://avatars.githubusercontent.com/u/141265?v=3","gravatar_id":"","url":"https://api.github.com/users/Fristi","html_url":"https://github.com/Fristi","followers_url":"https://api.github.com/users/Fristi/followers","following_url":"https://api.github.com/users/Fristi/following{/other_user}","gists_url":"https://api.github.com/users/Fristi/gists{/gist_id}","starred_url":"https://api.github.com/users/Fristi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fristi/subscriptions","organizations_url":"https://api.github.com/users/Fristi/orgs","repos_url":"https://api.github.com/users/Fristi/repos","events_url":"https://api.github.com/users/Fristi/events{/privacy}","received_events_url":"https://api.github.com/users/Fristi/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T12:49:11Z","updated_at":"2016-07-05T12:49:11Z","body":"Ah, nice point. Are ADT's supported in avro4s by the way?\r\n\r\nIf not, I see all fields from all case classes are encoded though and they are optional right ?? Maybe we can add a type field to discriminate over the cases to support this use-case\r\n"}}
{"actor":{"display_login":"Fristi"}}