def build_swagger_12_api_declaration_view(api_declaration_json):
    def view_for_api_declaration(request):
        # Note that we rewrite basePath to always point at this server's root.
        return dict(
            api_declaration_json,
            basePath=str(request.application_url),
        )
    return view_for_api_declaration
Thanks to the magic of closures, this means we gracefully return JSON
dataset/ETHPy150Open striglia/pyramid_swagger/pyramid_swagger/api.py/build_swagger_12_api_declaration_view