{"action":"created","issue":{"url":"https://api.github.com/repos/lotus/validations/issues/77","labels_url":"https://api.github.com/repos/lotus/validations/issues/77/labels{/name}","comments_url":"https://api.github.com/repos/lotus/validations/issues/77/comments","events_url":"https://api.github.com/repos/lotus/validations/issues/77/events","html_url":"https://github.com/lotus/validations/issues/77","id":113881704,"number":77,"title":"param not required is still validated","user":{"login":"caspg","id":10419439,"avatar_url":"https://avatars.githubusercontent.com/u/10419439?v=3","gravatar_id":"","url":"https://api.github.com/users/caspg","html_url":"https://github.com/caspg","followers_url":"https://api.github.com/users/caspg/followers","following_url":"https://api.github.com/users/caspg/following{/other_user}","gists_url":"https://api.github.com/users/caspg/gists{/gist_id}","starred_url":"https://api.github.com/users/caspg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caspg/subscriptions","organizations_url":"https://api.github.com/users/caspg/orgs","repos_url":"https://api.github.com/users/caspg/repos","events_url":"https://api.github.com/users/caspg/events{/privacy}","received_events_url":"https://api.github.com/users/caspg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-28T17:52:08Z","updated_at":"2015-10-28T18:47:48Z","closed_at":null,"body":"In controller I have following code:\r\n```ruby\r\nparams do\r\n  param :path, format: /^\\S+$/\r\nend\r\n```\r\n\r\nSending request without `:path` param, in fact sends an empty `:path`:\r\n\r\n`params.to_h` returns `{ \"path\"=>\"\" }` \r\n\r\nValidation fails due to format constraint."},"comment":{"url":"https://api.github.com/repos/lotus/validations/issues/comments/151950424","html_url":"https://github.com/lotus/validations/issues/77#issuecomment-151950424","issue_url":"https://api.github.com/repos/lotus/validations/issues/77","id":151950424,"user":{"login":"caspg","id":10419439,"avatar_url":"https://avatars.githubusercontent.com/u/10419439?v=3","gravatar_id":"","url":"https://api.github.com/users/caspg","html_url":"https://github.com/caspg","followers_url":"https://api.github.com/users/caspg/followers","following_url":"https://api.github.com/users/caspg/following{/other_user}","gists_url":"https://api.github.com/users/caspg/gists{/gist_id}","starred_url":"https://api.github.com/users/caspg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caspg/subscriptions","organizations_url":"https://api.github.com/users/caspg/orgs","repos_url":"https://api.github.com/users/caspg/repos","events_url":"https://api.github.com/users/caspg/events{/privacy}","received_events_url":"https://api.github.com/users/caspg/received_events","type":"User","site_admin":false},"created_at":"2015-10-28T18:47:48Z","updated_at":"2015-10-28T18:47:48Z","body":"Since we can get an empty string (but we don't want to check if this param is present), we could use for example `#blank_value?` method and change:\r\nhttps://github.com/lotus/validations/blob/master/lib/lotus/validations/attribute.rb#L213-L215\r\n```ruby\r\ndef skip?\r\n  @value.nil?\r\nend\r\n```\r\nto:\r\n```ruby\r\ndef skip?\r\n  blank_value?\r\nend\r\n```\r\n\r\n@jodosha  What do you think?"}}