Thank you for the reply! However, I am struggling a bit to get this to work.
In your suggestion, it seems like it creates a “fields” property under “foo”, if I understand correctly? That is the same key as the key that specifies a multi field (which is “fields”). Is this on purpose?