def register_api_doc_endpoints(config, endpoints, base_path='/api-docs'):
    for endpoint in endpoints:
        path = base_path.rstrip('/') + endpoint.path
        config.add_route(endpoint.route_name, path)
        config.add_view(
            endpoint.view,
            route_name=endpoint.route_name,
            renderer=endpoint.renderer)
Create and register pyramid endpoints to service swagger api docs.
dataset/ETHPy150Open striglia/pyramid_swagger/pyramid_swagger/api.py/register_api_doc_endpoints