zio.blocks.endpoint
Members list
Type members
Classlikes
Endpoint-local adapter for fallback output shapes.
Endpoint-local adapter for fallback output shapes.
The endpoint AST stores one abstraction that can be backed by either zio.blocks.combinators.Eithers on all Scala versions or zio.blocks.combinators.Unions on Scala 3. This keeps HttpCodec.Fallback and auth/error composition platform-agnostic while still delegating all combine / separate logic to the combinators block library.
Attributes
- Companion
- object
- Source
- Alternator.scala
- Supertypes
Attributes
- Companion
- trait
- Source
- Alternator.scala
- Supertypes
- Self type
-
Alternator.type
Attributes
- Companion
- trait
- Source
- AuthType.scala
- Supertypes
- Self type
-
AuthType.type
Authentication scheme descriptor aligned with zio-http's typed auth model.
Authentication scheme descriptor aligned with zio-http's typed auth model.
When authentication fails, the default response status is Status.NotFound rather than Status.Unauthorized. This is an intentional security pattern (information hiding) that avoids revealing whether a protected resource exists. Override unauthorizedStatus with withUnauthorizedStatus if you want standard 401 Unauthorized behavior instead.
Attributes
- Companion
- object
- Source
- AuthType.scala
- Supertypes
- Known subtypes
- Self type
This object was generated by sbt-buildinfo.
This object was generated by sbt-buildinfo.
Attributes
- Source
- BuildInfo.scala
- Supertypes
-
trait Singletontrait Producttrait Mirrortrait Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
- Self type
-
BuildInfo.type
Attributes
- Companion
- trait
- Source
- HttpCodec.scala
- Supertypes
- Self type
-
CodecKind.type
Phantom type for codec direction.
Phantom type for codec direction.
Attributes
- Companion
- object
- Source
- HttpCodec.scala
- Supertypes
- Known subtypes
Attributes
- Companion
- class
- Source
- Endpoint.scala
- Supertypes
- Self type
-
Endpoint.type
Top-level endpoint descriptor. Combines a route pattern with input/output/error HTTP codecs, authentication, and documentation.
Top-level endpoint descriptor. Combines a route pattern with input/output/error HTTP codecs, authentication, and documentation.
Pure data — no implement* methods, no Invocation, no codec errors.
Choosing an out overload — pick the row matching what the response needs:
| want status? | want media-type? | call |
|-----------------------|------------------|--------------------------------------|
| no (defaults to 200) | no | out(schema) |
| no (defaults to 200) | no (+ docs) | out(schema, doc) |
| yes | no | out(status, schema) |
| no (defaults to 200) | yes | out(mediaType, schema) |
| yes (+ docs) | no (+ docs) | out(status, schema, doc) |
| no (defaults to 200) | yes (+ docs) | out(mediaType, schema, doc) |
| yes | yes | out(status, mediaType, schema) |
| yes (+ docs) | yes (+ docs) | out(status, mediaType, schema, doc) |
| (already a codec) | (already a codec)| out(codec) |
Only the out(schema) / out(schema, doc) / out(mediaType, ...) rows default the status to 200 Ok; every overload that takes an explicit status uses exactly that status. The outError / orOutError overloads mirror these rows but always require an explicit status (errors never default to Ok).
Attributes
- Companion
- object
- Source
- Endpoint.scala
- Supertypes
Attributes
- Source
- EndpointUnionErrorBuilder.scala
- Supertypes
- Self type
Composable typed descriptor for HTTP request/response parts.
Composable typed descriptor for HTTP request/response parts.
Most nodes are plain data carrying schemas plus endpoint metadata directly on the atom (doc, examples, deprecated) instead of wrapping in extra annotation layers. Typed header and auth helpers reuse Schema.transform so the descriptor can keep exposing Schema[A] for parsed header values without introducing dedicated interpreter-only AST nodes.
Attributes
- Companion
- object
- Source
- HttpCodec.scala
- Supertypes
- Known subtypes
- Self type
-
Attributes
- Companion
- trait
- Source
- HttpCodec.scala
- Supertypes
- Self type
-
HttpCodec.type
Composable path descriptor. Segments are combined with / or ++, literal alternatives with orElse. Use decode / format for bidirectional path conversion, and alternatives to expand orElse branches for routing-trie insertion.
Composable path descriptor. Segments are combined with / or ++, literal alternatives with orElse. Use decode / format for bidirectional path conversion, and alternatives to expand orElse branches for routing-trie insertion.
Attributes
- Companion
- object
- Source
- PathCodec.scala
- Supertypes
- Known subtypes
- Self type
-
PathCodec[A]
Attributes
- Companion
- trait
- Source
- PathCodec.scala
- Supertypes
- Self type
-
PathCodec.type
Attributes
- Companion
- class
- Source
- RoutePattern.scala
- Supertypes
- Self type
-
RoutePattern.type
HTTP method paired with a typed path pattern. The primary constructor is Method.GET / "users" / PathCodec.int("id"). Use alternatives to expand orElse branches, RoutePattern.any(Method) or RoutePattern.any for catch-all trailing routes, and nest to prepend a path prefix.
HTTP method paired with a typed path pattern. The primary constructor is Method.GET / "users" / PathCodec.int("id"). Use alternatives to expand orElse branches, RoutePattern.any(Method) or RoutePattern.any for catch-all trailing routes, and nest to prepend a path prefix.
Attributes
- Companion
- object
- Source
- RoutePattern.scala
- Supertypes
Attributes
- Companion
- class
- Source
- RouteTree.scala
- Supertypes
- Self type
-
RouteTree.type
Routing trie keyed by HTTP method, then by path segments. Literals are matched first, then dynamic segments in priority order (int > long > uuid > bool > string > combined > trailing). HEAD requests fall back to GET handlers. Merge prefers right-hand-side values on conflict.
Routing trie keyed by HTTP method, then by path segments. Literals are matched first, then dynamic segments in priority order (int > long > uuid > bool > string > combined > trailing). HEAD requests fall back to GET handlers. Merge prefers right-hand-side values on conflict.
Trailing fallback: when the path segments are exhausted at a level with no exact value, lookup falls through to a Trailing branch below that level — so a trailing route also matches its own prefix path (a /assets/... route matches /assets), and it shadows a missing exact match at that level. This is intentional (a trailing route is a prefix catch-all by design): register exact routes alongside trailing ones when both must coexist. Literals are still tried first at every level that has segments left, and per-branch matching itself never allocates (see SegmentCodec.matches).
Attributes
- Companion
- object
- Source
- RouteTree.scala
- Supertypes
- Self type
-
RouteTree[A]
Typed descriptor for a single URL path segment. Subtypes include Literal, Int, String, Combined (intra-segment composition via ~), and Trailing (captures remaining path).
Typed descriptor for a single URL path segment. Subtypes include Literal, Int, String, Combined (intra-segment composition via ~), and Trailing (captures remaining path).
Combine representation first, then transform: ~ composes only physical SegmentCodec structure, while transform / transformOrFail lift the segment into a PathCodec (making ~ unavailable afterwards — a transformed wire codec is a domain value, not intra-segment structure).
Attributes
- Companion
- object
- Source
- SegmentCodec.scala
- Supertypes
- Known subtypes
- Self type
-
SegmentCodec[A]
Attributes
- Companion
- trait
- Source
- SegmentCodec.scala
- Supertypes
- Self type
-
SegmentCodec.type
A single level of the routing trie. literals holds exact-match branches, others holds dynamic segment branches keyed by SegmentCodec.Key and ordered by match priority.
A single level of the routing trie. literals holds exact-match branches, others holds dynamic segment branches keyed by SegmentCodec.Key and ordered by match priority.
Attributes
- Companion
- object
- Source
- RouteTree.scala
- Supertypes
- Self type
Attributes
- Companion
- class
- Source
- RouteTree.scala
- Supertypes
- Self type
-
SegmentSubtree.type
Value members
Concrete methods
Defines a group of HTTP endpoints in a single block and returns them as a statically-typed scala.NamedTuple.
Defines a group of HTTP endpoints in a single block and returns them as a statically-typed scala.NamedTuple.
Each statement in the block must be either:
val name = Endpoint(...)— exposed as member.name- a bare
Endpoint(...)expression — auto-named from its route render, e.g..`GET /user/{userId}`(RFC 6570{var}style, method prefix, multi-method rendered asGET#|POST)
Constant-prefix nesting ("api" / endpoints { ... }) composes prefixes into every child route at the description level. Capturing prefixes (PathCodec.int("id") / endpoints { ... }) additionally widen each child's static PathInput.
Value parameters
- body
-
the block of endpoint declarations; every statement must be an
Endpoint(...)construction, optionally bound to aval
Attributes
- Returns
-
a
NamedTuple[Names, Values]pairing each declared name with its fully-typedEndpoint - Note
-
Scala 3.7+ only (named tuples); prefix grouping (
"api" / endpoints { ... }orPathCodec.int("id") / endpoints { ... }) is available viaimport zio.blocks.endpoint.*(no extra import required). - Source
- EndpointGroupSyntax.scala
Extensions
Extensions
Symbolic alias for nest — codec / endpoints { ... }.
Prefix a bulk group with a capturing path codec — named alias for /.
Prefix a bulk group with a capturing path codec — named alias for /.
Value parameters
- nt
-
the
endpoints { ... }group
Attributes
- Returns
-
the same group with
codec's segment prepended to every leaf; staticPathInputis widened positionally (e.g.Intprefix +Intchild yields(Int, Int)) - Source
- EndpointGroupSyntax.scala