Access a newly created object in onchange event

I have a json schema like YosemiteSchema - Pastebin.com

It works ok but it has a hierarchy of objects

ie an array of Sites contains an array of Equip which contains an array of points

[Sites] → [Equip] → [Points]

When adding a new site, equip or point I want to set its default attributes.
Todo this I am trying to observe the data changes like so

<json-forms
v-bind:data=“data”
v-bind:renderers=“renderers”
v-bind:schema=“schema”
v-bind:uischema=“uischema”
@change=“onChange”
/>

public onChange(event: JsonFormsChangeEvent) {

console.log(event.data);

}

I onchange how can I detect the type of object being added and access it because event.data seems to be all the newly created json not just the differences.

Hi @glennpierce,

at the moment you only get the whole new object. There is no easy way to being informed on which path a change was triggered.

So you need to check manually for empty objects. As a workaround you could use a diffing library like fast-json-patch