eclipse-emfcloud / emfjson-jackson

emfjson-jackson
Other
16 stars 15 forks source link

Reset context parent after deserialisation of array #53

Closed gg-dim closed 2 years ago

gg-dim commented 2 years ago

I have encountered a problem when deserialising arrays that contain arrays.

[
    {
        name="n1",
        b=[
            {
                attr="a11"
            },
            {
                attr="a12"
            }
        ]
    },
    {
        name="n2",
        b=[
            {
                attr="a21"
            },
            {
                attr="a22"
            }
        ]
    }
]

If the Root_Element is of type A and the elements of the containing b are from type B. The deserialisation of the first A element works fine and results in an object of type A but the 2nd A element is deserialised as an object of type B.

Findings: While traversing down the json in the parent is set on the context (EObjectFeatureProperty line 90) but not reset after array end.

Signed-off-by: Guido Grune g.grune@datainmotion.com