c

org.http4s.dsl.impl

ValidatingQueryParamDecoderMatcher

abstract class ValidatingQueryParamDecoderMatcher[T] extends AnyRef

param extractor using org.http4s.QueryParamDecoder. Note that this will return a ParseFailure if the parameter cannot be decoded.

case class Foo(i: Int)
implicit val fooDecoder: QueryParamDecoder[Foo] = ...

object FooMatcher extends ValidatingQueryParamDecoderMatcher[Foo]("foo")
val routes: HttpRoutes.of = {
  case GET -> Root / "closest" :? FooMatcher(fooValue) =>
    fooValue.fold(
      nelE => BadRequest(nelE.toList.map(_.sanitized).mkString("\n")),
      foo  => { ... }
    )
Source
Path.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ValidatingQueryParamDecoderMatcher
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ValidatingQueryParamDecoderMatcher(name: String)(implicit arg0: QueryParamDecoder[T])

Value Members

  1. def unapply(params: Map[String, Seq[String]]): Option[ValidatedNel[ParseFailure, T]]