{"action":"created","comment":{"url":"https://api.github.com/repos/mrkkrp/forma/pulls/comments/190156416","pull_request_review_id":122472687,"id":190156416,"diff_hunk":"@@ -117,6 +117,28 @@ runForm' :: Monad m\n      -- ^ The result of parsing\n runForm' f v = StructuredErrors <$> runForm f v\n \n+----------------------------------------------------------------------------\n+-- JSON Conversions\n+\n+-- | Convert 'ParsingFailed' data to a JSON 'Value'.\n+--\n+-- This function is used by 'StructuredErrors' in its 'ToJSON' instance.\n+\n+parsingFailed :: Maybe (FieldName names) -> Text -> Value","path":"Web/Forma/StructuredErrors.hs","position":127,"original_position":51,"commit_id":"aa41dbc45a995d3d8595b4d2d479b8883e80c7fd","original_commit_id":"aa41dbc45a995d3d8595b4d2d479b8883e80c7fd","user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars0.githubusercontent.com/u/8165792?v=4","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"body":"This is even more ad-hoc, I probably will be reluctant to merging this in.","created_at":"2018-05-23T08:07:38Z","updated_at":"2018-05-23T08:07:38Z","html_url":"https://github.com/mrkkrp/forma/pull/15#discussion_r190156416","pull_request_url":"https://api.github.com/repos/mrkkrp/forma/pulls/15","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/mrkkrp/forma/pulls/comments/190156416"},"html":{"href":"https://github.com/mrkkrp/forma/pull/15#discussion_r190156416"},"pull_request":{"href":"https://api.github.com/repos/mrkkrp/forma/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/mrkkrp/forma/pulls/15","id":189348086,"html_url":"https://github.com/mrkkrp/forma/pull/15","diff_url":"https://github.com/mrkkrp/forma/pull/15.diff","patch_url":"https://github.com/mrkkrp/forma/pull/15.patch","issue_url":"https://api.github.com/repos/mrkkrp/forma/issues/15","number":15,"state":"open","locked":false,"title":"Structured errors format","user":{"login":"tzemanovic","id":2284309,"avatar_url":"https://avatars1.githubusercontent.com/u/2284309?v=4","gravatar_id":"","url":"https://api.github.com/users/tzemanovic","html_url":"https://github.com/tzemanovic","followers_url":"https://api.github.com/users/tzemanovic/followers","following_url":"https://api.github.com/users/tzemanovic/following{/other_user}","gists_url":"https://api.github.com/users/tzemanovic/gists{/gist_id}","starred_url":"https://api.github.com/users/tzemanovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzemanovic/subscriptions","organizations_url":"https://api.github.com/users/tzemanovic/orgs","repos_url":"https://api.github.com/users/tzemanovic/repos","events_url":"https://api.github.com/users/tzemanovic/events{/privacy}","received_events_url":"https://api.github.com/users/tzemanovic/received_events","type":"User","site_admin":false},"body":"I ended-up putting this into its own module. \r\n\r\nIn my app, I return a different HTTP status code depending on the error (422 for validation and 400 for parsing error) with body `object [ \"errors\" .= toJSON result ]`.","created_at":"2018-05-21T11:03:11Z","updated_at":"2018-05-23T08:07:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7e6879dba95fadf582c18641ee0a2dc17edf067d","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/mrkkrp/forma/pulls/15/commits","review_comments_url":"https://api.github.com/repos/mrkkrp/forma/pulls/15/comments","review_comment_url":"https://api.github.com/repos/mrkkrp/forma/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mrkkrp/forma/issues/15/comments","statuses_url":"https://api.github.com/repos/mrkkrp/forma/statuses/aa41dbc45a995d3d8595b4d2d479b8883e80c7fd","head":{"label":"tzemanovic:structured-errors-format","ref":"structured-errors-format","sha":"aa41dbc45a995d3d8595b4d2d479b8883e80c7fd","user":{"login":"tzemanovic","id":2284309,"avatar_url":"https://avatars1.githubusercontent.com/u/2284309?v=4","gravatar_id":"","url":"https://api.github.com/users/tzemanovic","html_url":"https://github.com/tzemanovic","followers_url":"https://api.github.com/users/tzemanovic/followers","following_url":"https://api.github.com/users/tzemanovic/following{/other_user}","gists_url":"https://api.github.com/users/tzemanovic/gists{/gist_id}","starred_url":"https://api.github.com/users/tzemanovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzemanovic/subscriptions","organizations_url":"https://api.github.com/users/tzemanovic/orgs","repos_url":"https://api.github.com/users/tzemanovic/repos","events_url":"https://api.github.com/users/tzemanovic/events{/privacy}","received_events_url":"https://api.github.com/users/tzemanovic/received_events","type":"User","site_admin":false},"repo":{"id":132090062,"name":"forma","full_name":"tzemanovic/forma","owner":{"login":"tzemanovic","id":2284309,"avatar_url":"https://avatars1.githubusercontent.com/u/2284309?v=4","gravatar_id":"","url":"https://api.github.com/users/tzemanovic","html_url":"https://github.com/tzemanovic","followers_url":"https://api.github.com/users/tzemanovic/followers","following_url":"https://api.github.com/users/tzemanovic/following{/other_user}","gists_url":"https://api.github.com/users/tzemanovic/gists{/gist_id}","starred_url":"https://api.github.com/users/tzemanovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tzemanovic/subscriptions","organizations_url":"https://api.github.com/users/tzemanovic/orgs","repos_url":"https://api.github.com/users/tzemanovic/repos","events_url":"https://api.github.com/users/tzemanovic/events{/privacy}","received_events_url":"https://api.github.com/users/tzemanovic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tzemanovic/forma","description":"Parse and validate forms in JSON format","fork":true,"url":"https://api.github.com/repos/tzemanovic/forma","forks_url":"https://api.github.com/repos/tzemanovic/forma/forks","keys_url":"https://api.github.com/repos/tzemanovic/forma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tzemanovic/forma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tzemanovic/forma/teams","hooks_url":"https://api.github.com/repos/tzemanovic/forma/hooks","issue_events_url":"https://api.github.com/repos/tzemanovic/forma/issues/events{/number}","events_url":"https://api.github.com/repos/tzemanovic/forma/events","assignees_url":"https://api.github.com/repos/tzemanovic/forma/assignees{/user}","branches_url":"https://api.github.com/repos/tzemanovic/forma/branches{/branch}","tags_url":"https://api.github.com/repos/tzemanovic/forma/tags","blobs_url":"https://api.github.com/repos/tzemanovic/forma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tzemanovic/forma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tzemanovic/forma/git/refs{/sha}","trees_url":"https://api.github.com/repos/tzemanovic/forma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tzemanovic/forma/statuses/{sha}","languages_url":"https://api.github.com/repos/tzemanovic/forma/languages","stargazers_url":"https://api.github.com/repos/tzemanovic/forma/stargazers","contributors_url":"https://api.github.com/repos/tzemanovic/forma/contributors","subscribers_url":"https://api.github.com/repos/tzemanovic/forma/subscribers","subscription_url":"https://api.github.com/repos/tzemanovic/forma/subscription","commits_url":"https://api.github.com/repos/tzemanovic/forma/commits{/sha}","git_commits_url":"https://api.github.com/repos/tzemanovic/forma/git/commits{/sha}","comments_url":"https://api.github.com/repos/tzemanovic/forma/comments{/number}","issue_comment_url":"https://api.github.com/repos/tzemanovic/forma/issues/comments{/number}","contents_url":"https://api.github.com/repos/tzemanovic/forma/contents/{+path}","compare_url":"https://api.github.com/repos/tzemanovic/forma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tzemanovic/forma/merges","archive_url":"https://api.github.com/repos/tzemanovic/forma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tzemanovic/forma/downloads","issues_url":"https://api.github.com/repos/tzemanovic/forma/issues{/number}","pulls_url":"https://api.github.com/repos/tzemanovic/forma/pulls{/number}","milestones_url":"https://api.github.com/repos/tzemanovic/forma/milestones{/number}","notifications_url":"https://api.github.com/repos/tzemanovic/forma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tzemanovic/forma/labels{/name}","releases_url":"https://api.github.com/repos/tzemanovic/forma/releases{/id}","deployments_url":"https://api.github.com/repos/tzemanovic/forma/deployments","created_at":"2018-05-04T05:08:44Z","updated_at":"2018-05-20T01:42:06Z","pushed_at":"2018-05-23T07:24:48Z","git_url":"git://github.com/tzemanovic/forma.git","ssh_url":"git@github.com:tzemanovic/forma.git","clone_url":"https://github.com/tzemanovic/forma.git","svn_url":"https://github.com/tzemanovic/forma","homepage":"","size":91,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mrkkrp:master","ref":"master","sha":"8d615a47b42bc096ed566e600c3b4d1c9bf1cddc","user":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars0.githubusercontent.com/u/8165792?v=4","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"repo":{"id":88429392,"name":"forma","full_name":"mrkkrp/forma","owner":{"login":"mrkkrp","id":8165792,"avatar_url":"https://avatars0.githubusercontent.com/u/8165792?v=4","gravatar_id":"","url":"https://api.github.com/users/mrkkrp","html_url":"https://github.com/mrkkrp","followers_url":"https://api.github.com/users/mrkkrp/followers","following_url":"https://api.github.com/users/mrkkrp/following{/other_user}","gists_url":"https://api.github.com/users/mrkkrp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrkkrp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrkkrp/subscriptions","organizations_url":"https://api.github.com/users/mrkkrp/orgs","repos_url":"https://api.github.com/users/mrkkrp/repos","events_url":"https://api.github.com/users/mrkkrp/events{/privacy}","received_events_url":"https://api.github.com/users/mrkkrp/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrkkrp/forma","description":"Parse and validate forms in JSON format","fork":false,"url":"https://api.github.com/repos/mrkkrp/forma","forks_url":"https://api.github.com/repos/mrkkrp/forma/forks","keys_url":"https://api.github.com/repos/mrkkrp/forma/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrkkrp/forma/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrkkrp/forma/teams","hooks_url":"https://api.github.com/repos/mrkkrp/forma/hooks","issue_events_url":"https://api.github.com/repos/mrkkrp/forma/issues/events{/number}","events_url":"https://api.github.com/repos/mrkkrp/forma/events","assignees_url":"https://api.github.com/repos/mrkkrp/forma/assignees{/user}","branches_url":"https://api.github.com/repos/mrkkrp/forma/branches{/branch}","tags_url":"https://api.github.com/repos/mrkkrp/forma/tags","blobs_url":"https://api.github.com/repos/mrkkrp/forma/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrkkrp/forma/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrkkrp/forma/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrkkrp/forma/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrkkrp/forma/statuses/{sha}","languages_url":"https://api.github.com/repos/mrkkrp/forma/languages","stargazers_url":"https://api.github.com/repos/mrkkrp/forma/stargazers","contributors_url":"https://api.github.com/repos/mrkkrp/forma/contributors","subscribers_url":"https://api.github.com/repos/mrkkrp/forma/subscribers","subscription_url":"https://api.github.com/repos/mrkkrp/forma/subscription","commits_url":"https://api.github.com/repos/mrkkrp/forma/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrkkrp/forma/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrkkrp/forma/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrkkrp/forma/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrkkrp/forma/contents/{+path}","compare_url":"https://api.github.com/repos/mrkkrp/forma/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrkkrp/forma/merges","archive_url":"https://api.github.com/repos/mrkkrp/forma/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrkkrp/forma/downloads","issues_url":"https://api.github.com/repos/mrkkrp/forma/issues{/number}","pulls_url":"https://api.github.com/repos/mrkkrp/forma/pulls{/number}","milestones_url":"https://api.github.com/repos/mrkkrp/forma/milestones{/number}","notifications_url":"https://api.github.com/repos/mrkkrp/forma/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrkkrp/forma/labels{/name}","releases_url":"https://api.github.com/repos/mrkkrp/forma/releases{/id}","deployments_url":"https://api.github.com/repos/mrkkrp/forma/deployments","created_at":"2017-04-16T16:59:31Z","updated_at":"2018-05-21T18:00:04Z","pushed_at":"2018-05-23T07:24:49Z","git_url":"git://github.com/mrkkrp/forma.git","ssh_url":"git@github.com:mrkkrp/forma.git","clone_url":"https://github.com/mrkkrp/forma.git","svn_url":"https://github.com/mrkkrp/forma","homepage":"","size":59,"stargazers_count":13,"watchers_count":13,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":2,"open_issues":1,"watchers":13,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mrkkrp/forma/pulls/15"},"html":{"href":"https://github.com/mrkkrp/forma/pull/15"},"issue":{"href":"https://api.github.com/repos/mrkkrp/forma/issues/15"},"comments":{"href":"https://api.github.com/repos/mrkkrp/forma/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/mrkkrp/forma/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/mrkkrp/forma/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mrkkrp/forma/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/mrkkrp/forma/statuses/aa41dbc45a995d3d8595b4d2d479b8883e80c7fd"}},"author_association":"NONE"}}
{"actor":{"display_login":"mrkkrp"}}