'Given a list of all paths, return the common prefix which should be
discounted when generating a schema structure.
This will be the longest common string that does not include that last
component of the URL, or the last component before a path parameter.
For example:
/api/v1/users/
/api/v1/users/{pk}/
The path prefix is \'/api/v1/\''

def determine_path_prefix(self, paths):

    prefixes = []
    for path in paths:
        components = path.strip('/').split('/')
        initial_components = []
        for component in components:
            if ('{' in component):
                break
            initial_components.append(component)
        prefix = '/'.join(initial_components[:(-1)])
        if (not prefix):
            return '/'
        prefixes.append((('/' + prefix) + '/'))
    return common_path(prefixes)
