Skip to content

Does coerce still work? #317

@markalanevans

Description

@markalanevans

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions