{"action":"created","issue":{"url":"https://api.github.com/repos/Apipie/apipie-rails/issues/374","repository_url":"https://api.github.com/repos/Apipie/apipie-rails","labels_url":"https://api.github.com/repos/Apipie/apipie-rails/issues/374/labels{/name}","comments_url":"https://api.github.com/repos/Apipie/apipie-rails/issues/374/comments","events_url":"https://api.github.com/repos/Apipie/apipie-rails/issues/374/events","html_url":"https://github.com/Apipie/apipie-rails/issues/374","id":90197228,"number":374,"title":"Hash validator fails with encoded JSON value","user":{"login":"wordofchristian","id":555044,"avatar_url":"https://avatars.githubusercontent.com/u/555044?v=3","gravatar_id":"","url":"https://api.github.com/users/wordofchristian","html_url":"https://github.com/wordofchristian","followers_url":"https://api.github.com/users/wordofchristian/followers","following_url":"https://api.github.com/users/wordofchristian/following{/other_user}","gists_url":"https://api.github.com/users/wordofchristian/gists{/gist_id}","starred_url":"https://api.github.com/users/wordofchristian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wordofchristian/subscriptions","organizations_url":"https://api.github.com/users/wordofchristian/orgs","repos_url":"https://api.github.com/users/wordofchristian/repos","events_url":"https://api.github.com/users/wordofchristian/events{/privacy}","received_events_url":"https://api.github.com/users/wordofchristian/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2015-06-22T20:04:12Z","updated_at":"2016-10-16T15:39:52Z","closed_at":"2015-12-14T00:02:51Z","body":"I have an endpoint that has Hash as one of it's parameters.\r\n\r\n ```ruby\r\nparam :thing_form, Hash, 'Thing form values', required: true do\r\n    param :name, String, \"Thing's name\"\r\n    param :color, String, \"Thing's color\"\r\nend\r\n```\r\n\r\nThe problem is that when the client posts data it does it as a JSON string in the request body. Rails automatically knows how to convert this JSON string into a Hash when retrieving the value of `params[:thing_form]`. \r\n\r\nApipie however is failing with invalid type error.\r\n`Invalid parameter 'thing_form' value \"{\\\"name\\\":\\\"Foo\\\",\\\"color\\\":\\\"red\\\"}\": Must be Hash`\r\n\r\nShould I just be using an `:undef` validator for the form, or should apipie try to parse the JSON before performing Hash type validation?\r\n\r\nWhat does everyone else do for cases like this?"},"comment":{"url":"https://api.github.com/repos/Apipie/apipie-rails/issues/comments/254054176","html_url":"https://github.com/Apipie/apipie-rails/issues/374#issuecomment-254054176","issue_url":"https://api.github.com/repos/Apipie/apipie-rails/issues/374","id":254054176,"user":{"login":"thiensubs","id":2623569,"avatar_url":"https://avatars.githubusercontent.com/u/2623569?v=3","gravatar_id":"","url":"https://api.github.com/users/thiensubs","html_url":"https://github.com/thiensubs","followers_url":"https://api.github.com/users/thiensubs/followers","following_url":"https://api.github.com/users/thiensubs/following{/other_user}","gists_url":"https://api.github.com/users/thiensubs/gists{/gist_id}","starred_url":"https://api.github.com/users/thiensubs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thiensubs/subscriptions","organizations_url":"https://api.github.com/users/thiensubs/orgs","repos_url":"https://api.github.com/users/thiensubs/repos","events_url":"https://api.github.com/users/thiensubs/events{/privacy}","received_events_url":"https://api.github.com/users/thiensubs/received_events","type":"User","site_admin":false},"created_at":"2016-10-16T15:39:52Z","updated_at":"2016-10-16T15:39:52Z","body":"+1 I has the same issue with Rails 5.0.0.1"}}
{"actor":{"display_login":"thiensubs"}}