c

org.http4s.dsl.impl

OptionalMultiQueryParamDecoderMatcher

abstract class OptionalMultiQueryParamDecoderMatcher[T] extends AnyRef

Capture a query parameter that appears 0 or more times.

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

object FooMatcher extends OptionalMultiQueryParamDecoderMatcher[Foo]("foo")
val routes = HttpRoutes.of {
  // matches http://.../closest?foo=2&foo=3&foo=4
  case GET -> Root / "closest" :? FooMatcher(Validated.Valid(Seq(Foo(2),Foo(3),Foo(4)))) => ...

  /*
  *  matches http://.../closest?foo=2&foo=3&foo=4 as well as http://.../closest (no parameters)
  *  or http://.../closest?foo=2 (single occurrence)
  */
  case GET -> Root / "closest" :? FooMatcher(is) => ...
Source
Path.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. OptionalMultiQueryParamDecoderMatcher
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

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

Value Members

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