New api: generate mappings from a descriptor object

Cache this to avoid generating it for each call