diff --git a/app/common/responses.py b/app/common/responses.py index 3e4db15..830148e 100644 --- a/app/common/responses.py +++ b/app/common/responses.py @@ -9,7 +9,7 @@ import orjson from fastapi import Request from fastapi.responses import RedirectResponse -from pydantic.generics import GenericModel +from pydantic import BaseModel from app.common import json from app.common.errors import ServiceError @@ -17,7 +17,7 @@ T = TypeVar("T") -class Success(GenericModel, Generic[T]): +class Success(BaseModel, Generic[T]): status: Literal["success"] data: T @@ -31,7 +31,7 @@ def success( return json.ORJSONResponse(data, status_code, headers) -class ErrorResponse(GenericModel, Generic[T]): +class ErrorResponse(BaseModel, Generic[T]): status: Literal["error"] error: T message: str