trait Urls extends algebra.Urls with StatusCodes
algebra.Urls interpreter that decodes and encodes URLs.
- Self Type
- EndpointsWithCustomErrors
- Source
- Urls.scala
- Grouped
- Alphabetic
- By Inheritance
- Urls
- StatusCodes
- StatusCodes
- Urls
- PartialInvariantFunctorSyntax
- InvariantFunctorSyntax
- AnyRef
- Any
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Type Members
- implicit class InvariantFunctorSyntax[A, F[_]] extends AnyRef
Extension methods for values of type
F[A]
for which there is an implicitInvariantFunctor[F]
instance.Extension methods for values of type
F[A]
for which there is an implicitInvariantFunctor[F]
instance.- Definition Classes
- InvariantFunctorSyntax
- implicit class PartialInvariantFunctorSyntax[A, F[_]] extends AnyRef
- Definition Classes
- PartialInvariantFunctorSyntax
- trait Path[A] extends EndpointsWithCustomErrors.Url[A]
- trait QueryString[T] extends AnyRef
- type QueryStringParam[T] = (String, Map[String, Seq[String]]) => Validated[T]
Given a parameter name and a query string content, returns a decoded parameter value of type
T
, orInvalid
if decoding failed - trait Segment[A] extends AnyRef
- type StatusCode = akka.http.scaladsl.model.StatusCode
HTTP Status Code
HTTP Status Code
- Definition Classes
- StatusCodes → StatusCodes
- trait Url[A] extends AnyRef
- implicit class PathOps[A] extends AnyRef
Convenient methods for Paths.
- implicit class QueryStringSyntax[A] extends AnyRef
Extension methods on QueryString.
Extension methods on QueryString.
- Definition Classes
- Urls
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##(): Int
- Definition Classes
- AnyRef → Any
- def ->[B](y: B): (Urls, B)
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def Accepted: Success
- Definition Classes
- StatusCodes → StatusCodes
- def BadRequest: ClientError
- Definition Classes
- StatusCodes → StatusCodes
- Note
You should use the
badRequest
constructor provided by the endpoints.algebra.Responses trait to ensure that errors produced by endpoints are consistently handled by interpreters.
- def Created: Success
- Definition Classes
- StatusCodes → StatusCodes
- def Forbidden: ClientError
- Definition Classes
- StatusCodes → StatusCodes
- def InternalServerError: ServerError
- Definition Classes
- StatusCodes → StatusCodes
- Note
You should use the
internalServerError
constructor provided by the endpoints.algebra.Responses trait to ensure that errors produced by endpoints are consistently handled by interpreters.
- def NoContent: Success
- Definition Classes
- StatusCodes → StatusCodes
- def NotFound: ClientError
- Definition Classes
- StatusCodes → StatusCodes
- def NotImplemented: ServerError
- Definition Classes
- StatusCodes → StatusCodes
- def OK: Success
- Definition Classes
- StatusCodes → StatusCodes
- def Unauthorized: ClientError
- Definition Classes
- StatusCodes → StatusCodes
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- implicit def booleanQueryString: EndpointsWithCustomErrors.QueryStringParam[Boolean]
Query string parameter containing a
Boolean
valueQuery string parameter containing a
Boolean
value- Definition Classes
- Urls
- def chainPaths[A, B](first: EndpointsWithCustomErrors.Path[A], second: EndpointsWithCustomErrors.Path[B])(implicit tupler: Tupler[A, B]): EndpointsWithCustomErrors.Path[Out]
Chains the two paths
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def combineQueryStrings[A, B](first: EndpointsWithCustomErrors.QueryString[A], second: EndpointsWithCustomErrors.QueryString[B])(implicit tupler: Tupler[A, B]): EndpointsWithCustomErrors.QueryString[Out]
Concatenates two
QueryString
s - def convToDirective1(directive: Directive0): Directive1[Unit]
- Attributes
- protected
- implicit def doubleQueryString: EndpointsWithCustomErrors.QueryStringParam[Double]
Codec for query string parameters of type
Double
Codec for query string parameters of type
Double
- Definition Classes
- Urls
- implicit def doubleSegment: EndpointsWithCustomErrors.Segment[Double]
Segment codec for type
Double
Segment codec for type
Double
- Definition Classes
- Urls
- implicit def dummyPathToUrl[A](p: EndpointsWithCustomErrors.Path[A]): EndpointsWithCustomErrors.Url[A]
Implicit conversion to get rid of intellij errors when defining paths.
Implicit conversion to get rid of intellij errors when defining paths. Effectively should not be called.
- Definition Classes
- Urls
- See also
- def ensuring(cond: (Urls) => Boolean, msg: => Any): Urls
- def ensuring(cond: (Urls) => Boolean): Urls
- def ensuring(cond: Boolean, msg: => Any): Urls
- def ensuring(cond: Boolean): Urls
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- def formatted(fmtstr: String): String
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def handleClientErrors(invalid: Invalid): StandardRoute
This method is called by endpoints when decoding a request failed.
This method is called by endpoints when decoding a request failed.
The provided implementation calls
clientErrorsResponse
to complete with a response containing the errors.This method can be overridden to customize the error reporting logic.
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- implicit def intQueryString: EndpointsWithCustomErrors.QueryStringParam[Int]
Ability to define
Int
query string parametersAbility to define
Int
query string parameters- Definition Classes
- Urls
- implicit def intSegment: EndpointsWithCustomErrors.Segment[Int]
Ability to define
Int
path segmentsAbility to define
Int
path segments- Definition Classes
- Urls
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def joinDirectives[T1, T2](dir1: Directive1[T1], dir2: Directive1[T2])(implicit tupler: Tupler[T1, T2]): Directive1[Out]
Simpler alternative to
Directive.&()
methodSimpler alternative to
Directive.&()
method- Attributes
- protected
- implicit def longQueryString: EndpointsWithCustomErrors.QueryStringParam[Long]
Query string parameter containing a
Long
valueQuery string parameter containing a
Long
value- Definition Classes
- Urls
- implicit def longSegment: EndpointsWithCustomErrors.Segment[Long]
Segment containing a
Long
valueSegment containing a
Long
value- Definition Classes
- Urls
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- implicit def optionalQueryStringParam[A](implicit param: EndpointsWithCustomErrors.QueryStringParam[A]): EndpointsWithCustomErrors.QueryStringParam[Option[A]]
Make a query string parameter optional:
Make a query string parameter optional:
path / "articles" /? qs[Option[Int]]("page")
Client interpreters must omit optional query string parameters that are empty. Server interpreters must accept incoming requests whose optional query string parameters are missing. Server interpreters must report a failure for incoming requests whose optional query string parameters are present, but malformed.
- val path: EndpointsWithCustomErrors.Path[Unit]
An empty path.
An empty path.
Useful to begin a path definition:
path / "foo" / segment[Int] /? qs[String]("bar")
- Definition Classes
- Urls
- implicit lazy val pathPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Path]
Provides
xmap
andxmapPartial
operations. - def qs[A](name: String, docs: Documentation)(implicit param: EndpointsWithCustomErrors.QueryStringParam[A]): EndpointsWithCustomErrors.QueryString[A]
Builds a
QueryString
with one parameter. - implicit lazy val queryStringParamPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.QueryStringParam]
Provides
xmap
andxmapPartial
operations. - implicit lazy val queryStringPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.QueryString]
Provides
xmap
andxmapPartial
operations. - def remainingSegments(name: String, docs: Documentation): EndpointsWithCustomErrors.Path[String]
The remaining segments of the path.
- implicit def repeatedQueryStringParam[A, CC[X] <: Iterable[X]](implicit param: EndpointsWithCustomErrors.QueryStringParam[A], factory: Factory[A, CC[A]]): EndpointsWithCustomErrors.QueryStringParam[CC[A]]
Support query string parameters with multiple values:
Support query string parameters with multiple values:
path / "articles" /? qs[List[Long]]("id")
Server interpreters must accept incoming requests where such parameters are missing (in such a case, its value is an empty collection), and report a failure if at least one value is malformed.
- def segment[A](name: String, docs: Documentation)(implicit s: EndpointsWithCustomErrors.Segment[A]): EndpointsWithCustomErrors.Path[A]
A path segment carrying an
A
information - implicit lazy val segmentPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Segment]
Provides
xmap
andxmapPartial
operations. - def staticPathSegment(segment: String): EndpointsWithCustomErrors.Path[Unit]
A path segment whose value is the given
segment
- implicit lazy val stringQueryString: EndpointsWithCustomErrors.QueryStringParam[String]
Ability to define
String
query string parameters - implicit def stringSegment: EndpointsWithCustomErrors.Segment[String]
Ability to define
String
path segments Servers should return an URL-decoded string value, and clients should take an URL-decoded string value. - final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- def tryParseString[A](type: String)(parse: (String) => A): (String) => Validated[A]
- Definition Classes
- Urls
- implicit lazy val urlPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Url]
Provides
xmap
andxmapPartial
operations - def urlWithQueryString[A, B](path: EndpointsWithCustomErrors.Path[A], qs: EndpointsWithCustomErrors.QueryString[B])(implicit tupler: Tupler[A, B]): EndpointsWithCustomErrors.Url[Out]
Builds an URL from the given path and query string
- implicit def uuidQueryString: EndpointsWithCustomErrors.QueryStringParam[UUID]
Ability to define
UUID
query string parametersAbility to define
UUID
query string parameters- Definition Classes
- Urls
- implicit def uuidSegment: EndpointsWithCustomErrors.Segment[UUID]
Ability to define
UUID
path segmentsAbility to define
UUID
path segments- Definition Classes
- Urls
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Deprecated Value Members
- def →[B](y: B): (Urls, B)
- Implicit
- This member is added by an implicit conversion from Urls toArrowAssoc[Urls] performed by method ArrowAssoc in scala.Predef.
- Definition Classes
- ArrowAssoc
- Annotations
- @deprecated
- Deprecated
(Since version 2.13.0) Use
->
instead. If you still wish to display it as one character, consider using a font with programming ligatures such as Fira Code.
Inherited from StatusCodes
Inherited from algebra.StatusCodes
Inherited from algebra.Urls
Inherited from endpoints.PartialInvariantFunctorSyntax
Inherited from endpoints.InvariantFunctorSyntax
Inherited from AnyRef
Inherited from Any
Types
Types introduced by the algebra
Operations
Operations creating and transforming values