Allow author to be an arbitrary field
All checks were successful
Build and Publish college-bot-v2 / build_and_publish (push) Successful in 15s

This commit is contained in:
Nexus 2024-06-09 16:21:12 +01:00
parent 3e37e38e79
commit a9126fd123

View file

@ -22,7 +22,7 @@ class TruthPayload(BaseModel):
"""Represents a truth. This can be used to both create and get truths.""" """Represents a truth. This can be used to both create and get truths."""
id: str id: str
content: str content: str
author: typing.Literal["trump", "tate"] = Field(pattern=r"^(trump|tate)$") author: str
timestamp: float = Field(default_factory=time.time, ge=0) timestamp: float = Field(default_factory=time.time, ge=0)
extra: typing.Optional[JSON] = None extra: typing.Optional[JSON] = None
"""Any extra information, JSON compliant, can be entered here.""" """Any extra information, JSON compliant, can be entered here."""