Expand description
API aggregation (DW-061 spec, DP-09 runtime / #237).
Multi-upstream composition, JSONPath/CEL fragment shaping, per-fragment fail-open/closed (decision 10; section 5-Traffic).
§Constraint (decision 10, section 12.1)
The core dataplane never buffers full bodies to support composition – only this plugin’s own fragment transforms, with explicit size caps, touch bodies. Composition stays an extension cost, never a tax on the zero-buffering proxy path everything else uses.
§KrakenD-style aggregation
An aggregation endpoint composes a response from multiple upstreams. Each fragment specifies:
- An upstream reference (service name + path)
- A JSONPath expression to extract a fragment from the upstream response
- A target field in the composed response
- A fail-open/closed policy (fail-open = skip on error, fail-closed = return an error)
The aggregator fetches all fragments in parallel, shapes each, and combines them into a single JSON response.
§Runtime (DP-09, #237)
run_aggregation is the async runtime: it fetches all fragments
in parallel via simple async TCP + HTTP/1.1, shapes each through
JSONPath, and composes the result through the pure compose
function. A ServiceResolver trait abstracts service-to-endpoint
resolution so the runtime can be wired to the dataplane’s current
generation balancers.
§Availability
The module is always compiled into the OSS build.
Structs§
- Aggregation
Spec - An aggregation endpoint spec: composes a response from multiple upstream fragments.
- Fragment
Spec - A single fragment in an aggregation.
- Resolved
Endpoint - A resolved upstream endpoint.
Enums§
- Compose
Result - The result of composing fragments.
- Fail
Policy - The fail policy for a fragment.
- Fragment
Result - The result of fetching a fragment.
Traits§
- Service
Resolver - A service resolver: maps a service name to an upstream endpoint. Implemented by the dataplane (which has the current snapshot’s services + upstreams + balancers).
Functions§
- compose
- Compose a response from fragment results.
- extract_
jsonpath - Extract a value from a JSON document using a simplified JSONPath expression.
- make_
error_ fragment_ result - Create an error fragment result (for when the upstream fetch fails).
- make_
fragment_ result - Create a fragment result from a fetched upstream response.
- run_
aggregation - The async aggregation runtime: fetches all fragments, shapes each, and composes the result.
- shape_
fragment - Shape a fragment: extract the value using the JSONPath expression (if any), otherwise return the document as-is.
- validate_
spec - Validate an aggregation spec.