Alias Spec
Define virtual fields using path references or JMESPath transforms.
Aliases are virtual attributes defined in the Model Spec that allow you to:
- Reference deeply nested relationships
- Apply lightweight transformations to fields
- Expose computed values for display or filtering
They are read-only, derived fields that do not exist in the database, but are resolved dynamically during query or rendering time.
🔧 Basic Structure
🔑 Keys
| Key | Type | Description |
|---|---|---|
source | string | Dot-notated path to another attribute (can include relationships) |
transform | string | A JMESPath expression used to compute the value |
You can use either source or transform, but not both.
📦 source
Simple alias to an existing field or nested relationship.
Useful when your UI needs a flat field but the data is nested.
🔁 transform
Use a JMESPath expression to apply logic.
Supported functions include:
concat,join,map,sortfilters,exists,contains- And more via JMESPath custom runtime
🧠 Transforms allow you to prepare data for read-heavy UIs without modifying your actual schema.
🧪 Example: Complete Aliases Block
🔎 Where Aliases Are Used
- In View Specs and Entity Specs as displayable fields
- In Filters and Scopes for querying virtual fields
- In Search definitions
- In Transformations for data transformation.