Formats output data from internal format to client format.
This module handles the conversion of Ash result data to client-expected format. It works with the full resource schema including attributes, relationships, calculations, and aggregates, then delegates to ValueFormatter for recursive type-aware formatting of nested values.
Key responsibilities:
- Convert internal atom keys to client field names (e.g., :user_id -> "userId")
- Preserve untyped map keys exactly as stored
- Handle complex nested structures with relationships, calculations, aggregates
- Work with ResultProcessor extraction templates
- Handle pagination structures and result data
Summary
Functions
Formats output data from internal format to client format.
Functions
Formats output data from internal format to client format.
Converts internal field names to client format while preserving untyped map keys. Handles the full resource schema including relationships, calculations, and aggregates.
Parameters
data: The result data from Ash (internal format)resource: The Ash resource moduleaction_name: The name of the action that was performedformatter: The field formatter to use for conversion
Returns
The formatted data with internal atom keys converted to client field names, except for untyped map keys which are preserved exactly.