mirror of
https://github.com/d3vyce/fastapi-toolsets.git
synced 2026-03-01 17:00:48 +01:00
feat: add optional data field in ApiError (#63)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Base Pydantic schemas for API responses."""
|
||||
|
||||
from enum import Enum
|
||||
from typing import ClassVar, Generic, TypeVar
|
||||
from typing import Any, ClassVar, Generic, TypeVar
|
||||
|
||||
from pydantic import BaseModel, ConfigDict
|
||||
|
||||
@@ -50,6 +50,7 @@ class ApiError(PydanticBase):
|
||||
msg: str
|
||||
desc: str
|
||||
err_code: str
|
||||
data: Any | None = None
|
||||
|
||||
|
||||
class BaseResponse(PydanticBase):
|
||||
@@ -84,7 +85,7 @@ class ErrorResponse(BaseResponse):
|
||||
|
||||
status: ResponseStatus = ResponseStatus.FAIL
|
||||
description: str | None = None
|
||||
data: None = None
|
||||
data: Any | None = None
|
||||
|
||||
|
||||
class Pagination(PydanticBase):
|
||||
|
||||
Reference in New Issue
Block a user