Skip to main content

Module request_binding

Module request_binding 

Source
Expand description

v1.32.0 — The Request Binding Contract (runtime delivery).

An axonendpoint declares body: T (the typed request body) and execute: F (a flow with declared parameters). The contract: the request body’s fields populate F’s parameters — BY NAME (D1).

v1.38.5 extends the binding-source set: path placeholders (/api/users/{id}) and query params declared via query: { name: Type? } join the body as canonical binding sources. The compile-time D3 + D4 check (extending v1.32.0 D2) guarantees every flow parameter resolves to EXACTLY ONE source — collisions are axon-T901 compile errors — so the runtime merge order is semantically irrelevant by construction.

Only DECLARED flow parameters bind (D4): a body field that matches no parameter is NOT silently injected into the interpolation scope, so the compile-time totality check (37.c / D2) stays the single gate on what a ${x} can resolve to — a typo’d ${tenat} is a missing binding, never a silently-empty surprise.

This module is the runtime delivery, consumed by BOTH execution paths — the streaming dispatcher (DispatchCtx.let_bindings) and the synchronous runner (ExecContext) — so an axonendpoint’s transport: sse and transport: json routes bind identically.

Functions§

bind_request
v1.32.0 — Bind a request to a flow’s declared parameters across THREE binding sources: path placeholders (URL captures), query string params, and a parsed JSON body.
bind_request_body
v1.32.0 — Legacy body-only binder. Delegates to bind_request with empty path + empty query maps. Preserved for source backwards-compat with v1.36.0-style callers (test code, non-axon-server programmatic consumers); D5 absolute guarantees the return is byte-identical to the v1.36.0 implementation when path + query are empty.