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
- Source
- Endpoint.scala
- Graph
-
- Supertypes
- Self type
-
Members list
Type members
Types
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Sets the authentication type for this endpoint.
Hides any details of codec errors from the user.
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Returns a new endpoint derived from this one, whose request content is decoded from application/x-www-form-urlencoded data using a zio-schema zio.schema.Schema.
Returns a new endpoint derived from this one, whose request content is decoded from application/x-www-form-urlencoded data using a zio-schema zio.schema.Schema.
Attributes
- Source
- Endpoint.scala
Returns a new endpoint derived from this one, whose request content is decoded from application/x-www-form-urlencoded data using a zio-schema zio.schema.Schema and is documented.
Returns a new endpoint derived from this one, whose request content is decoded from application/x-www-form-urlencoded data using a zio-schema zio.schema.Schema and is documented.
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
Attributes
- Source
- extensions.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Returns a new endpoint that can fail with the specified error type for the specified status code with a custom media type.
Returns a new endpoint that can fail with the specified error type for the specified status code with a custom media type.
Attributes
- Source
- Endpoint.scala
Returns a new endpoint that can fail with the specified error type for the specified status code with a custom media type and is documented.
Returns a new endpoint that can fail with the specified error type for the specified status code with a custom media type and is documented.
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Returns a new endpoint that requires the specified query.
Returns a new endpoint that requires the specified query.
Returns a new endpoint that requires the specified query.
Renders the URL path for this endpoint given the path input values.
Renders the URL path for this endpoint given the path input values.
Example:
val ep = Endpoint(Method.GET / "users" / int("id"))
ep.renderUrl(42) // Right("/users/42")
Attributes
- Source
- Endpoint.scala
Renders the URL path for this endpoint with a base path prefix.
Attributes
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
A list of tags for this endpoint.
Transforms the error of this endpoint using the specified functions.
Transforms the error of this endpoint using the specified functions.
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Transforms the output of this endpoint using the specified functions.
Transforms the output of this endpoint using the specified functions.
Attributes
- Source
- Endpoint.scala
Overrides the HTTP status returned when authentication fails. Defaults to 404 (Not Found) for security. Use Status.Unauthorized for standard 401 behavior.
Overrides the HTTP status returned when authentication fails. Defaults to 404 (Not Found) for security. Use Status.Unauthorized for standard 401 behavior.
Attributes
- Source
- Endpoint.scala
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
- Source
- Endpoint.scala
Attributes
- Source
- Endpoint.scala
Generates a URL for this endpoint given the path input.