This commit is contained in:
2026-03-12 12:32:29 +08:00
parent c0f9ddabbf
commit 470446fa6f
18 changed files with 591 additions and 142 deletions

View File

@@ -0,0 +1,15 @@
"""Base schema with camelCase JSON serialization."""
from pydantic import BaseModel, ConfigDict
def to_camel(s: str) -> str:
parts = s.split("_")
return parts[0] + "".join(p.capitalize() for p in parts[1:])
class CamelModel(BaseModel):
model_config = ConfigDict(
from_attributes=True,
alias_generator=to_camel,
populate_by_name=True,
)