Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does coerce still work? #317

Open
markalanevans opened this issue Jun 28, 2015 · 0 comments
Open

Does coerce still work? #317

markalanevans opened this issue Jun 28, 2015 · 0 comments

Comments

@markalanevans
Copy link

I add this to my api.rb

use Goliath::Rack::Validation::CoerceValue, :key => 'url', :as => ValidUrl

And required this class /libs/valid_url.rb in my runner.rb.

class ValidUrl

  def coerce value, opts ={}
    raise Goliath::Rack::Validation::FailedCoerce.new([400, {}, "URL is invalid"])
  end
end

The exception is never thrown. Am I missing something else?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant