class RailsParamValidation::BooleanValidator
def initialize(schema, collection)
def initialize(schema, collection) super schema, collection end
def matches?(path, data)
def matches?(path, data) if data.is_a?(TrueClass) || data.is_a?(FalseClass) return MatchResult.new data end case data when "true" return MatchResult.new true when "false" return MatchResult.new false else return MatchResult.new(nil, path, "Expected a boolean (true, false)") end end
def to_openapi
def to_openapi { type: :boolean } end