Skip to content

Schema

Schemas for chat app.

CreateMessageRespondSchema (BaseModel) pydantic-model

Create message response schema.

Source code in chat/schema.py
class CreateMessageRespondSchema(BaseModel):
    """Create message response schema."""

    message: str

CreateMessageSchema (BaseModel) pydantic-model

Create message schema.

Source code in chat/schema.py
class CreateMessageSchema(BaseModel):
    """Create message schema."""

    content: str

    recipient_id: UUID

MessageSchema (MessageSchema) pydantic-model

Message schema.

Source code in chat/schema.py
class MessageSchema(ModelSchema):
    """Message schema."""

    class Config:
        """Message schema config."""

        model = Message
        model_exclude = ("room",)

Last update: 2023-06-09
Authors: Mohamed-Kaizen