From fe49c85e9e8833066a911c188e67f916a698ea78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20S=C3=A1nchez=20Castro?= <72013291+JavierSanchezCastro@users.noreply.github.com> Date: Mon, 24 Nov 2025 01:11:00 +0100 Subject: [PATCH] Remove self-inclusion assertion for APIRouter --- fastapi/routing.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index 3bd0e33f4..d7a585df1 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -1339,10 +1339,6 @@ class APIRouter(routing.Router): app.include_router(internal_router) ``` """ - assert self is not router, ( - "Cannot include the same APIRouter instance into itself. " - "Did you mean to include a different router?" - ) if prefix: assert prefix.startswith("/"), "A path prefix must start with '/'" assert not prefix.endswith("/"), (