Package

io

finch

Permalink

package finch

This is a root package of the Finch library, which provides an immutable layer of functions and types atop of Finagle for writing lightweight HTTP services.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. finch
  2. ValidationRules
  3. Outputs
  4. Endpoints
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. case class BasicAuth(realm: String)(authenticate: (String, String) ⇒ Future[Boolean]) extends Product with Serializable

    Permalink

    Maintains Basic HTTP Auth for an arbitrary Endpoint.

    Maintains Basic HTTP Auth for an arbitrary Endpoint.

    Definition Classes
    Endpoints
  2. trait Decode[A] extends AnyRef

    Permalink

    Decodes an HTTP payload represented as Buf (encoded with Charset) into an arbitrary type A.

  3. trait DecodeEntity[A] extends AnyRef

    Permalink

    Decodes an HTTP entity (eg: header, query-string param) represented as UTF-8 String into an arbitrary type A.

  4. trait DecodePath[A] extends AnyRef

    Permalink

    Decodes an HTTP path (eg: /foo/bar/baz) represented as UTF-8 String into an arbitrary type A.

  5. trait Encode[A] extends AnyRef

    Permalink

    Encodes an HTTP payload (represented as an arbitrary type A) with a given Charset.

  6. trait Endpoint[A] extends AnyRef

    Permalink

    An Endpoint represents the HTTP endpoint.

    An Endpoint represents the HTTP endpoint.

    It is well known and widely adopted in Finagle that "Your Server is a Function" (i.e., Request => Future[Response]). In a REST/HTTP API setting this function may be viewed as Request =1=> (A =2=> Future[B]) =3=> Future[Response], where transformation 1 is a request decoding (deserialization), transformation 2 - is a business logic and transformation 3 is - a response encoding (serialization). The only interesting part here is transformation 2 (i.e., A => Future[B]), which represents an application business.

    An Endpoint transformation (map, mapAsync, etc.) encodes the business logic, while the rest of Finch ecosystem takes care about both serialization and deserialization.

    A typical way to transform (or map) the Endpoint is to use Mapper and Endpoint.apply method, which, depending on the argument type, delegates the map operation to the underlying function.

    import io.finch._
    
    case class Foo(i: Int)
    case class Bar(s: String)
    
    val foo: Endpoint[Foo] = get("foo") { Ok(Foo(42)) }
    val bar: Endpoint[Bar] = get("bar" :: string) { s: String => Ok(Bar(s)) }

    Endpoints are also composable in terms of or-else combinator (known as a "space invader" operator :+:) that takes two Endpoints and returns a coproduct Endpoint.

    import io.finch._
    
    val foobar: Endpoint[Foo :+: Bar :+: CNil] = foo :+: bar

    An Endpoint might be converted into a Finagle Service with Endpoint.toService method so it can be served within Finagle HTTP.

    import com.twitter.finagle.Http
    
    Http.server.serve(foobar.toService)
  7. type Endpoint0 = Endpoint[HNil]

    Permalink
    Definition Classes
    Endpoints
  8. type Endpoint2[A, B] = Endpoint[::[A, ::[B, HNil]]]

    Permalink
    Definition Classes
    Endpoints
  9. type Endpoint3[A, B, C] = Endpoint[::[A, ::[B, ::[C, HNil]]]]

    Permalink
    Definition Classes
    Endpoints
  10. trait Endpoints extends AnyRef

    Permalink

    A collection of Endpoint combinators.

  11. sealed abstract class Error extends Exception with NoStackTrace

    Permalink

    A single error from an Endpoint.

    A single error from an Endpoint.

    This indicates that one of the Finch's built-in components failed. This includes, but not limited by:

    - reading a required param, body, header, etc. - parsing a string-based endpoint with .as[T] combinator - validating an endpoint with .should or shouldNot combinators

  12. case class Errors(errors: NonEmptyList[Error]) extends Exception with NoStackTrace with Product with Serializable

    Permalink

    Multiple errors from an Endpoint.

    Multiple errors from an Endpoint.

    This type of error indicates that an endpoint is able to accumulate multiple Errors into a single instance of Errors that embeds a non-empty list.

    Error accumulation happens as part of the .product (or adjoin, ::) combinator.

  13. trait HighPriorityEncodeInstances extends LowPriorityEncodeInstances

    Permalink
  14. final case class Input(request: Request, path: Seq[String]) extends Product with Serializable

    Permalink

    An input for Endpoint.

  15. trait LowPriorityEncodeInstances extends AnyRef

    Permalink
  16. sealed trait Output[+A] extends AnyRef

    Permalink

    An output of Endpoint.

  17. trait Outputs extends AnyRef

    Permalink
  18. trait ValidationRule[A] extends AnyRef

    Permalink

    A ValidationRule enables a reusable way of defining a validation rules in the application domain.

    A ValidationRule enables a reusable way of defining a validation rules in the application domain. It might be composed with Endpoints using either should or shouldNot methods and with other ValidationRules using logical methods and and or.

    case class User(name: String, age: Int)
    val user: Endpoint[User] = (
      param("name").should(beLongerThan(3)) ::
      param("age").as[Int].should(beGreaterThan(0) and beLessThan(120))
    ).as[User]
  19. trait ValidationRules extends AnyRef

    Permalink
  20. type DecodeRequest[A] = Decode[A]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11) Use io.finch.Decode instead

  21. type EncodeResponse[A] = Encode[A]

    Permalink
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11) Use io.finch.Encode instead

