CZ-NIC/yangson

Calling raw_value() method on RootNode fails after merging data

Closed this issue · 1 comments

gusmb commented

I noticed that I can call raw_value() method successfully on RootNode after loading data, but it fails after I merge data into the instance using the merge() method.

instance = model.from_raw(instance_raw)
instance.raw_value()  # works

instance2 = model.from_raw(instance_raw2)
instance3 = instace.merge(instance_raw2)
instance3.raw_value()  # Fails! with Error: ListNode has no attribute type
instance3.value  # works

Not sure what is causing this or if I am doing something wrong. The output of instance3.value correctly shows the merged data.

gusmb commented

Nevermind, just found that I was not using the method correctly. For merging raw data, if I use the raw boolean flag it worked. I was not setting it. What threw me off is that the method returned successfully anyway.