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
Members list
Type members
Types
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
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
Hides any details of codec errors from the user.
Hides any details of codec errors from the user.
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 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 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
Converts a codec error into a specific error type. The given media types are sorted by q-factor. Beginning with the highest q-factor.
Converts a codec error into a specific error type. The given media types are sorted by q-factor. Beginning with the highest q-factor.
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 that requires the specified headers to be part of the response.
Returns a new endpoint that requires the specified headers to be part of the response.
Attributes
Returns a new endpoint that requires the specified headers to be part of the response.
Returns a new endpoint that requires the specified headers to be part of the response.
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
Returns a new endpoint that requires the specified query.
Returns a new endpoint that requires the specified query.
Attributes
Returns a new endpoint that requires the specified query.
Returns a new endpoint that requires the specified query.
Attributes
Adds tags to the endpoint. They are used for documentation generation. For example to group endpoints for OpenAPI.
Adds tags to the endpoint. They are used for documentation generation. For example to group endpoints for OpenAPI.
Attributes
A list of tags for this endpoint.
A list of tags for this endpoint.
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
Generates a URL for this endpoint given the base path and the path input.
Generates a URL for this endpoint given the base path and the path input.
Attributes
Generates a URL for this endpoint given the path input.
Generates a URL for this endpoint given the path input.