fix: make detail field optional in APIResponse model
This commit is contained in:
+2
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user