mirror of
https://github.com/flibusta-apps/book_library_server.git
synced 2025-12-06 15:15:36 +01:00
Use orjson in serializers
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user