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 any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Types
Types introduced by the algebra
- type QueryString[A] = (EndpointsWithCustomErrors.Params) => Validated[A]
A query string carrying an
A
informationA query string carrying an
A
informationQueryString values can be created with the qs operation, and can be combined with the
&
operation:val queryPageAndLang: QueryString[(Int, Option[String])] = qs[Int]("page") & qs[Option[String]]("lang")
- Server interpreters raise an error if they can’t parse the incoming
request query string parameters 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.
- Definition Classes
- Urls → Urls
- Note
This type has implicit methods provided by the QueryStringSyntax, InvariantFunctorSyntax, and the PartialInvariantFunctorSyntax classes.
- Server interpreters raise an error if they can’t parse the incoming
request query string parameters as a value of type
- type StatusCode = Status
HTTP Status Code
HTTP Status Code
- Definition Classes
- StatusCodes → StatusCodes
- type WithDefault[A] = A
This type is necessary to express different perspectives of servers and clients on optional query string parameters with default value:
This type is necessary to express different perspectives of servers and clients on optional query string parameters with default value:
- Client interpreters should define it as
Option[A]
and omit query string parameters with default value that are empty - Server interpreters should define it as
A
and accept incoming requests whose query string parameters with default value are missing, while providing the defined default value - Documentation interpreters should mark the parameter as optional and document the provided default value
- Client interpreters should define it as
Operations
Operations creating and transforming values
- 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
- def Accepted: Status
- Definition Classes
- StatusCodes → StatusCodes
- def AlreadyReported: Status
- Definition Classes
- StatusCodes → StatusCodes
- def BadRequest: Status
- Definition Classes
- StatusCodes → StatusCodes
- Note
You should use the
badRequest
constructor provided by the endpoints4s.algebra.Responses trait to ensure that errors produced by endpoints4s are consistently handled by interpreters.
- def Conflict: Status
- Definition Classes
- StatusCodes → StatusCodes
- def Created: Status
- Definition Classes
- StatusCodes → StatusCodes
- def ExpectationFailed: Status
- Definition Classes
- StatusCodes → StatusCodes
- def FailedDependency: Status
- Definition Classes
- StatusCodes → StatusCodes
- def Forbidden: Status
- Definition Classes
- StatusCodes → StatusCodes
- def Gone: Status
- Definition Classes
- StatusCodes → StatusCodes
- def IMUsed: Status
- Definition Classes
- StatusCodes → StatusCodes
- def InternalServerError: Status
- Definition Classes
- StatusCodes → StatusCodes
- Note
You should use the
internalServerError
constructor provided by the endpoints4s.algebra.Responses trait to ensure that errors produced by endpoints4s are consistently handled by interpreters.
- def LengthRequired: Status
- Definition Classes
- StatusCodes → StatusCodes
- def Locked: Status
- Definition Classes
- StatusCodes → StatusCodes
- def MethodNotAllowed: Status
- Definition Classes
- StatusCodes → StatusCodes
- def MisdirectedRequest: Status
- Definition Classes
- StatusCodes → StatusCodes
- def MultiStatus: Status
- Definition Classes
- StatusCodes → StatusCodes
- def NoContent: Status
- Definition Classes
- StatusCodes → StatusCodes
- def NonAuthoritativeInformation: Status
- Definition Classes
- StatusCodes → StatusCodes
- def NotAcceptable: Status
- Definition Classes
- StatusCodes → StatusCodes
- def NotFound: Status
- Definition Classes
- StatusCodes → StatusCodes
- def NotImplemented: Status
- Definition Classes
- StatusCodes → StatusCodes
- def NotModified: Status
- Definition Classes
- StatusCodes → StatusCodes
- def OK: Status
- Definition Classes
- StatusCodes → StatusCodes
- def PartialContent: Status
- Definition Classes
- StatusCodes → StatusCodes
- def PayloadTooLarge: Status
- Definition Classes
- StatusCodes → StatusCodes
- def PaymentRequired: Status
- Definition Classes
- StatusCodes → StatusCodes
- def PermanentRedirect: Status
- Definition Classes
- StatusCodes → StatusCodes
- def PreconditionFailed: Status
- Definition Classes
- StatusCodes → StatusCodes
- def PreconditionRequired: Status
- Definition Classes
- StatusCodes → StatusCodes
- def ProxyAuthenticationRequired: Status
- Definition Classes
- StatusCodes → StatusCodes
- def RangeNotSatisfiable: Status
- Definition Classes
- StatusCodes → StatusCodes
- def RequestHeaderFieldsTooLarge: Status
- Definition Classes
- StatusCodes → StatusCodes
- def RequestTimeout: Status
- Definition Classes
- StatusCodes → StatusCodes
- def ResetContent: Status
- Definition Classes
- StatusCodes → StatusCodes
- def TemporaryRedirect: Status
- Definition Classes
- StatusCodes → StatusCodes
- def TooEarly: Status
- Definition Classes
- StatusCodes → StatusCodes
- def TooManyRequests: Status
- Definition Classes
- StatusCodes → StatusCodes
- def Unauthorized: Status
- Definition Classes
- StatusCodes → StatusCodes
- def UnavailableForLegalReasons: Status
- Definition Classes
- StatusCodes → StatusCodes
- def UnprocessableEntity: Status
- Definition Classes
- StatusCodes → StatusCodes
- def UnsupportedMediaType: Status
- Definition Classes
- StatusCodes → StatusCodes
- def UpgradeRequired: Status
- Definition Classes
- StatusCodes → StatusCodes
- def UriTooLong: Status
- Definition Classes
- StatusCodes → StatusCodes
- implicit def booleanQueryString: EndpointsWithCustomErrors.QueryStringParam[Boolean]
Query string parameter containing a
Boolean
valueQuery string parameter containing a
Boolean
value- Definition Classes
- Urls
- 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]
Path segment codec for type
Double
Path segment codec for type
Double
- Definition Classes
- Urls
- 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]
Path segment codec for type
Int
Path segment codec for type
Int
- Definition Classes
- Urls
- 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]
Path segment codec for type
Long
Path segment codec for type
Long
- Definition Classes
- Urls
- def optQsWithDefault[A](name: String, default: A, docs: Documentation = None)(implicit value: EndpointsWithCustomErrors.QueryStringParam[A]): EndpointsWithCustomErrors.QueryString[EndpointsWithCustomErrors.WithDefault[A]]
Builds a
QueryString
with one optional parameter, which has a default value. - 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, and they must report a failure for incoming requests whose optional query string parameters are present, but malformed,
- Documentation interpreters should mark the parameter as optional.
- 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
- def qs[A](name: String, docs: Documentation = None)(implicit value: EndpointsWithCustomErrors.QueryStringParam[A]): EndpointsWithCustomErrors.QueryString[A]
Builds a
QueryString
with one parameter. - def remainingSegments(name: String = "", docs: Documentation = None): 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 = None)(implicit A: EndpointsWithCustomErrors.Segment[A]): EndpointsWithCustomErrors.Path[A]
A path segment carrying an
A
information - def staticPathSegment(segment: String): EndpointsWithCustomErrors.Path[Unit]
A path segment whose value is the given
segment
- implicit def stringQueryString: EndpointsWithCustomErrors.QueryStringParam[String]
Ability to define
String
query string parameters - implicit def stringSegment: EndpointsWithCustomErrors.Segment[String]
Path segment codec for type
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]
Path segment codec for type
UUID
Path segment codec for type
UUID
- Definition Classes
- Urls
Ungrouped
- 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
- abstract type Effect[A]
- type Params = Map[String, Seq[String]]
- trait Path[A] extends EndpointsWithCustomErrors.Url[A]
- trait QueryStringParam[A] extends AnyRef
- trait Segment[A] extends AnyRef
- trait Url[A] extends AnyRef
- 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 combineQueryStrings[A, B](first: EndpointsWithCustomErrors.QueryString[A], second: EndpointsWithCustomErrors.QueryString[B])(implicit tupler: Tupler[A, B]): EndpointsWithCustomErrors.QueryString[Out]
Concatenates two
QueryString
s - implicit def pathPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Path]
Provides
xmap
andxmapPartial
operations. - implicit def queryStringParamPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.QueryStringParam]
Provides
xmap
andxmapPartial
operations. - implicit def queryStringPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.QueryString]
Provides
xmap
andxmapPartial
operations. - implicit def segmentPartialInvariantFunctor: PartialInvariantFunctor[EndpointsWithCustomErrors.Segment]
Provides
xmap
andxmapPartial
operations. - implicit def 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
- val utf8Name: String