package parameters
- Alphabetic
- Public
- All
Type Members
-
trait
Bindable
[-T, +B <: Binding] extends AnyRef
Allows binding of a value to an entity (eg.
Allows binding of a value to an entity (eg. query/header/field...)
-
sealed
trait
Binding
extends AnyRef
Represents the binding of a parameter to it's value in a particular context
- trait Body [T] extends Iterable[BodyParameter] with Mandatory[Message, T] with Rebindable[Message, T, RequestBinding]
- trait BodyParameter extends Parameter
-
case class
BodySpec
[T](contentType: ContentType, paramType: ParamType, deserialize: (Buf) ⇒ T, serialize: (T) ⇒ Buf = (s: T) => Buf.Utf8(s.toString)) extends Product with Serializable
Spec required to marshall a body of a custom type
Spec required to marshall a body of a custom type
- T
the type of the deserialised body
- contentType
The HTTP content type header value
- paramType
How the body is represented when documenting APIs.
- deserialize
function to take the input string from the request and attempt to construct a deserialized instance. Exceptions are automatically caught and translated into the appropriate result, so just concentrate on the Happy-path case
- serialize
function to take the input type and serialize it to a string to be represented in the request
-
trait
Composite
[T] extends Mandatory[Request, T] with HasParameters with Rebindable[Request, T, Binding]
A composite allows for a single object to be extracted from many request parameters.
A composite allows for a single object to be extracted from many request parameters. Validation is applied to all of the parts before being passed to a user implemented service. Extend this to provide custom extraction for composite objects.
- abstract class ExtractableFormFile [Bind, Out] extends Parameter with Bindable[Bind, FormFileBinding] with FormField[Bind]
- abstract class ExtractableParameter [Raw, Wrapper, Bndg <: Binding, Bind, Out] extends Parameter with Bindable[Bind, Bndg]
- case class ExtractedRouteRequest (request: Request, contents: Map[Any, Extraction[Any]]) extends RequestProxy with Product with Serializable
-
case class
Form
(fields: Map[String, Seq[String]] = Map.empty, files: Map[String, Seq[MultiPartFile]] = Map.empty, errors: Seq[ExtractionError] = Nil) extends Product with Serializable
The body entity of a encoded HTML form.
The body entity of a encoded HTML form. Basically a wrapper for Form construction and field extraction.
- trait FormElementBinding extends (Form) ⇒ Form
- trait FormField [T] extends BodyParameter
- class FormFieldBinding extends RequestBinding with FormElementBinding
- sealed trait FormFieldExtractor extends AnyRef
- class FormFileBinding extends RequestBinding with FormElementBinding
-
sealed
trait
FormValidator
extends AnyRef
A strategy for validating the fields in a form
- trait HasParameters extends Iterable[Parameter]
- trait HeaderParameter [T] extends Parameter with Rebindable[Message, T, RequestBinding]
-
case class
InMemoryMultiPartFile
(filename: String, content: Buf, contentType: Option[String] = None) extends MultiPartFile with Product with Serializable
This is a multipart form file element that is under the max memory limit, and thus has been kept
- trait Mandatory [-From, T] extends Retrieval[From, T] with Extractor[From, T]
- trait MandatoryParameter [From, T, Bnd <: Binding] extends Mandatory[From, T] with Parameter with Rebindable[From, T, Bnd]
- abstract class MultiMandatoryFormFile extends ExtractableFormFile[Seq[MultiPartFile], Seq[MultiPartFile]]
- abstract class MultiMandatoryParameter [T, From, B <: Binding] extends ExtractableParameter[T, From, B, Seq[T], Seq[T]]
- abstract class MultiOptionalFormFile extends ExtractableFormFile[Seq[MultiPartFile], Option[Seq[MultiPartFile]]]
- abstract class MultiOptionalParameter [T, From, B <: Binding] extends ExtractableParameter[T, From, B, Seq[T], Option[Seq[T]]]
-
trait
MultiParameters
[P[_], R[_]] extends AnyRef
Support for parameters which can have more than one value (e.g query parameters or forms)
- sealed trait MultiPartFile extends AnyRef
- case class MultiPartFormBody (formContents: Seq[FormField[_] with Extractor[Form, _]], validator: FormValidator, extractor: FormFieldExtractor) extends Body[Form] with Product with Serializable
-
case class
OnDiskMultiPartFile
(filename: String, content: File, contentType: Option[String] = None) extends MultiPartFile with Product with Serializable
This is a multipart form file element that is over the max memory limit, and thus has been stored on disk temporarily
- trait Optional [-From, T] extends Retrieval[From, Option[T]] with Extractor[From, Option[T]]
- trait OptionalParameter [From, T, Bnd <: Binding] extends Optional[From, T] with Parameter with Rebindable[From, T, Bnd]
-
sealed
class
ParamType
extends AnyRef
How a parameter is represented in the HTTP message (JSON type)
-
trait
Parameter
extends HasParameters
A parameter is a name-value pair which can be encoded into an HTTP message.
A parameter is a name-value pair which can be encoded into an HTTP message. Sub-types represent the various places in which values are encoded (eg. header/form/query/path)
-
trait
ParameterExtractAndBind
[From, Rep, B <: Binding] extends AnyRef
Parameter location specific utility functions to assist with extraction and binding of values
-
case class
ParameterSpec
[T] extends Product with Serializable
Spec required to marshal and unmarshal a parameter of a custom type
Spec required to marshal and unmarshal a parameter of a custom type
- T
the type of the deserialised parameter
- returns
a parameter for retrieving a value of type [T] from the request
-
trait
Parameters
[P[_], R[_]] extends AnyRef
Prototype functions for creating parameters of various types.
- trait PathBindable [T] extends Bindable[T, PathBinding]
- class PathBinding extends Binding
- abstract class PathParameter [T] extends Parameter with Iterable[PathParameter[_]]
- class QueryBinding extends Binding
- trait QueryParameter [T] extends Parameter with Rebindable[Request, T, QueryBinding]
-
trait
Rebindable
[-From, T, +B <: Binding] extends Bindable[T, B]
Used to transparently copy the value out of an incoming request (or form etc..) and into an outgoing one.
Used to transparently copy the value out of an incoming request (or form etc..) and into an outgoing one. Useful when chaining requests together.
- class RequestBinding extends Binding
-
trait
Retrieval
[-From, T] extends AnyRef
Represents the ability to retrieve a value from an enclosing object (request/form etc..)
- abstract class SingleMandatoryFormFile extends ExtractableFormFile[MultiPartFile, MultiPartFile]
- abstract class SingleMandatoryParameter [T, From, B <: Binding] extends ExtractableParameter[T, From, B, T, T]
- abstract class SingleOptionalFormFile extends ExtractableFormFile[MultiPartFile, Option[MultiPartFile]]
- abstract class SingleOptionalParameter [T, From, B <: Binding] extends ExtractableParameter[T, From, B, T, Option[T]]
-
case class
UniBody
[T](inDescription: String, spec: BodySpec[T], theExample: Option[T]) extends Body[T] with Product with Serializable
Represents a single entity which makes up the entirety of an HTTP message body.
Represents a single entity which makes up the entirety of an HTTP message body.
- T
the type of the request when it has been deserialized from the request
- spec
the specification of this body type
- theExample
an example object of this body
- case class UrlEncodedFormBody (formContents: Seq[FormField[_] with Extractor[Form, _]], validator: FormValidator, extractor: FormFieldExtractor) extends Body[Form] with Product with Serializable
- trait Value [T] extends Any
-
class
WebFormValidator
extends FormValidator
Web-forms are a less harsh version of forms, which report both a collection of received fields and a set of invalid fields.
Web-forms are a less harsh version of forms, which report both a collection of received fields and a set of invalid fields. This form-type is to be used for web forms (where feedback is desirable and the user can be redirected back to the form page). As such, extracting an invalid webform from a request will not fail unless the body encoding itself is invalid.
Value Members
- object ArrayParamType extends ParamType
-
object
Body
Factory methods for various supported HTTP body types.
- object BodySpec extends Serializable
- object BooleanParamType extends ParamType
- object FileParamType extends ParamType
- object Form extends Serializable
- object FormField
- object FormFile
-
object
Header
Parameters which are bound to request/response headers
- object HeaderExtractAndRebind extends ParameterExtractAndBind[Message, String, RequestBinding]
- object IntegerParamType extends ParamType
- object MultiPartFile
- object NullParamType extends ParamType
- object NumberParamType extends ParamType
- object ObjectParamType extends ParamType
-
object
ParameterSpec
extends Serializable
Predefined ParameterSpec instances for common types.
Predefined ParameterSpec instances for common types. These are mappable to custom types, so start with these.
-
object
Path
extends Parameters[PathParameter, PathBindable]
Parameters which are bound to the path segments of a URL
-
object
Query
Parameters which are bound to the query part of a URL
- object QueryExtractAndRebind extends ParameterExtractAndBind[Request, String, QueryBinding]
- object StrictFormFieldExtractor extends FormFieldExtractor
-
object
StrictFormValidator
extends FormValidator
Strict Forms fail when failing even a single field fails.
Strict Forms fail when failing even a single field fails. This form is used for non-web forms (where the posted form is merely an url-encoded set of form parameters) and will auto-reject requests with a BadRequest.
- object StringParamType extends ParamType
-
object
StringValidations
Reusable validation functions for parameter and body types
- object WebFormFieldExtractor extends FormFieldExtractor