Object record = newRecord(old, schema);
for (Map.Entry<String, Field> entry : schema.getFields().entrySet()) {
String name = entry.getKey();
Field f = entry.getValue();
JsonNode v = json.get(name);
if (v == null) v = f.defaultValue();
if (v != null) {
Object o = old != null ? getField(old, name, f.pos()) : null;
addField(record, name, f.pos(), defaultFieldValue(o, f.schema(), v));
} else if (old != null) {
removeField(record, name, f.pos());