An zio.http.endpoint.Endpoint represents an API endpoint for the HTTP protocol. Every API
has an input, which comes from a combination of the HTTP route, query string parameters, and headers, and an output, which is the data computed by the handler of the API.
MiddlewareInput : Example: A subset of HttpCodec[Input]
that doesn't give access to Input
MiddlewareOutput: Example: A subset of Out[Output]
that doesn't give access to Output
Input: Example: Int Output: Example: User
As zio.http.endpoint.Endpoint is a purely declarative encoding of an endpoint, it is possible to use this model to generate a zio.http.Route (by supplying a handler for the endpoint), to generate OpenAPI documentation, to generate a type-safe Scala client for the endpoint, and possibly, to generate client libraries in other programming languages.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
Members list
Value members
Concrete methods
Returns a new API that is derived from this one, but which includes additional documentation that will be included in OpenAPI generation.
Returns a new API that is derived from this one, but which includes additional documentation that will be included in OpenAPI generation.
Attributes
Returns a new endpoint derived from this one whose middleware is composed from the existing middleware of this endpoint, and the specified middleware.
Returns a new endpoint derived from this one whose middleware is composed from the existing middleware of this endpoint, and the specified middleware.
Attributes
Flattens out this endpoint to a chunk of alternatives. Each alternative is guaranteed to not have any alternatives itself.
Flattens out this endpoint to a chunk of alternatives. Each alternative is guaranteed to not have any alternatives itself.
Attributes
Returns a new endpoint that requires the specified headers to be present.
Returns a new endpoint that requires the specified headers to be present.
Attributes
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema.
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema.
Attributes
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.
Attributes
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.
Attributes
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.
Returns a new endpoint derived from this one, whose request content must satisfy the specified schema and is documented.
Attributes
Returns a new endpoint derived from this one, whose request must satisfy the specified codec.
Returns a new endpoint derived from this one, whose request must satisfy the specified codec.
Attributes
Returns a new endpoint derived from this one, whose input type is a stream of the specified typ.
Returns a new endpoint derived from this one, whose input type is a stream of the specified typ.
Attributes
Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.
Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.
Attributes
Returns a new endpoint derived from this one, whose input type is a stream of the specified type.
Returns a new endpoint derived from this one, whose input type is a stream of the specified type.
Attributes
Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.
Returns a new endpoint derived from this one, whose input type is a stream of the specified type and is documented.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.
Returns a new endpoint derived from this one, whose output type is the specified type for the ok status code and is documented.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code and is documented.
Attributes
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.
Returns a new endpoint derived from this one, whose output type is the specified type for the specified status code.
Attributes
Returns a new endpoint derived from this one, whose response must satisfy the specified codec.
Returns a new endpoint derived from this one, whose response must satisfy the specified codec.
Attributes
Returns a new endpoint that can fail with the specified error type for the specified status code.
Returns a new endpoint that can fail with the specified error type for the specified status code.
Attributes
Returns a new endpoint that can fail with the specified error type for the specified status code and is documented.
Returns a new endpoint that can fail with the specified error type for the specified status code and is documented.
Attributes
Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.
Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.
Attributes
Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.
Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the ok status code.
Attributes
Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the specified status code and is documented.
Returns a new endpoint derived from this one, whose output type is a stream of the specified type for the specified status code and is documented.
Attributes
Returns a new endpoint that requires the specified query.
Returns a new endpoint that requires the specified query.
Attributes
Transforms the error of this endpoint using the specified functions.
Transforms the error of this endpoint using the specified functions.
Attributes
Transforms the input of this endpoint using the specified functions. This is useful to build from different http inputs a domain specific input.
Transforms the input of this endpoint using the specified functions. This is useful to build from different http inputs a domain specific input.
For example
case class ChangeUserName(userId: UUID, name: String)
val endpoint =
Endpoint(Method.POST / "user" / uuid("userId") / "changeName").in[String]
.transformIn { case (userId, name) => ChangeUserName(userId, name) } {
case ChangeUserName(userId, name) => (userId, name)
}
Attributes
Transforms the output of this endpoint using the specified functions.
Transforms the output of this endpoint using the specified functions.
Attributes
Inherited methods
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product