From 73017935e93cab62634dea1df4f4950258b10ea9 Mon Sep 17 00:00:00 2001 From: Lan Date: Sat, 24 Jan 2026 15:28:17 +0800 Subject: [PATCH] fix: make detail field optional in APIResponse model --- core/response.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/response.py b/core/response.py index e2b4325..8afd494 100644 --- a/core/response.py +++ b/core/response.py @@ -2,7 +2,7 @@ # @Author : Lan # @File : response.py # @Software: PyCharm -from typing import Generic, TypeVar +from typing import Generic, Optional, TypeVar from pydantic import BaseModel @@ -12,4 +12,4 @@ T = TypeVar("T") class APIResponse(BaseModel, Generic[T]): code: int = 200 message: str = "ok" - detail: T + detail: Optional[T] = None