fn add_or_merge_attr(data: &mut Map<String, Value>, key: &str, value: Value)