Skip to content

Commit 7301793

Browse files
committed
fix: make detail field optional in APIResponse model
1 parent a35b3c8 commit 7301793

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/response.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# @Author : Lan
33
# @File : response.py
44
# @Software: PyCharm
5-
from typing import Generic, TypeVar
5+
from typing import Generic, Optional, TypeVar
66

77
from pydantic import BaseModel
88

@@ -12,4 +12,4 @@
1212
class APIResponse(BaseModel, Generic[T]):
1313
code: int = 200
1414
message: str = "ok"
15-
detail: T
15+
detail: Optional[T] = None

0 commit comments

Comments
 (0)