CamelCaseModel#
- pydantic model safir.pydantic.CamelCaseModel#
pydantic.BaseModel
configured to accept camel-case input.This is a convenience class identical to
BaseModel
except with an alias generator configured so that it can be initialized with either camel-case or snake-case keys. Model exports withmodel_dump
ormodel_dump_json
also default to exporting in camel-case.- Parameters:
data (
Any
) –
Show JSON schema
{ "title": "CamelCaseModel", "description": "`pydantic.BaseModel` configured to accept camel-case input.\n\nThis is a convenience class identical to `~pydantic.BaseModel` except with\nan alias generator configured so that it can be initialized with either\ncamel-case or snake-case keys. Model exports with ``model_dump`` or\n``model_dump_json`` also default to exporting in camel-case.", "type": "object", "properties": {} }
- Config:
alias_generator: function = <function to_camel_case at 0x7fd6c5cebe20>
populate_by_name: bool = True
- model_dump(**kwargs)#
Export the model as a dictionary.
Overridden to change the default of
by_alias
fromFalse
toTrue
, so that by default the exported dictionary uses camel-case.
- model_dump_json(**kwargs)#
Export the model as JSON.
Overridden to change the default of
by_alias
fromFalse
toTrue
, so that by default the exported dictionary uses camel-case.
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}#
A dictionary of computed field names and their corresponding
ComputedFieldInfo
objects.