Value Members

  1. object * extends Endpoint[HNil]

    Permalink

    An Endpoint that skips all path segments.

    An Endpoint that skips all path segments.

    Definition Classes
    Endpoints
  2. object / extends Endpoint[HNil]

    Permalink

    An identity Endpoint.

    An identity Endpoint.

    Definition Classes
    Endpoints
  3. def Accepted[A]: Output[A]

    Permalink
    Definition Classes
    Outputs
  4. object Application

    Permalink
  5. def BadGateway(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  6. def BadRequest(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  7. object BasicAuthFailed extends Exception

    Permalink

    An Exception representing a failed authorization with BasicAuth.

    An Exception representing a failed authorization with BasicAuth.

    Definition Classes
    Endpoints
  8. def Conflict(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  9. def Created[A](a: A): Output[A]

    Permalink
    Definition Classes
    Outputs
  10. object Decode

    Permalink
  11. object DecodeEntity

    Permalink
  12. object DecodePath

    Permalink
  13. object Encode extends HighPriorityEncodeInstances

    Permalink
  14. object Endpoint

    Permalink

    Provides extension methods for Endpoint to support coproduct and path syntax.

  15. def EnhanceYourCalm(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  16. object Error extends Serializable

    Permalink
  17. def Forbidden(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  18. def GatewayTimeout(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  19. def Gone(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  20. object Input extends Serializable

    Permalink

    Creates an input for Endpoint from Request.

  21. def InsufficientStorage(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  22. def InternalServerError(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  23. def LengthRequired(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  24. def MethodNotAllowed(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  25. def NoContent[A]: Output[A]

    Permalink
    Definition Classes
    Outputs
  26. def NotAcceptable(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  27. def NotFound(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  28. def NotImplemented(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  29. def Ok[A](a: A): Output[A]

    Permalink
    Definition Classes
    Outputs
  30. object Output

    Permalink
  31. def PaymentRequired(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  32. def PreconditionFailed(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  33. def RequestEntityTooLarge(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  34. def RequestTimeout(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  35. def RequestedRangeNotSatisfiable(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  36. def ServiceUnavailable(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  37. object Text

    Permalink
  38. def TooManyRequests(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  39. def Unauthorized(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  40. def UnprocessableEntity(cause: Exception): Output[Nothing]

    Permalink
    Definition Classes
    Outputs
  41. object ValidationRule

    Permalink

    Allows the creation of reusable validation rules for Endpoints.

  42. val asyncBody: Endpoint[AsyncStream[Buf]]

    Permalink

    An evaluating Endpoint that reads a required chunked streaming binary body, interpreted as an AsyncStream[Buf].

    An evaluating Endpoint that reads a required chunked streaming binary body, interpreted as an AsyncStream[Buf]. The returned Endpoint only matches chunked (streamed) requests.

    Definition Classes
    Endpoints
  43. def beGreaterThan[A](n: A)(implicit ev: Numeric[A]): ValidationRule[A]

    Permalink

    A ValidationRule that makes sure the numeric value is greater than given n.

    A ValidationRule that makes sure the numeric value is greater than given n.

    Definition Classes
    ValidationRules
  44. def beLessThan[A](n: A)(implicit ev: Numeric[A]): ValidationRule[A]

    Permalink

    A ValidationRule that makes sure the numeric value is less than given n.

    A ValidationRule that makes sure the numeric value is less than given n.

    Definition Classes
    ValidationRules
  45. def beLongerThan(n: Int): ValidationRule[String]

    Permalink

    A ValidationRule that makes sure the string value is longer than n symbols.

    A ValidationRule that makes sure the string value is longer than n symbols.

    Definition Classes
    ValidationRules
  46. def beShorterThan(n: Int): ValidationRule[String]

    Permalink

    A ValidationRule that makes sure the string value is shorter than n symbols.

    A ValidationRule that makes sure the string value is shorter than n symbols.

    Definition Classes
    ValidationRules
  47. val binaryBody: Endpoint[Array[Byte]]

    Permalink

    An evaluating Endpoint that reads a required binary request body, interpreted as an Array[Byte], or throws a Error.NotPresent exception.

    An evaluating Endpoint that reads a required binary request body, interpreted as an Array[Byte], or throws a Error.NotPresent exception. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
  48. val binaryBodyOption: Endpoint[Option[Array[Byte]]]

    Permalink

    An evaluating Endpoint that reads a binary request body, interpreted as a Array[Byte], into an Option.

    An evaluating Endpoint that reads a binary request body, interpreted as a Array[Byte], into an Option. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
  49. def body[A, CT <: String](implicit d: Aux[A, CT], ct: ClassTag[A]): Endpoint[A]

    Permalink

    An Endpoint that reads the required request body represented as CT (ContentType) and interpreted as A, or throws an Error.NotPresent exception.

    An Endpoint that reads the required request body represented as CT (ContentType) and interpreted as A, or throws an Error.NotPresent exception. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
  50. def bodyOption[A, CT <: String](implicit d: Aux[A, CT], ct: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    An Endpoint that reads an optional request body represented as CT (ContentType) and interpreted as A, into an Option.

    An Endpoint that reads an optional request body represented as CT (ContentType) and interpreted as A, into an Option. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
  51. object boolean extends Extractor[Boolean]

    Permalink

    A matching Endpoint that reads a boolean value from the current path segment.

    A matching Endpoint that reads a boolean value from the current path segment.

    Definition Classes
    Endpoints
  52. implicit def booleanToMatcher(b: Boolean): Endpoint0

    Permalink
    Definition Classes
    Endpoints
  53. object booleans extends TailExtractor[Boolean]

    Permalink

    A matching Endpoint that reads a boolean tail from the current path segment.

    A matching Endpoint that reads a boolean tail from the current path segment.

    Definition Classes
    Endpoints
  54. def connect[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is CONNECT and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  55. def cookie(name: String): Endpoint[Cookie]

    Permalink

    An evaluating Endpoint that reads a required cookie from the request or raises an Error.NotPresent exception when the cookie is missing.

    An evaluating Endpoint that reads a required cookie from the request or raises an Error.NotPresent exception when the cookie is missing.

    Definition Classes
    Endpoints
  56. def cookieOption(name: String): Endpoint[Option[Cookie]]

    Permalink

    An evaluating Endpoint that reads an optional HTTP cookie from the request into an Option.

    An evaluating Endpoint that reads an optional HTTP cookie from the request into an Option.

    Definition Classes
    Endpoints
  57. def delete[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is DELETE and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  58. def fileUpload(name: String): Endpoint[FileUpload]

    Permalink

    An evaluating Endpoint that reads a required file upload from a multipart/form-data request.

    An evaluating Endpoint that reads a required file upload from a multipart/form-data request.

    Definition Classes
    Endpoints
  59. def fileUploadOption(name: String): Endpoint[Option[FileUpload]]

    Permalink

    An evaluatingEndpoint that reads an optional file upload from a multipart/form-data request into an Option.

    An evaluatingEndpoint that reads an optional file upload from a multipart/form-data request into an Option.

    Definition Classes
    Endpoints
  60. def get[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is GET and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  61. def head[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is HEAD and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  62. def header(name: String): Endpoint[String]

    Permalink

    An evaluating Endpoint that reads a required HTTP header name from the request or raises an Error.NotPresent exception when the header is missing.

    An evaluating Endpoint that reads a required HTTP header name from the request or raises an Error.NotPresent exception when the header is missing.

    Definition Classes
    Endpoints
  63. def headerExists(name: String): Endpoint[String]

    Permalink

    A matching Endpoint that only matches the requests that contain a given header name.

    A matching Endpoint that only matches the requests that contain a given header name.

    Definition Classes
    Endpoints
  64. def headerOption(name: String): Endpoint[Option[String]]

    Permalink

    An evaluating Endpoint that reads an optional HTTP header name from the request into an Option.

    An evaluating Endpoint that reads an optional HTTP header name from the request into an Option.

    Definition Classes
    Endpoints
  65. object int extends Extractor[Int]

    Permalink

    A matching Endpoint that reads an integer value from the current path segment.

    A matching Endpoint that reads an integer value from the current path segment.

    Definition Classes
    Endpoints
  66. implicit def intToMatcher(i: Int): Endpoint0

    Permalink
    Definition Classes
    Endpoints
  67. package internal

    Permalink

    This package contains an internal-use only type-classes and utilities that power Finch's API.

    This package contains an internal-use only type-classes and utilities that power Finch's API.

    It's not recommended to use any of the internal API directly, since it might change without any deprecation cycles.

  68. object ints extends TailExtractor[Int]

    Permalink

    A matching Endpoint that reads an integer tail from the current path segment.

    A matching Endpoint that reads an integer tail from the current path segment.

    Definition Classes
    Endpoints
  69. object items

    Permalink
  70. def jsonBody[A](implicit arg0: Json[A], arg1: ClassTag[A]): Endpoint[A]

    Permalink

    Alias for body[A, Application.Json].

    Alias for body[A, Application.Json].

    Definition Classes
    Endpoints
  71. def jsonBodyOption[A](implicit arg0: Json[A], arg1: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    Alias for bodyOption[A, Application.Json].

    Alias for bodyOption[A, Application.Json].

    Definition Classes
    Endpoints
  72. object long extends Extractor[Long]

    Permalink

    A matching Endpoint that reads a long value from the current path segment.

    A matching Endpoint that reads a long value from the current path segment.

    Definition Classes
    Endpoints
  73. object longs extends TailExtractor[Long]

    Permalink

    A matching Endpoint that reads a long tail from the current path segment.

    A matching Endpoint that reads a long tail from the current path segment.

    Definition Classes
    Endpoints
  74. def options[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is OPTIONS and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  75. def param(name: String): Endpoint[String]

    Permalink

    An evaluating Endpoint that reads a required query-string param name from the request or raises an Error.NotPresent exception when the param is missing; an Error.NotValid exception is the param is empty.

    An evaluating Endpoint that reads a required query-string param name from the request or raises an Error.NotPresent exception when the param is missing; an Error.NotValid exception is the param is empty.

    Definition Classes
    Endpoints
  76. def paramExists(name: String): Endpoint[String]

    Permalink

    A matching Endpoint that only matches the requests that contain a given query-string param name.

    A matching Endpoint that only matches the requests that contain a given query-string param name.

    Definition Classes
    Endpoints
  77. def paramOption(name: String): Endpoint[Option[String]]

    Permalink

    An evaluating Endpoint that reads an optional query-string param name from the request into an Option.

    An evaluating Endpoint that reads an optional query-string param name from the request into an Option.

    Definition Classes
    Endpoints
  78. def params(name: String): Endpoint[Seq[String]]

    Permalink

    An evaluating Endpoint that reads an optional (in a meaning that a resulting Seq may be empty) multi-value query-string param name from the request into a Seq.

    An evaluating Endpoint that reads an optional (in a meaning that a resulting Seq may be empty) multi-value query-string param name from the request into a Seq.

    Definition Classes
    Endpoints
  79. def paramsNel(name: String): Endpoint[NonEmptyList[String]]

    Permalink

    An evaluating Endpoint that reads a required multi-value query-string param name from the request into a NonEmptyList or raises a Error.NotPresent exception when the params are missing or empty.

    An evaluating Endpoint that reads a required multi-value query-string param name from the request into a NonEmptyList or raises a Error.NotPresent exception when the params are missing or empty.

    Definition Classes
    Endpoints
  80. def patch[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is PATCH and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  81. def path[A](implicit c: DecodePath[A]): Endpoint[A]

    Permalink

    A matching Endpoint that reads a value of type A (using the implicit DecodePath instances defined for A) from the current path segment.

    A matching Endpoint that reads a value of type A (using the implicit DecodePath instances defined for A) from the current path segment.

    Definition Classes
    Endpoints
  82. val path: Endpoint[String]

    Permalink

    A matching Endpoint that reads a string value from the current path segment.

    A matching Endpoint that reads a string value from the current path segment.

    Definition Classes
    Endpoints
    Note

    This is an experimental API and might be removed without any notice.

  83. def post[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is POST and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  84. def put[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is PUT and the underlying endpoint succeeds on it.

    Definition Classes
    Endpoints
  85. val root: Endpoint[Request]

    Permalink

    A root Endpoint that always matches and extracts the current request.

    A root Endpoint that always matches and extracts the current request.

    Definition Classes
    Endpoints
  86. object string extends StringExtractor

    Permalink

    A matching Endpoint that reads a string value from the current path segment.

    A matching Endpoint that reads a string value from the current path segment.

    Definition Classes
    Endpoints
  87. val stringBody: Endpoint[String]

    Permalink

    An evaluating Endpoint that reads the required request body, interpreted as a String, or throws an Error.NotPresent exception.

    An evaluating Endpoint that reads the required request body, interpreted as a String, or throws an Error.NotPresent exception. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
  88. val stringBodyOption: Endpoint[Option[String]]

    Permalink

    An evaluating Endpoint that reads an optional request body, interpreted as a String, into an Option.

    An evaluating Endpoint that reads an optional request body, interpreted as a String, into an Option. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
  89. implicit def stringToMatcher(s: String): Endpoint0

    Permalink
    Definition Classes
    Endpoints
  90. object strings extends TailExtractor[String]

    Permalink

    A matching Endpoint that reads a string tail from the current path segment.

    A matching Endpoint that reads a string tail from the current path segment.

    Definition Classes
    Endpoints
  91. def textBody[A](implicit arg0: Text[A], arg1: ClassTag[A]): Endpoint[A]

    Permalink

    Alias for body[A, Text.Plain]

    Alias for body[A, Text.Plain]

    Definition Classes
    Endpoints
  92. def textBodyOption[A](implicit arg0: Text[A], arg1: ClassTag[A]): Endpoint[Option[A]]

    Permalink

    Alias for bodyOption[A, Text.Plain]

    Alias for bodyOption[A, Text.Plain]

    Definition Classes
    Endpoints
  93. implicit def toOptionalInlineRule[A](fn: (A) ⇒ Boolean): (Option[A]) ⇒ Boolean

    Permalink

    Implicit conversion that allows the same inline rules to be used for required and optional values.

    Implicit conversion that allows the same inline rules to be used for required and optional values. If the optional value is non-empty, it gets validated (and validation may fail, producing error), but if it is empty, it is always treated as valid.

    In order to help the compiler determine the case when inline rule should be converted, the type of the validated value should be specified explicitly.

    paramOption("foo").should("be greater than 50") { i: Int => i > 50 }
    fn

    the underlying function to convert

    Definition Classes
    ValidationRules
  94. def trace[A]: (Endpoint[A]) ⇒ Endpoint[A]

    Permalink

    A combinator that wraps the given Endpoint with additional check of the HTTP method.

    A combinator that wraps the given Endpoint with additional check of the HTTP method. The resulting Endpoint succeeds on the request only if its method is TRACE and the underlying router endpoint on it.

    Definition Classes
    Endpoints
  95. object uuid extends Extractor[UUID]

    Permalink

    A matching Endpoint that reads an UUID value from the current path segment.

    A matching Endpoint that reads an UUID value from the current path segment.

    Definition Classes
    Endpoints
  96. object uuids extends TailExtractor[UUID]

    Permalink

    A matching Endpoint that reads an UUID tail from the current path segment.

    A matching Endpoint that reads an UUID tail from the current path segment.

    Definition Classes
    Endpoints

Deprecated Value Members

  1. val body: Endpoint[Buf]

    Permalink

    An Endpoint that reads the required request body, interpreted as Buf, or throws an Error.NotPresent exception.

    An Endpoint that reads the required request body, interpreted as Buf, or throws an Error.NotPresent exception. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11) Use body[A, ContentType] instead

  2. val bodyOption: Endpoint[Option[Buf]]

    Permalink

    An Endpoint that reads an optional request body, interpreted as Buf, into an Option.

    An Endpoint that reads an optional request body, interpreted as Buf, into an Option. The returned Endpoint only matches non-chunked (non-streamed) requests.

    Definition Classes
    Endpoints
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11) Use bodyOption[A, ContentType] instead

  3. def paramsNonEmpty(name: String): Endpoint[Seq[String]]

    Permalink

    An evaluating Endpoint that reads a required (in a meaning that a resulting Seq will have at least one element) multi-value query-string param name from the request into a Seq or raises a Error.NotPresent exception when the params are missing or empty.

    An evaluating Endpoint that reads a required (in a meaning that a resulting Seq will have at least one element) multi-value query-string param name from the request into a Seq or raises a Error.NotPresent exception when the params are missing or empty.

    Definition Classes
    Endpoints
    Annotations
    @deprecated
    Deprecated

    (Since version 0.11) Use paramsNel and NonEmptyList instead

Inherited from ValidationRules

Inherited from Outputs

Inherited from Endpoints

Inherited from AnyRef

Inherited from Any

Ungrouped