def process_spec(spec_dict):
    """Changes the paths for the spec"""
    root_path = spec_dict['servers'][0]['url']
    path_parts = root_path.split('/')
    path_prefix = path_parts.pop()
    print('Found path prefix: {}'.format(path_prefix))
    new_path = '/'.join(path_parts)
    print('--> new path: {}'.format(new_path))
    spec_dict['servers'][0]['url'] = new_path
    new_paths = {}
    for path in spec_dict['paths']:
        new_key = '/' + path_prefix + path
        print('----> New API path for {} is {}'.format(path, new_key))
        new_paths[new_key] = spec_dict['paths'][path]
    spec_dict['paths'] = new_paths
    for schema in spec_dict['components']['schemas']:
        if 'x-smoacks-create' in spec_dict['components']['schemas'][schema]:
            spec_dict['components']['schemas'][schema]['x-orim-api-prefix'
                ] = path_prefix
