Reference resolution replaces serialized reference objects such as { refId: <ID> } with AST reference objects pointing to the corresponding in-memory AST object. Deserialization creates a new AST rather than modifying the serialized value, preserving unresolved references whose ID is undefined as { ref: undefined }. section 7.3 section 7.6
A practical deserializer resolves references through these steps:
- Detect serialized reference objects separately from AST objects, arrays, and primitive values. section 7.3
- Traverse the serialized AST recursively and construct fresh AST objects for each serialized AST object. section 7.3
- Index each constructed AST object by ID so serialized references can locate their targets. section 7.6
Resolving a rental-price attribute reference
A rental price after discount can refer to the rental price before discount through an encoded wrapper such as { ref: rentalPriceBeforeDiscountAttribute }. After serialization, that relation becomes { refId: "SlLaELvAy0" }; deserialization restores the reference to the in-memory Data Attribute object.
