I wanted to do the exact same thing, but couldn’t find anything to do it. We’ve hacked it in for now using our own custom module that listens to the api.hydrate.post event (it also does a lot of other data prep and population, so was needed anyway).
In theory, it wouldn’t be too hard to build a generic module that takes some kind of expression to evaluate and populate on hydrate.