qccamapi / models /response.py
patharanor's picture
fix: proved request schema of fastapi
b935292
raw
history blame contribute delete
434 Bytes
from typing import Any
from fastapi.responses import JSONResponse
from pydantic import BaseModel
class Response(BaseModel):
status: int = 500
data: Any = None
error: Any = None
def json(self):
return JSONResponse(
content={
"status": self.status,
"data": self.data,
"error": self.error,
},
status_code=self.status
)