{"action":"created","comment":{"url":"https://api.github.com/repos/travisbrown/circe/pulls/comments/53570441","id":53570441,"diff_hunk":"@@ -0,0 +1,50 @@\n+package io.circe.generic\n+\n+import io.circe.{ Decoder, Encoder }\n+import macrocompat.bundle\n+import scala.language.experimental.macros\n+import scala.reflect.macros.blackbox\n+\n+class JsonCodec extends scala.annotation.StaticAnnotation {\n+  def macroTransform(annottees: Any*): Any = macro JsonCodecMacros.jsonCodecAnnotationMacro\n+}\n+\n+@bundle\n+private[generic] class JsonCodecMacros(val c: blackbox.Context) {\n+  import c.universe._\n+\n+  def jsonCodecAnnotationMacro(annottees: Tree*): Tree = annottees match {\n+    case List(clsDef: ClassDef) if clsDef.mods hasFlag Flag.CASE =>\n+      q\"\"\"\n+       $clsDef\n+       object ${clsDef.name.toTermName} {\n+         ..${codec(clsDef.name)}\n+       }\n+       \"\"\"\n+    case List(\n+      clsDef: ClassDef,\n+      q\"object $objName extends { ..$objEarlyDefs } with ..$objParents { $objSelf => ..$objDefs }\"\n+    ) if clsDef.mods hasFlag Flag.CASE =>\n+      q\"\"\"\n+       $clsDef\n+       object $objName extends { ..$objEarlyDefs} with ..$objParents { $objSelf =>\n+         ..${codec(clsDef.name)}\n+         ..$objDefs\n+       }\n+       \"\"\"\n+    case _ => c.abort(c.enclosingPosition, \"Invalid annotation target: must be a case class\")\n+  }\n+\n+  private[this] val DecoderClass = symbolOf[Decoder[_]]\n+  private[this] val EncoderClass = symbolOf[Encoder[_]]\n+  private[this] val semiautoObj = symbolOf[semiauto.type].asClass.module\n+\n+  private[this] def codec(tpname: TypeName): List[Tree] = {\n+    val decodeNme = TermName(\"decode\" + tpname.decodedName)","path":"generic/shared/src/main/scala/io/circe/generic/JsonCodecMacros.scala","position":43,"original_position":43,"commit_id":"ab4a89098b667ee99bb69a938a82e15d6e1fedaf","original_commit_id":"ab4a89098b667ee99bb69a938a82e15d6e1fedaf","user":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars.githubusercontent.com/u/344610?v=3","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"body":"I'm don't think using `fresh` is a good idea here, because it's not stable between compiles.\r\n\r\nAre you happy to leave this as is for now and revisit it in the future?","created_at":"2016-02-21T18:14:42Z","updated_at":"2016-02-21T18:14:42Z","html_url":"https://github.com/travisbrown/circe/pull/203#discussion_r53570441","pull_request_url":"https://api.github.com/repos/travisbrown/circe/pulls/203","_links":{"self":{"href":"https://api.github.com/repos/travisbrown/circe/pulls/comments/53570441"},"html":{"href":"https://github.com/travisbrown/circe/pull/203#discussion_r53570441"},"pull_request":{"href":"https://api.github.com/repos/travisbrown/circe/pulls/203"}}},"pull_request":{"url":"https://api.github.com/repos/travisbrown/circe/pulls/203","id":59429898,"html_url":"https://github.com/travisbrown/circe/pull/203","diff_url":"https://github.com/travisbrown/circe/pull/203.diff","patch_url":"https://github.com/travisbrown/circe/pull/203.patch","issue_url":"https://api.github.com/repos/travisbrown/circe/issues/203","number":203,"state":"open","locked":false,"title":"Initial implementation of @JsonCodec","user":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars.githubusercontent.com/u/344610?v=3","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"body":"Refs #166\n\n---\n\nThis is only an initial cut, submitted for early feedback.\n\nPlease feel free to review aggressively, I'm happy to tweak any minor detail.","created_at":"2016-02-16T00:46:39Z","updated_at":"2016-02-21T18:14:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dfb9df9e16fe4e35b5a4e72eef59d67d53e2688f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/travisbrown/circe/pulls/203/commits","review_comments_url":"https://api.github.com/repos/travisbrown/circe/pulls/203/comments","review_comment_url":"https://api.github.com/repos/travisbrown/circe/pulls/comments{/number}","comments_url":"https://api.github.com/repos/travisbrown/circe/issues/203/comments","statuses_url":"https://api.github.com/repos/travisbrown/circe/statuses/ab4a89098b667ee99bb69a938a82e15d6e1fedaf","head":{"label":"dwijnand:add-JsonCodec-macro-annotation","ref":"add-JsonCodec-macro-annotation","sha":"ab4a89098b667ee99bb69a938a82e15d6e1fedaf","user":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars.githubusercontent.com/u/344610?v=3","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"repo":{"id":51796488,"name":"circe","full_name":"dwijnand/circe","owner":{"login":"dwijnand","id":344610,"avatar_url":"https://avatars.githubusercontent.com/u/344610?v=3","gravatar_id":"","url":"https://api.github.com/users/dwijnand","html_url":"https://github.com/dwijnand","followers_url":"https://api.github.com/users/dwijnand/followers","following_url":"https://api.github.com/users/dwijnand/following{/other_user}","gists_url":"https://api.github.com/users/dwijnand/gists{/gist_id}","starred_url":"https://api.github.com/users/dwijnand/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dwijnand/subscriptions","organizations_url":"https://api.github.com/users/dwijnand/orgs","repos_url":"https://api.github.com/users/dwijnand/repos","events_url":"https://api.github.com/users/dwijnand/events{/privacy}","received_events_url":"https://api.github.com/users/dwijnand/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dwijnand/circe","description":"Yet another JSON library for Scala","fork":true,"url":"https://api.github.com/repos/dwijnand/circe","forks_url":"https://api.github.com/repos/dwijnand/circe/forks","keys_url":"https://api.github.com/repos/dwijnand/circe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dwijnand/circe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dwijnand/circe/teams","hooks_url":"https://api.github.com/repos/dwijnand/circe/hooks","issue_events_url":"https://api.github.com/repos/dwijnand/circe/issues/events{/number}","events_url":"https://api.github.com/repos/dwijnand/circe/events","assignees_url":"https://api.github.com/repos/dwijnand/circe/assignees{/user}","branches_url":"https://api.github.com/repos/dwijnand/circe/branches{/branch}","tags_url":"https://api.github.com/repos/dwijnand/circe/tags","blobs_url":"https://api.github.com/repos/dwijnand/circe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dwijnand/circe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dwijnand/circe/git/refs{/sha}","trees_url":"https://api.github.com/repos/dwijnand/circe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dwijnand/circe/statuses/{sha}","languages_url":"https://api.github.com/repos/dwijnand/circe/languages","stargazers_url":"https://api.github.com/repos/dwijnand/circe/stargazers","contributors_url":"https://api.github.com/repos/dwijnand/circe/contributors","subscribers_url":"https://api.github.com/repos/dwijnand/circe/subscribers","subscription_url":"https://api.github.com/repos/dwijnand/circe/subscription","commits_url":"https://api.github.com/repos/dwijnand/circe/commits{/sha}","git_commits_url":"https://api.github.com/repos/dwijnand/circe/git/commits{/sha}","comments_url":"https://api.github.com/repos/dwijnand/circe/comments{/number}","issue_comment_url":"https://api.github.com/repos/dwijnand/circe/issues/comments{/number}","contents_url":"https://api.github.com/repos/dwijnand/circe/contents/{+path}","compare_url":"https://api.github.com/repos/dwijnand/circe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dwijnand/circe/merges","archive_url":"https://api.github.com/repos/dwijnand/circe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dwijnand/circe/downloads","issues_url":"https://api.github.com/repos/dwijnand/circe/issues{/number}","pulls_url":"https://api.github.com/repos/dwijnand/circe/pulls{/number}","milestones_url":"https://api.github.com/repos/dwijnand/circe/milestones{/number}","notifications_url":"https://api.github.com/repos/dwijnand/circe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dwijnand/circe/labels{/name}","releases_url":"https://api.github.com/repos/dwijnand/circe/releases{/id}","deployments_url":"https://api.github.com/repos/dwijnand/circe/deployments","created_at":"2016-02-16T00:43:14Z","updated_at":"2016-02-16T00:43:16Z","pushed_at":"2016-02-16T10:50:45Z","git_url":"git://github.com/dwijnand/circe.git","ssh_url":"git@github.com:dwijnand/circe.git","clone_url":"https://github.com/dwijnand/circe.git","svn_url":"https://github.com/dwijnand/circe","homepage":"http://circe.io","size":561,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"travisbrown:master","ref":"master","sha":"26a1ba6c0f73511565315b1e5b32ad2ee6cfb078","user":{"login":"travisbrown","id":316049,"avatar_url":"https://avatars.githubusercontent.com/u/316049?v=3","gravatar_id":"","url":"https://api.github.com/users/travisbrown","html_url":"https://github.com/travisbrown","followers_url":"https://api.github.com/users/travisbrown/followers","following_url":"https://api.github.com/users/travisbrown/following{/other_user}","gists_url":"https://api.github.com/users/travisbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/travisbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisbrown/subscriptions","organizations_url":"https://api.github.com/users/travisbrown/orgs","repos_url":"https://api.github.com/users/travisbrown/repos","events_url":"https://api.github.com/users/travisbrown/events{/privacy}","received_events_url":"https://api.github.com/users/travisbrown/received_events","type":"User","site_admin":false},"repo":{"id":40011080,"name":"circe","full_name":"travisbrown/circe","owner":{"login":"travisbrown","id":316049,"avatar_url":"https://avatars.githubusercontent.com/u/316049?v=3","gravatar_id":"","url":"https://api.github.com/users/travisbrown","html_url":"https://github.com/travisbrown","followers_url":"https://api.github.com/users/travisbrown/followers","following_url":"https://api.github.com/users/travisbrown/following{/other_user}","gists_url":"https://api.github.com/users/travisbrown/gists{/gist_id}","starred_url":"https://api.github.com/users/travisbrown/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/travisbrown/subscriptions","organizations_url":"https://api.github.com/users/travisbrown/orgs","repos_url":"https://api.github.com/users/travisbrown/repos","events_url":"https://api.github.com/users/travisbrown/events{/privacy}","received_events_url":"https://api.github.com/users/travisbrown/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/travisbrown/circe","description":"Yet another JSON library for Scala","fork":false,"url":"https://api.github.com/repos/travisbrown/circe","forks_url":"https://api.github.com/repos/travisbrown/circe/forks","keys_url":"https://api.github.com/repos/travisbrown/circe/keys{/key_id}","collaborators_url":"https://api.github.com/repos/travisbrown/circe/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/travisbrown/circe/teams","hooks_url":"https://api.github.com/repos/travisbrown/circe/hooks","issue_events_url":"https://api.github.com/repos/travisbrown/circe/issues/events{/number}","events_url":"https://api.github.com/repos/travisbrown/circe/events","assignees_url":"https://api.github.com/repos/travisbrown/circe/assignees{/user}","branches_url":"https://api.github.com/repos/travisbrown/circe/branches{/branch}","tags_url":"https://api.github.com/repos/travisbrown/circe/tags","blobs_url":"https://api.github.com/repos/travisbrown/circe/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/travisbrown/circe/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/travisbrown/circe/git/refs{/sha}","trees_url":"https://api.github.com/repos/travisbrown/circe/git/trees{/sha}","statuses_url":"https://api.github.com/repos/travisbrown/circe/statuses/{sha}","languages_url":"https://api.github.com/repos/travisbrown/circe/languages","stargazers_url":"https://api.github.com/repos/travisbrown/circe/stargazers","contributors_url":"https://api.github.com/repos/travisbrown/circe/contributors","subscribers_url":"https://api.github.com/repos/travisbrown/circe/subscribers","subscription_url":"https://api.github.com/repos/travisbrown/circe/subscription","commits_url":"https://api.github.com/repos/travisbrown/circe/commits{/sha}","git_commits_url":"https://api.github.com/repos/travisbrown/circe/git/commits{/sha}","comments_url":"https://api.github.com/repos/travisbrown/circe/comments{/number}","issue_comment_url":"https://api.github.com/repos/travisbrown/circe/issues/comments{/number}","contents_url":"https://api.github.com/repos/travisbrown/circe/contents/{+path}","compare_url":"https://api.github.com/repos/travisbrown/circe/compare/{base}...{head}","merges_url":"https://api.github.com/repos/travisbrown/circe/merges","archive_url":"https://api.github.com/repos/travisbrown/circe/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/travisbrown/circe/downloads","issues_url":"https://api.github.com/repos/travisbrown/circe/issues{/number}","pulls_url":"https://api.github.com/repos/travisbrown/circe/pulls{/number}","milestones_url":"https://api.github.com/repos/travisbrown/circe/milestones{/number}","notifications_url":"https://api.github.com/repos/travisbrown/circe/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/travisbrown/circe/labels{/name}","releases_url":"https://api.github.com/repos/travisbrown/circe/releases{/id}","deployments_url":"https://api.github.com/repos/travisbrown/circe/deployments","created_at":"2015-07-31T15:12:09Z","updated_at":"2016-02-19T11:04:51Z","pushed_at":"2016-02-16T10:50:46Z","git_url":"git://github.com/travisbrown/circe.git","ssh_url":"git@github.com:travisbrown/circe.git","clone_url":"https://github.com/travisbrown/circe.git","svn_url":"https://github.com/travisbrown/circe","homepage":"http://circe.io","size":2136,"stargazers_count":337,"watchers_count":337,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":43,"mirror_url":null,"open_issues_count":18,"forks":43,"open_issues":18,"watchers":337,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/travisbrown/circe/pulls/203"},"html":{"href":"https://github.com/travisbrown/circe/pull/203"},"issue":{"href":"https://api.github.com/repos/travisbrown/circe/issues/203"},"comments":{"href":"https://api.github.com/repos/travisbrown/circe/issues/203/comments"},"review_comments":{"href":"https://api.github.com/repos/travisbrown/circe/pulls/203/comments"},"review_comment":{"href":"https://api.github.com/repos/travisbrown/circe/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/travisbrown/circe/pulls/203/commits"},"statuses":{"href":"https://api.github.com/repos/travisbrown/circe/statuses/ab4a89098b667ee99bb69a938a82e15d6e1fedaf"}}}}