When I use my pydantic basic config it only works for ModelIn and others don't
def to_camel(string: str) -> str:
string_split = string.split("_")
return string_split[0] + "".join(word.capitalize() for word in string_split[1:])
class MyConfig(pydantic.BaseConfig):
alias_generator = to_camel
allow_population_by_field_name = True
chat_crud = PiccoloCRUD(
table=Message,
read_only=False,
max_joins=2,
schema_extra={
'pydantic_config_class': MyConfig
}
)
It is convenient for my frontend that every input and output field is in camelCase. As another solution, I could name each field in my Table as camelCase, but then I would have to change my backend structure.
https://github.com/piccolo-orm/piccolo_api/blob/e2f8ce83a29234d0e6a79b4add044be71b904637/piccolo_api/crud/endpoints.py#L294-L304 Why is schema_extra not passed to the following methods as in this method above?
When I use my pydantic basic config it only works for
ModelIn
and others don'tIt is convenient for my frontend that every input and output field is in
camelCase
. As another solution, I could name each field in myTable
as camelCase, but then I would have to change my backend structure.