{"action":"opened","number":28,"pull_request":{"url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/28","id":66670517,"html_url":"https://github.com/julienrf/play-json-derived-codecs/pull/28","diff_url":"https://github.com/julienrf/play-json-derived-codecs/pull/28.diff","patch_url":"https://github.com/julienrf/play-json-derived-codecs/pull/28.patch","issue_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/issues/28","number":28,"state":"open","locked":false,"title":"Implement the \"own\" derived","user":{"login":"guizmaii","id":1193670,"avatar_url":"https://avatars.githubusercontent.com/u/1193670?v=3","gravatar_id":"","url":"https://api.github.com/users/guizmaii","html_url":"https://github.com/guizmaii","followers_url":"https://api.github.com/users/guizmaii/followers","following_url":"https://api.github.com/users/guizmaii/following{/other_user}","gists_url":"https://api.github.com/users/guizmaii/gists{/gist_id}","starred_url":"https://api.github.com/users/guizmaii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guizmaii/subscriptions","organizations_url":"https://api.github.com/users/guizmaii/orgs","repos_url":"https://api.github.com/users/guizmaii/repos","events_url":"https://api.github.com/users/guizmaii/events{/privacy}","received_events_url":"https://api.github.com/users/guizmaii/received_events","type":"User","site_admin":false},"body":"What do you thinks about my `own` (the name is not so great) derived. It could simplify the implementation of specific \"codecs\" (I don't know how to call that)\r\n\r\nTypically my use case is: I have a \"flat\" object but the value of the `type` does not correspond to any class. So with the `typeNameTransformer` I can transform the value of `type` to match my class name.\r\nExample:\r\n\r\n```json\r\n{\r\n    \"type\": \"address\",\r\n    \"line1\": ...\r\n}\r\n```\r\nthis ADT:\r\n\r\n```scala\r\nsealed trait Location { val `type`: String }\r\ncase class CityLocation(zip_code: String, override val `type`: String = \"city\") extends Location\r\ncase class AddressLocation(line1: String, override val `type`: String = \"address\") extends Location\r\n```\r\n\r\nSo I will write:\r\n```scala\r\nobject Location {\r\n    implicit val write: OFormat[Location] = own.oformat((__ \\ \"type\").format[String], (value: String) => s\"${value.capitalize}Location\")\r\n}\r\n```\r\n\r\nMaybe I don't really understand how your lib work, so if what I say does not have sense, do not hesitate to tell me ;)","created_at":"2016-04-15T16:36:05Z","updated_at":"2016-04-15T16:36:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/28/commits","review_comments_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/28/comments","review_comment_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/issues/28/comments","statuses_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/statuses/47d535fb67abe61073128abe2deb1e5b6f31accc","head":{"label":"guizmaii:own","ref":"own","sha":"47d535fb67abe61073128abe2deb1e5b6f31accc","user":{"login":"guizmaii","id":1193670,"avatar_url":"https://avatars.githubusercontent.com/u/1193670?v=3","gravatar_id":"","url":"https://api.github.com/users/guizmaii","html_url":"https://github.com/guizmaii","followers_url":"https://api.github.com/users/guizmaii/followers","following_url":"https://api.github.com/users/guizmaii/following{/other_user}","gists_url":"https://api.github.com/users/guizmaii/gists{/gist_id}","starred_url":"https://api.github.com/users/guizmaii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guizmaii/subscriptions","organizations_url":"https://api.github.com/users/guizmaii/orgs","repos_url":"https://api.github.com/users/guizmaii/repos","events_url":"https://api.github.com/users/guizmaii/events{/privacy}","received_events_url":"https://api.github.com/users/guizmaii/received_events","type":"User","site_admin":false},"repo":{"id":56329514,"name":"play-json-derived-codecs","full_name":"guizmaii/play-json-derived-codecs","owner":{"login":"guizmaii","id":1193670,"avatar_url":"https://avatars.githubusercontent.com/u/1193670?v=3","gravatar_id":"","url":"https://api.github.com/users/guizmaii","html_url":"https://github.com/guizmaii","followers_url":"https://api.github.com/users/guizmaii/followers","following_url":"https://api.github.com/users/guizmaii/following{/other_user}","gists_url":"https://api.github.com/users/guizmaii/gists{/gist_id}","starred_url":"https://api.github.com/users/guizmaii/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/guizmaii/subscriptions","organizations_url":"https://api.github.com/users/guizmaii/orgs","repos_url":"https://api.github.com/users/guizmaii/repos","events_url":"https://api.github.com/users/guizmaii/events{/privacy}","received_events_url":"https://api.github.com/users/guizmaii/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/guizmaii/play-json-derived-codecs","description":"","fork":true,"url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs","forks_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/forks","keys_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/teams","hooks_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/hooks","issue_events_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/issues/events{/number}","events_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/events","assignees_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/assignees{/user}","branches_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/branches{/branch}","tags_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/tags","blobs_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/git/refs{/sha}","trees_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/statuses/{sha}","languages_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/languages","stargazers_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/stargazers","contributors_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/contributors","subscribers_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/subscribers","subscription_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/subscription","commits_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/commits{/sha}","git_commits_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/git/commits{/sha}","comments_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/comments{/number}","issue_comment_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/issues/comments{/number}","contents_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/contents/{+path}","compare_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/merges","archive_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/downloads","issues_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/issues{/number}","pulls_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/pulls{/number}","milestones_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/milestones{/number}","notifications_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/labels{/name}","releases_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/releases{/id}","deployments_url":"https://api.github.com/repos/guizmaii/play-json-derived-codecs/deployments","created_at":"2016-04-15T15:15:18Z","updated_at":"2016-04-15T15:15:19Z","pushed_at":"2016-04-15T16:26:29Z","git_url":"git://github.com/guizmaii/play-json-derived-codecs.git","ssh_url":"git@github.com:guizmaii/play-json-derived-codecs.git","clone_url":"https://github.com/guizmaii/play-json-derived-codecs.git","svn_url":"https://github.com/guizmaii/play-json-derived-codecs","homepage":null,"size":63,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"julienrf:master","ref":"master","sha":"854900db69ac24e9ce49b12ad2c01ae5ec86ddbe","user":{"login":"julienrf","id":332812,"avatar_url":"https://avatars.githubusercontent.com/u/332812?v=3","gravatar_id":"","url":"https://api.github.com/users/julienrf","html_url":"https://github.com/julienrf","followers_url":"https://api.github.com/users/julienrf/followers","following_url":"https://api.github.com/users/julienrf/following{/other_user}","gists_url":"https://api.github.com/users/julienrf/gists{/gist_id}","starred_url":"https://api.github.com/users/julienrf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienrf/subscriptions","organizations_url":"https://api.github.com/users/julienrf/orgs","repos_url":"https://api.github.com/users/julienrf/repos","events_url":"https://api.github.com/users/julienrf/events{/privacy}","received_events_url":"https://api.github.com/users/julienrf/received_events","type":"User","site_admin":false},"repo":{"id":14783265,"name":"play-json-derived-codecs","full_name":"julienrf/play-json-derived-codecs","owner":{"login":"julienrf","id":332812,"avatar_url":"https://avatars.githubusercontent.com/u/332812?v=3","gravatar_id":"","url":"https://api.github.com/users/julienrf","html_url":"https://github.com/julienrf","followers_url":"https://api.github.com/users/julienrf/followers","following_url":"https://api.github.com/users/julienrf/following{/other_user}","gists_url":"https://api.github.com/users/julienrf/gists{/gist_id}","starred_url":"https://api.github.com/users/julienrf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/julienrf/subscriptions","organizations_url":"https://api.github.com/users/julienrf/orgs","repos_url":"https://api.github.com/users/julienrf/repos","events_url":"https://api.github.com/users/julienrf/events{/privacy}","received_events_url":"https://api.github.com/users/julienrf/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/julienrf/play-json-derived-codecs","description":"","fork":false,"url":"https://api.github.com/repos/julienrf/play-json-derived-codecs","forks_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/forks","keys_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/teams","hooks_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/hooks","issue_events_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/issues/events{/number}","events_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/events","assignees_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/assignees{/user}","branches_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/branches{/branch}","tags_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/tags","blobs_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/git/refs{/sha}","trees_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/statuses/{sha}","languages_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/languages","stargazers_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/stargazers","contributors_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/contributors","subscribers_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/subscribers","subscription_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/subscription","commits_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/commits{/sha}","git_commits_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/git/commits{/sha}","comments_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/comments{/number}","issue_comment_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/issues/comments{/number}","contents_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/contents/{+path}","compare_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/merges","archive_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/downloads","issues_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/issues{/number}","pulls_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls{/number}","milestones_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/milestones{/number}","notifications_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/labels{/name}","releases_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/releases{/id}","deployments_url":"https://api.github.com/repos/julienrf/play-json-derived-codecs/deployments","created_at":"2013-11-28T17:47:23Z","updated_at":"2016-04-02T18:35:22Z","pushed_at":"2016-03-11T17:20:42Z","git_url":"git://github.com/julienrf/play-json-derived-codecs.git","ssh_url":"git@github.com:julienrf/play-json-derived-codecs.git","clone_url":"https://github.com/julienrf/play-json-derived-codecs.git","svn_url":"https://github.com/julienrf/play-json-derived-codecs","homepage":null,"size":67,"stargazers_count":67,"watchers_count":67,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":1,"forks":11,"open_issues":1,"watchers":67,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/28"},"html":{"href":"https://github.com/julienrf/play-json-derived-codecs/pull/28"},"issue":{"href":"https://api.github.com/repos/julienrf/play-json-derived-codecs/issues/28"},"comments":{"href":"https://api.github.com/repos/julienrf/play-json-derived-codecs/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/julienrf/play-json-derived-codecs/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/julienrf/play-json-derived-codecs/statuses/47d535fb67abe61073128abe2deb1e5b6f31accc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":28,"deletions":1,"changed_files":2}}