=http =doc, fixes #16113 - fix some spray references in scaladoc
This commit is contained in:
parent
ebb915ae4d
commit
5c205f7c1c
2 changed files with 9 additions and 9 deletions
|
|
@ -15,7 +15,7 @@ import akka.japi.function.{ Function2, Function }
|
|||
abstract class MiscDirectives extends MethodDirectives {
|
||||
/**
|
||||
* Returns a Route which checks the given condition on the request context before running its inner Route.
|
||||
* If the condition fails the route is rejected with a [[spray.routing.ValidationRejection]].
|
||||
* If the condition fails the route is rejected with a [[akka.http.scaladsl.server.ValidationRejection]].
|
||||
*/
|
||||
@varargs
|
||||
def validate(check: Function[RequestContext, JBoolean], errorMsg: String, innerRoute: Route, moreInnerRoutes: Route*): Route =
|
||||
|
|
@ -23,7 +23,7 @@ abstract class MiscDirectives extends MethodDirectives {
|
|||
|
||||
/**
|
||||
* Returns a Route which checks the given condition before running its inner Route. If the condition fails the
|
||||
* route is rejected with a [[spray.routing.ValidationRejection]].
|
||||
* route is rejected with a [[akka.http.scaladsl.server.ValidationRejection]].
|
||||
*/
|
||||
@varargs
|
||||
def validate[T](value: RequestVal[T], check: Function[T, JBoolean], errorMsg: String, innerRoute: Route, moreInnerRoutes: Route*): Route =
|
||||
|
|
@ -33,7 +33,7 @@ abstract class MiscDirectives extends MethodDirectives {
|
|||
|
||||
/**
|
||||
* Returns a Route which checks the given condition before running its inner Route. If the condition fails the
|
||||
* route is rejected with a [[spray.routing.ValidationRejection]].
|
||||
* route is rejected with a [[akka.http.scaladsl.server.ValidationRejection]].
|
||||
*/
|
||||
@varargs
|
||||
def validate[T1, T2](value1: RequestVal[T1],
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ trait HeaderDirectives {
|
|||
/**
|
||||
* Extracts an HTTP header value using the given function. If the function result is undefined for all headers the
|
||||
* request is rejected with an empty rejection set. If the given function throws an exception the request is rejected
|
||||
* with a [[spray.routing.MalformedHeaderRejection]].
|
||||
* with a [[akka.http.scaladsl.server.MalformedHeaderRejection]].
|
||||
*/
|
||||
def headerValue[T](f: HttpHeader ⇒ Option[T]): Directive1[T] = {
|
||||
val protectedF: HttpHeader ⇒ Option[Either[Rejection, T]] = header ⇒
|
||||
|
|
@ -41,20 +41,20 @@ trait HeaderDirectives {
|
|||
|
||||
/**
|
||||
* Extracts the value of the first HTTP request header with the given name.
|
||||
* If no header with a matching name is found the request is rejected with a [[spray.routing.MissingHeaderRejection]].
|
||||
* If no header with a matching name is found the request is rejected with a [[akka.http.scaladsl.server.MissingHeaderRejection]].
|
||||
*/
|
||||
def headerValueByName(headerName: Symbol): Directive1[String] = headerValueByName(headerName.name)
|
||||
|
||||
/**
|
||||
* Extracts the value of the HTTP request header with the given name.
|
||||
* If no header with a matching name is found the request is rejected with a [[spray.routing.MissingHeaderRejection]].
|
||||
* If no header with a matching name is found the request is rejected with a [[akka.http.scaladsl.server.MissingHeaderRejection]].
|
||||
*/
|
||||
def headerValueByName(headerName: String): Directive1[String] =
|
||||
headerValue(optionalValue(headerName.toLowerCase)) | reject(MissingHeaderRejection(headerName))
|
||||
|
||||
/**
|
||||
* Extracts the first HTTP request header of the given type.
|
||||
* If no header with a matching type is found the request is rejected with a [[spray.routing.MissingHeaderRejection]].
|
||||
* If no header with a matching type is found the request is rejected with a [[akka.http.scaladsl.server.MissingHeaderRejection]].
|
||||
*/
|
||||
def headerValueByType[T <: HttpHeader](magnet: ClassMagnet[T]): Directive1[T] =
|
||||
headerValuePF(magnet.extractPF) | reject(MissingHeaderRejection(magnet.runtimeClass.getSimpleName))
|
||||
|
|
@ -63,7 +63,7 @@ trait HeaderDirectives {
|
|||
/**
|
||||
* Extracts an optional HTTP header value using the given function.
|
||||
* If the given function throws an exception the request is rejected
|
||||
* with a [[spray.routing.MalformedHeaderRejection]].
|
||||
* with a [[akka.http.scaladsl.server.MalformedHeaderRejection]].
|
||||
*/
|
||||
def optionalHeaderValue[T](f: HttpHeader ⇒ Option[T]): Directive1[Option[T]] =
|
||||
headerValue(f).map(Some(_): Option[T]).recoverPF {
|
||||
|
|
@ -74,7 +74,7 @@ trait HeaderDirectives {
|
|||
/**
|
||||
* Extracts an optional HTTP header value using the given partial function.
|
||||
* If the given function throws an exception the request is rejected
|
||||
* with a [[spray.routing.MalformedHeaderRejection]].
|
||||
* with a [[akka.http.scaladsl.server.MalformedHeaderRejection]].
|
||||
*/
|
||||
def optionalHeaderValuePF[T](pf: PartialFunction[HttpHeader, T]): Directive1[Option[T]] =
|
||||
optionalHeaderValue(pf.lift)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue