New api: generate mappings from a descriptor object

Not ready to merge
why? You can be direct?