avoiding mutation of schema in mapping generator, cloning schema.tree