Opened 9 years ago

Last modified 3 years ago

#10536 assigned enhancement

[test case] dojox.json.ref: resolveJson should merge attributes from $ref objects to index instances

Reported by: avoidscorn Owned by:
Priority: high Milestone: 1.15
Component: Dojox Version: 1.4.0
Keywords: Cc:
Blocked By: Blocking:

Description

Suppose we have a partially loaded object in the index, e.g.

index["1"] = {a: 2, _loadObject: ...}

Now, in a subsequent JSON message, the same id is used in another reference, but with different eagerly-provided attributes, e.g.

{$ref: "1", b: 3}

Currently, resolveJson will not add attribute "b" to the instance already in the index, so the information about attribute "b" is essentially lost. I believe it is a common use case to supply references to the same object with different eagerly-provided attributes in each reference.

Attached is a patch to dojox/json/tests/ref.js that includes a small test case for this issue.

Attachments (1)

ref.js.patch (773 bytes) - added by avoidscorn 9 years ago.
Test case patch

Download all attachments as: .zip

Change History (5)

Changed 9 years ago by avoidscorn

Attachment: ref.js.patch added

Test case patch

comment:1 Changed 9 years ago by Adam Peller

Owner: changed from Adam Peller to Kris Zyp

comment:2 Changed 6 years ago by dylan

Milestone: tbd2.0

Patch may be stale, but should consider this for 1.9.

comment:3 Changed 3 years ago by dylan

Milestone: 2.01.12
Owner: Kris Zyp deleted
Status: newassigned
Summary: dojox.json.ref: resolveJson should merge attributes from $ref objects to index instances[test case] dojox.json.ref: resolveJson should merge attributes from $ref objects to index instances

comment:4 Changed 3 years ago by dylan

Milestone: 1.131.15

Ticket planning... move current 1.13 tickets out to 1.15 to make it easier to move tickets into the 1.13 milestone.

Note: See TracTickets for help on using tickets.