Use orjson in serializers

This commit is contained in:
2021-11-21 14:45:03 +03:00
parent 9a8b1265cf
commit ef26b979d4
9 changed files with 124 additions and 1 deletions

View File

@@ -2,6 +2,8 @@ from typing import Optional
from pydantic import BaseModel
from app.serializers.orjson_config import ORJSONConfig
class BookAnnotation(BaseModel):
id: int
@@ -9,6 +11,9 @@ class BookAnnotation(BaseModel):
text: str
file: Optional[str]
class Config(ORJSONConfig):
pass
class CreateBookAnnotation(BaseModel):
id: int
@@ -16,9 +21,15 @@ class CreateBookAnnotation(BaseModel):
text: str
file: Optional[str]
class Config(ORJSONConfig):
pass
class UpdateBookAnnotation(BaseModel):
id: int
title: str
text: str
file: Optional[str]
class Config(ORJSONConfig):
pass