An zio.http.api.EndpointSpec represents an API endpoint for the HTTP
protocol. Every API has an input, which comes from a combination of the
HTTP path, 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.api.EndpointSpec is a purely declarative encoding of an
endpoint, it is possible to use this model to generate a zio.http.App (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.
Converts this API, which is an abstract description of an endpoint, into a
service, which is a concrete implementation of the endpoint. In order to
convert an API into a service, you must specify a function which handles
the input, and returns the output.
Converts this API, which is an abstract description of an endpoint, into a
service, which is a concrete implementation of the endpoint. In order to
convert an API into a service, you must specify a function which handles
the input, and returns the output.
Adds a new element of input to the API, which can come from the portion of
the HTTP path not yet consumed, the query string parameters, or the HTTP
headers of the request.
Adds a new element of input to the API, which can come from the portion of
the HTTP path not yet consumed, the query string parameters, or the HTTP
headers of the request.