{"action":"created","issue":{"url":"https://api.github.com/repos/rack-app/rack-app/issues/10","repository_url":"https://api.github.com/repos/rack-app/rack-app","labels_url":"https://api.github.com/repos/rack-app/rack-app/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/rack-app/rack-app/issues/10/comments","events_url":"https://api.github.com/repos/rack-app/rack-app/issues/10/events","html_url":"https://github.com/rack-app/rack-app/issues/10","id":175747724,"number":10,"title":"Parsing form data","user":{"login":"janfri","id":854,"avatar_url":"https://avatars.githubusercontent.com/u/854?v=3","gravatar_id":"","url":"https://api.github.com/users/janfri","html_url":"https://github.com/janfri","followers_url":"https://api.github.com/users/janfri/followers","following_url":"https://api.github.com/users/janfri/following{/other_user}","gists_url":"https://api.github.com/users/janfri/gists{/gist_id}","starred_url":"https://api.github.com/users/janfri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janfri/subscriptions","organizations_url":"https://api.github.com/users/janfri/orgs","repos_url":"https://api.github.com/users/janfri/repos","events_url":"https://api.github.com/users/janfri/events{/privacy}","received_events_url":"https://api.github.com/users/janfri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"adamluzsi","id":2897081,"avatar_url":"https://avatars.githubusercontent.com/u/2897081?v=3","gravatar_id":"","url":"https://api.github.com/users/adamluzsi","html_url":"https://github.com/adamluzsi","followers_url":"https://api.github.com/users/adamluzsi/followers","following_url":"https://api.github.com/users/adamluzsi/following{/other_user}","gists_url":"https://api.github.com/users/adamluzsi/gists{/gist_id}","starred_url":"https://api.github.com/users/adamluzsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamluzsi/subscriptions","organizations_url":"https://api.github.com/users/adamluzsi/orgs","repos_url":"https://api.github.com/users/adamluzsi/repos","events_url":"https://api.github.com/users/adamluzsi/events{/privacy}","received_events_url":"https://api.github.com/users/adamluzsi/received_events","type":"User","site_admin":false},"assignees":[{"login":"adamluzsi","id":2897081,"avatar_url":"https://avatars.githubusercontent.com/u/2897081?v=3","gravatar_id":"","url":"https://api.github.com/users/adamluzsi","html_url":"https://github.com/adamluzsi","followers_url":"https://api.github.com/users/adamluzsi/followers","following_url":"https://api.github.com/users/adamluzsi/following{/other_user}","gists_url":"https://api.github.com/users/adamluzsi/gists{/gist_id}","starred_url":"https://api.github.com/users/adamluzsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamluzsi/subscriptions","organizations_url":"https://api.github.com/users/adamluzsi/orgs","repos_url":"https://api.github.com/users/adamluzsi/repos","events_url":"https://api.github.com/users/adamluzsi/events{/privacy}","received_events_url":"https://api.github.com/users/adamluzsi/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/rack-app/rack-app/milestones/1","html_url":"https://github.com/rack-app/rack-app/milestone/1","labels_url":"https://api.github.com/repos/rack-app/rack-app/milestones/1/labels","id":2013231,"number":1,"title":"v6","description":null,"creator":{"login":"adamluzsi","id":2897081,"avatar_url":"https://avatars.githubusercontent.com/u/2897081?v=3","gravatar_id":"","url":"https://api.github.com/users/adamluzsi","html_url":"https://github.com/adamluzsi","followers_url":"https://api.github.com/users/adamluzsi/followers","following_url":"https://api.github.com/users/adamluzsi/following{/other_user}","gists_url":"https://api.github.com/users/adamluzsi/gists{/gist_id}","starred_url":"https://api.github.com/users/adamluzsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamluzsi/subscriptions","organizations_url":"https://api.github.com/users/adamluzsi/orgs","repos_url":"https://api.github.com/users/adamluzsi/repos","events_url":"https://api.github.com/users/adamluzsi/events{/privacy}","received_events_url":"https://api.github.com/users/adamluzsi/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":0,"state":"open","created_at":"2016-09-19T10:14:46Z","updated_at":"2016-09-19T20:17:54Z","due_on":null,"closed_at":null},"comments":14,"created_at":"2016-09-08T13:02:13Z","updated_at":"2016-12-09T11:50:54Z","closed_at":null,"body":"Is there a nice way to get parsed values of form data? I can do\n\n``` ruby\nclass App < RackApp\n  post '/' do\n    parsed_form_data = request.POST\n    # ...\n  end\nend\n```\n\nbut `request.POST` seems not to be very rack-app-ish. In standard rack the parsed form data is merged in params but I think a different method like `parsed_form_data` would be a better solution.\n\nIt would also be nice to have validations for form data, something like\n\n``` ruby\ndesc 'example'\nvalidate_form_data do\n  required 'description', class: String, desc: 'example description'\nend\npost '/example' do\n  desc = parsed_form_data['description']\n  # ...\nend\n```\n\nDid I miss something or is such functionality not (yet) implemented?\n"},"comment":{"url":"https://api.github.com/repos/rack-app/rack-app/issues/comments/265996511","html_url":"https://github.com/rack-app/rack-app/issues/10#issuecomment-265996511","issue_url":"https://api.github.com/repos/rack-app/rack-app/issues/10","id":265996511,"user":{"login":"adamluzsi","id":2897081,"avatar_url":"https://avatars.githubusercontent.com/u/2897081?v=3","gravatar_id":"","url":"https://api.github.com/users/adamluzsi","html_url":"https://github.com/adamluzsi","followers_url":"https://api.github.com/users/adamluzsi/followers","following_url":"https://api.github.com/users/adamluzsi/following{/other_user}","gists_url":"https://api.github.com/users/adamluzsi/gists{/gist_id}","starred_url":"https://api.github.com/users/adamluzsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamluzsi/subscriptions","organizations_url":"https://api.github.com/users/adamluzsi/orgs","repos_url":"https://api.github.com/users/adamluzsi/repos","events_url":"https://api.github.com/users/adamluzsi/events{/privacy}","received_events_url":"https://api.github.com/users/adamluzsi/received_events","type":"User","site_admin":false},"created_at":"2016-12-09T11:50:54Z","updated_at":"2016-12-09T11:50:54Z","body":"Hy @janfri , little change in the future implementation. Yesterday, I talked about your feature request with my friends, and they suggested, that I should implement this as a middleware (which was in the original plan to), and as a core extension that can be used. In this way, we don't break the rolling release, and make this optional for those who require. \r\n\r\nAny opinion? \r\n\r\n```ruby\r\nrequire 'rack/app'\r\n\r\nclass App < Rack::App\r\n\r\n  apply_extension :payload \r\n\r\n  desc 'health check endpoint'\r\n  validate_payload do |payload| \r\n    assert_instance_of Array, payload, \"payload must be in bulk format\"\r\n    payload.each{|e| assert_instance_of(Hash, payload, \"payload elements must be objects\") }\r\n  end \r\n  get '/' do\r\n    payload #> is an object based on the \r\n  end\r\n\r\n  get '/hello' do\r\n    return 'Hello World'\r\n  end\r\n\r\nend\r\n```"}}
{"actor":{"display_login":"adamluzsi"}}