From aa55ecf40c67dfe3b01afdf4f5572e98ae8ce1a7 Mon Sep 17 00:00:00 2001 From: Rahul Rao Date: Tue, 14 Jul 2026 22:36:53 +0530 Subject: [PATCH] fix: pass include/exclude/by_alias params to jsonable_encoder when no response_model --- fastapi/routing.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/fastapi/routing.py b/fastapi/routing.py index c442b122b..7e3d12794 100644 --- a/fastapi/routing.py +++ b/fastapi/routing.py @@ -330,7 +330,15 @@ async def serialize_response( ) else: - return jsonable_encoder(response_content) + return jsonable_encoder( + response_content, + include=include, + exclude=exclude, + by_alias=by_alias, + exclude_unset=exclude_unset, + exclude_defaults=exclude_defaults, + exclude_none=exclude_none, + ) async def run_endpoint_function(