From 8a0a360505b1c147be856aac6ec7a68f405e4bce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez=20Castro?= <72013291+JavierSanchezCastro@users.noreply.github.com> Date: Thu, 11 Apr 2024 10:16:50 +0100 Subject: [PATCH] Update routing.py --- fastapi/routing.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fastapi/routing.py b/fastapi/routing.py index fa1351859..8842745bd 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -1204,6 +1204,7 @@ class APIRouter(routing.Router): app.include_router(internal_router) ``` """ + assert self != router, "Router cannot be the same as parent" if prefix: assert prefix.startswith("/"), "A path prefix must start with '/'" assert not prefix.endswith(