New api: generate mappings from a descriptor object

Not ready to merge
Only build string if necessary, not for every case (error is an edge case)