yeah, my example above doesn't cater for all cases (such as entity arrays). I think I need to spike this properly. As you say the data object might need to be our own object that implements recursive `#to_hash` properly.