{"action":"created","comment":{"url":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/comments/25333275","id":25333275,"diff_hunk":"@@ -79,22 +79,24 @@ object ParamType {\n     case v: Short => scala.math.BigDecimal(v)\n   })\n   case object String extends AbstractParamType({\n+    case v: String if v.isEmpty => null // don't trim\n     case v: String => v\n     case v => v.toString\n   })\n   case object Byte extends AbstractParamType({\n-    case v: String if v == null || v.trim.isEmpty => null\n+    case v: String if v.trim.isEmpty => null\n     case v: String => v.toByte\n     case v: Byte => v\n   })\n   case object ByteArray extends AbstractParamType({\n-    case v: String if v == null || v.trim.isEmpty => null\n+    case v: String if v.trim.isEmpty => null\n     case v: String => v.getBytes\n     case v: Array[Byte] => v\n   })\n   case object DateTime extends ParamType {\n     def unapply(v: Any): Option[Any] = v match {\n       case null => None\n+      case v: String if v.trim.isEmpty => Some(null)","path":"common/src/main/scala/skinny/ParamType.scala","position":66,"original_position":66,"commit_id":"edd848b48320442bbb5eb1b73c8a81ec5a30393c","original_commit_id":"edd848b48320442bbb5eb1b73c8a81ec5a30393c","user":{"login":"seratch","id":19658,"avatar_url":"https://avatars.githubusercontent.com/u/19658?v=3","gravatar_id":"","url":"https://api.github.com/users/seratch","html_url":"https://github.com/seratch","followers_url":"https://api.github.com/users/seratch/followers","following_url":"https://api.github.com/users/seratch/following{/other_user}","gists_url":"https://api.github.com/users/seratch/gists{/gist_id}","starred_url":"https://api.github.com/users/seratch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seratch/subscriptions","organizations_url":"https://api.github.com/users/seratch/orgs","repos_url":"https://api.github.com/users/seratch/repos","events_url":"https://api.github.com/users/seratch/events{/privacy}","received_events_url":"https://api.github.com/users/seratch/received_events","type":"User","site_admin":false},"body":"http://www.scala-lang.org/api/current/index.html#scala.PartialFunction$\r\n\r\nWe found that `PartialFunction.condOpt` unexpectedly (for me) returns `Some(null)` in other `ParamType`s. Though this is another issue, let's fix to return `None` in this pull request.","created_at":"2015-02-25T11:28:03Z","updated_at":"2015-02-25T11:28:03Z","html_url":"https://github.com/skinny-framework/skinny-framework/pull/239#discussion_r25333275","pull_request_url":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239","_links":{"self":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/comments/25333275"},"html":{"href":"https://github.com/skinny-framework/skinny-framework/pull/239#discussion_r25333275"},"pull_request":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239"}}},"pull_request":{"url":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239","id":29976084,"html_url":"https://github.com/skinny-framework/skinny-framework/pull/239","diff_url":"https://github.com/skinny-framework/skinny-framework/pull/239.diff","patch_url":"https://github.com/skinny-framework/skinny-framework/pull/239.patch","issue_url":"https://api.github.com/repos/skinny-framework/skinny-framework/issues/239","number":239,"state":"open","locked":false,"title":"ParamType.String,etc... consider empty string as null","user":{"login":"namutaka","id":159467,"avatar_url":"https://avatars.githubusercontent.com/u/159467?v=3","gravatar_id":"","url":"https://api.github.com/users/namutaka","html_url":"https://github.com/namutaka","followers_url":"https://api.github.com/users/namutaka/followers","following_url":"https://api.github.com/users/namutaka/following{/other_user}","gists_url":"https://api.github.com/users/namutaka/gists{/gist_id}","starred_url":"https://api.github.com/users/namutaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namutaka/subscriptions","organizations_url":"https://api.github.com/users/namutaka/orgs","repos_url":"https://api.github.com/users/namutaka/repos","events_url":"https://api.github.com/users/namutaka/events{/privacy}","received_events_url":"https://api.github.com/users/namutaka/received_events","type":"User","site_admin":false},"body":"ParamType.String,DateTime,LocalDate,LocalTime consider empty string as null.","created_at":"2015-02-25T10:34:17Z","updated_at":"2015-02-25T11:28:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"676fbd96d26d5c0d1b389dc93ebedb8e67721895","assignee":{"login":"seratch","id":19658,"avatar_url":"https://avatars.githubusercontent.com/u/19658?v=3","gravatar_id":"","url":"https://api.github.com/users/seratch","html_url":"https://github.com/seratch","followers_url":"https://api.github.com/users/seratch/followers","following_url":"https://api.github.com/users/seratch/following{/other_user}","gists_url":"https://api.github.com/users/seratch/gists{/gist_id}","starred_url":"https://api.github.com/users/seratch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seratch/subscriptions","organizations_url":"https://api.github.com/users/seratch/orgs","repos_url":"https://api.github.com/users/seratch/repos","events_url":"https://api.github.com/users/seratch/events{/privacy}","received_events_url":"https://api.github.com/users/seratch/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239/commits","review_comments_url":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239/comments","review_comment_url":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/comments{/number}","comments_url":"https://api.github.com/repos/skinny-framework/skinny-framework/issues/239/comments","statuses_url":"https://api.github.com/repos/skinny-framework/skinny-framework/statuses/edd848b48320442bbb5eb1b73c8a81ec5a30393c","head":{"label":"namutaka:feature/paramtype_consider_empty_as_null","ref":"feature/paramtype_consider_empty_as_null","sha":"edd848b48320442bbb5eb1b73c8a81ec5a30393c","user":{"login":"namutaka","id":159467,"avatar_url":"https://avatars.githubusercontent.com/u/159467?v=3","gravatar_id":"","url":"https://api.github.com/users/namutaka","html_url":"https://github.com/namutaka","followers_url":"https://api.github.com/users/namutaka/followers","following_url":"https://api.github.com/users/namutaka/following{/other_user}","gists_url":"https://api.github.com/users/namutaka/gists{/gist_id}","starred_url":"https://api.github.com/users/namutaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namutaka/subscriptions","organizations_url":"https://api.github.com/users/namutaka/orgs","repos_url":"https://api.github.com/users/namutaka/repos","events_url":"https://api.github.com/users/namutaka/events{/privacy}","received_events_url":"https://api.github.com/users/namutaka/received_events","type":"User","site_admin":false},"repo":{"id":21159241,"name":"skinny-framework","full_name":"namutaka/skinny-framework","owner":{"login":"namutaka","id":159467,"avatar_url":"https://avatars.githubusercontent.com/u/159467?v=3","gravatar_id":"","url":"https://api.github.com/users/namutaka","html_url":"https://github.com/namutaka","followers_url":"https://api.github.com/users/namutaka/followers","following_url":"https://api.github.com/users/namutaka/following{/other_user}","gists_url":"https://api.github.com/users/namutaka/gists{/gist_id}","starred_url":"https://api.github.com/users/namutaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namutaka/subscriptions","organizations_url":"https://api.github.com/users/namutaka/orgs","repos_url":"https://api.github.com/users/namutaka/repos","events_url":"https://api.github.com/users/namutaka/events{/privacy}","received_events_url":"https://api.github.com/users/namutaka/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/namutaka/skinny-framework","description":"\"Scala on Rails\" - A full-stack web app framework upon Scalatra for rapid Development in Scala","fork":true,"url":"https://api.github.com/repos/namutaka/skinny-framework","forks_url":"https://api.github.com/repos/namutaka/skinny-framework/forks","keys_url":"https://api.github.com/repos/namutaka/skinny-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/namutaka/skinny-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/namutaka/skinny-framework/teams","hooks_url":"https://api.github.com/repos/namutaka/skinny-framework/hooks","issue_events_url":"https://api.github.com/repos/namutaka/skinny-framework/issues/events{/number}","events_url":"https://api.github.com/repos/namutaka/skinny-framework/events","assignees_url":"https://api.github.com/repos/namutaka/skinny-framework/assignees{/user}","branches_url":"https://api.github.com/repos/namutaka/skinny-framework/branches{/branch}","tags_url":"https://api.github.com/repos/namutaka/skinny-framework/tags","blobs_url":"https://api.github.com/repos/namutaka/skinny-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/namutaka/skinny-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/namutaka/skinny-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/namutaka/skinny-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/namutaka/skinny-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/namutaka/skinny-framework/languages","stargazers_url":"https://api.github.com/repos/namutaka/skinny-framework/stargazers","contributors_url":"https://api.github.com/repos/namutaka/skinny-framework/contributors","subscribers_url":"https://api.github.com/repos/namutaka/skinny-framework/subscribers","subscription_url":"https://api.github.com/repos/namutaka/skinny-framework/subscription","commits_url":"https://api.github.com/repos/namutaka/skinny-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/namutaka/skinny-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/namutaka/skinny-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/namutaka/skinny-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/namutaka/skinny-framework/contents/{+path}","compare_url":"https://api.github.com/repos/namutaka/skinny-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/namutaka/skinny-framework/merges","archive_url":"https://api.github.com/repos/namutaka/skinny-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/namutaka/skinny-framework/downloads","issues_url":"https://api.github.com/repos/namutaka/skinny-framework/issues{/number}","pulls_url":"https://api.github.com/repos/namutaka/skinny-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/namutaka/skinny-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/namutaka/skinny-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/namutaka/skinny-framework/labels{/name}","releases_url":"https://api.github.com/repos/namutaka/skinny-framework/releases{/id}","created_at":"2014-06-24T09:27:09Z","updated_at":"2014-07-09T13:20:15Z","pushed_at":"2015-02-25T10:33:26Z","git_url":"git://github.com/namutaka/skinny-framework.git","ssh_url":"git@github.com:namutaka/skinny-framework.git","clone_url":"https://github.com/namutaka/skinny-framework.git","svn_url":"https://github.com/namutaka/skinny-framework","homepage":"http://skinny-framework.org/","size":5704,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"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":"1.1.x"}},"base":{"label":"skinny-framework:develop","ref":"develop","sha":"c9853b41cbe73b1d5b9660db7774f1c6f7f77539","user":{"login":"skinny-framework","id":5976976,"avatar_url":"https://avatars.githubusercontent.com/u/5976976?v=3","gravatar_id":"","url":"https://api.github.com/users/skinny-framework","html_url":"https://github.com/skinny-framework","followers_url":"https://api.github.com/users/skinny-framework/followers","following_url":"https://api.github.com/users/skinny-framework/following{/other_user}","gists_url":"https://api.github.com/users/skinny-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/skinny-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skinny-framework/subscriptions","organizations_url":"https://api.github.com/users/skinny-framework/orgs","repos_url":"https://api.github.com/users/skinny-framework/repos","events_url":"https://api.github.com/users/skinny-framework/events{/privacy}","received_events_url":"https://api.github.com/users/skinny-framework/received_events","type":"Organization","site_admin":false},"repo":{"id":13057782,"name":"skinny-framework","full_name":"skinny-framework/skinny-framework","owner":{"login":"skinny-framework","id":5976976,"avatar_url":"https://avatars.githubusercontent.com/u/5976976?v=3","gravatar_id":"","url":"https://api.github.com/users/skinny-framework","html_url":"https://github.com/skinny-framework","followers_url":"https://api.github.com/users/skinny-framework/followers","following_url":"https://api.github.com/users/skinny-framework/following{/other_user}","gists_url":"https://api.github.com/users/skinny-framework/gists{/gist_id}","starred_url":"https://api.github.com/users/skinny-framework/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/skinny-framework/subscriptions","organizations_url":"https://api.github.com/users/skinny-framework/orgs","repos_url":"https://api.github.com/users/skinny-framework/repos","events_url":"https://api.github.com/users/skinny-framework/events{/privacy}","received_events_url":"https://api.github.com/users/skinny-framework/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/skinny-framework/skinny-framework","description":"\"Scala on Rails\" - A full-stack web app framework upon Scalatra for rapid development in Scala","fork":false,"url":"https://api.github.com/repos/skinny-framework/skinny-framework","forks_url":"https://api.github.com/repos/skinny-framework/skinny-framework/forks","keys_url":"https://api.github.com/repos/skinny-framework/skinny-framework/keys{/key_id}","collaborators_url":"https://api.github.com/repos/skinny-framework/skinny-framework/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/skinny-framework/skinny-framework/teams","hooks_url":"https://api.github.com/repos/skinny-framework/skinny-framework/hooks","issue_events_url":"https://api.github.com/repos/skinny-framework/skinny-framework/issues/events{/number}","events_url":"https://api.github.com/repos/skinny-framework/skinny-framework/events","assignees_url":"https://api.github.com/repos/skinny-framework/skinny-framework/assignees{/user}","branches_url":"https://api.github.com/repos/skinny-framework/skinny-framework/branches{/branch}","tags_url":"https://api.github.com/repos/skinny-framework/skinny-framework/tags","blobs_url":"https://api.github.com/repos/skinny-framework/skinny-framework/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/skinny-framework/skinny-framework/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/skinny-framework/skinny-framework/git/refs{/sha}","trees_url":"https://api.github.com/repos/skinny-framework/skinny-framework/git/trees{/sha}","statuses_url":"https://api.github.com/repos/skinny-framework/skinny-framework/statuses/{sha}","languages_url":"https://api.github.com/repos/skinny-framework/skinny-framework/languages","stargazers_url":"https://api.github.com/repos/skinny-framework/skinny-framework/stargazers","contributors_url":"https://api.github.com/repos/skinny-framework/skinny-framework/contributors","subscribers_url":"https://api.github.com/repos/skinny-framework/skinny-framework/subscribers","subscription_url":"https://api.github.com/repos/skinny-framework/skinny-framework/subscription","commits_url":"https://api.github.com/repos/skinny-framework/skinny-framework/commits{/sha}","git_commits_url":"https://api.github.com/repos/skinny-framework/skinny-framework/git/commits{/sha}","comments_url":"https://api.github.com/repos/skinny-framework/skinny-framework/comments{/number}","issue_comment_url":"https://api.github.com/repos/skinny-framework/skinny-framework/issues/comments{/number}","contents_url":"https://api.github.com/repos/skinny-framework/skinny-framework/contents/{+path}","compare_url":"https://api.github.com/repos/skinny-framework/skinny-framework/compare/{base}...{head}","merges_url":"https://api.github.com/repos/skinny-framework/skinny-framework/merges","archive_url":"https://api.github.com/repos/skinny-framework/skinny-framework/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/skinny-framework/skinny-framework/downloads","issues_url":"https://api.github.com/repos/skinny-framework/skinny-framework/issues{/number}","pulls_url":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls{/number}","milestones_url":"https://api.github.com/repos/skinny-framework/skinny-framework/milestones{/number}","notifications_url":"https://api.github.com/repos/skinny-framework/skinny-framework/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/skinny-framework/skinny-framework/labels{/name}","releases_url":"https://api.github.com/repos/skinny-framework/skinny-framework/releases{/id}","created_at":"2013-09-24T07:39:24Z","updated_at":"2015-02-24T23:17:25Z","pushed_at":"2015-02-24T23:17:25Z","git_url":"git://github.com/skinny-framework/skinny-framework.git","ssh_url":"git@github.com:skinny-framework/skinny-framework.git","clone_url":"https://github.com/skinny-framework/skinny-framework.git","svn_url":"https://github.com/skinny-framework/skinny-framework","homepage":"http://skinny-framework.org/","size":8789,"stargazers_count":361,"watchers_count":361,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":9,"forks":39,"open_issues":9,"watchers":361,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239"},"html":{"href":"https://github.com/skinny-framework/skinny-framework/pull/239"},"issue":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/issues/239"},"comments":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/issues/239/comments"},"review_comments":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239/comments"},"review_comment":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/pulls/239/commits"},"statuses":{"href":"https://api.github.com/repos/skinny-framework/skinny-framework/statuses/edd848b48320442bbb5eb1b73c8a81ec5a30393c"}}}}