Path

endpoints4s.play.server.Urls.Path
trait Path[A] extends Url[A]

An URL path carrying an A information

Values of type Path[A] can be constructed by the operations path, segment, and remainingSegments.

 path / "user" / segment[UUID]("id")
  • Server interpreters raise an error if they can’t parse the incoming request path as a value of type A. By default, they produce a Bad Request (400) response with a list of error messages in a JSON array. Refer to the documentation of your server interpreter to customize this behavior.

Attributes

Note

This type has implicit methods provided by the PathOps, InvariantFunctorSyntax, and the PartialInvariantFunctorSyntax classes.

Graph
Supertypes
trait Url[A]
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def decode(segments: List[String]): Option[(Validated[A], List[String])]

Attributes

Returns

None in case the incoming path didn’t match, Some(Left(…)) in case it matched but decoding failed, Some(Right(…)) if it matched and decoding succeeded

def encode(a: A): Seq[String]

Concrete methods

final def decodeUrl(request: RequestHeader): Option[Validated[A]]

Attributes

Returns

None if the request doesn’t match, Some(Invalid(…)) if it matched but decoding failed, and Some(Valid(…)) if it matched and succeeded

final def encodeUrlComponents(a: A): (Seq[String], Map[String, Seq[String]])

Attributes

Returns

a pair containing the URL-encoded segments, and the URL-encoded query parameters

Inherited methods

final def encodeUrl(a: A): String

Attributes

Inherited from:
Url