Response Mapping
Response mapping is defining how fields from one or more upstream API responses are selected, renamed, and placed into a new output structure. Each mapping rule connects a source path, such as customer.email from a billing step, to a target path in the client response.
Technical Architecture & Deep-Dive
Mappings are the declarative heart of API composition. Instead of writing imperative glue code, you describe the desired output: `profile.name` comes from the users step, `plan` from the billing step, `lastInvoice` from the invoices step.
Declarative mappings are easier to review, version, and change than custom code, and they let low-code teams build tailored endpoints. Edge pipelines evaluate mappings after upstream calls complete, returning only the mapped fields.
Key Architectural Benefits
Declarative Output Mapping
{
"fields": [
{ "targetPath": "name", "sourceStep": "user", "sourcePath": "data.full_name" },
{ "targetPath": "plan", "sourceStep": "billing", "sourcePath": "subscription.plan.id" }
]
}Map API Responses Without Code
Pick fields from any upstream step and assemble a clean JSON contract for your client.
Frequently Asked Questions
Q:Can response mapping rename fields?
Yes. Renaming is a core use case, such as mapping snake_case upstream fields to camelCase keys expected by a JavaScript client.
Related Architecture Concepts
API composition is a pattern where a composer layer calls multiple upstream services, then combines and transforms their results into a single response. It lets clients retrieve data owned by different systems, such as a CRM and a billing provider, through one request.
JSON Projection is the declarative extraction, transformation, and renaming of specific nested properties from upstream API payloads into a clean target schema. Executed at the edge without unsafe eval() functions, it delivers lightweight, structured JSON tailored to client UI components.
Response normalization is transforming API responses from different sources into a single consistent structure. It standardizes field names, date formats, data types, and missing value handling so client code can rely on one predictable shape regardless of the upstream provider.
Ready-to-Use Edge Recipes
To solve transform and rename nested json keys without writing code, never execute unauthenticated requests or embed private tokens directly in client bundles. RealComposer acts as a sub-10ms edge gateway running on Cloudflare Workers that securely injects credentials from your Secret Vault, normalizes responses, and prevents unauthorized API usage. Route calls through your RealComposer edge URL to guarantee complete privacy, robust origin validation, and low mobile latency.
You do not need to spin up an Express, FastAPI, or Docker microservice just to stitch REST APIs together. RealComposer fetches multiple upstream endpoints concurrently at the edge, injects private credentials, and combines the responses into a single JSON schema with sub-10ms response times.