CONVERT SCHEMA FROM 5.x to 1.x
    :param schema:
    :return:

def retro_schema(schema):
    """
    CONVERT SCHEMA FROM 5.x to 1.x
    :param schema:
    :return:
    """
    output = wrap({
        "mappings":{
            typename: {
                "dynamic_templates": [
                    retro_dynamic_template(*(t.items()[0]))
                    for t in details.dynamic_templates
                ],
                "properties": retro_properties(details.properties)
            }
            for typename, details in schema.mappings.items()
        },
        "settings": schema.settings
    })
    return output