app/api/v1/schemas/comments.py: from pydantic import BaseModel class CommentsBase(BaseModel): text: str class Comments(CommentsBase): id: int post_id: int class Config: orm_mode = True