|
from pydantic import BaseModel, ConfigDict
|
|
|
|
|
|
def _to_camel(s: str) -> str:
|
|
head, *tail = s.split("_")
|
|
return head + "".join(w.capitalize() for w in tail)
|
|
|
|
|
|
class CamelModel(BaseModel):
|
|
model_config = ConfigDict(populate_by_name=True, alias_generator=_to_camel)
|