Open d3cryptofc opened 3 weeks ago
I discovered that unlike pydantic.Field
, odmantic.Field
accepts non-literals in the default
parameter, so default_factory
becomes useless. But I'll leave the issue open in case anyone wants to work on it, even if it means adding a warning.
Bug
When defining fields with a
default
parameter, themodel_validate_doc
function works as it should, but when usingdefault_factory
the function treats it as a mandatory field.Current Behavior
Expected behavior
Environment
python -c "import pydantic.utils; print(pydantic.utils.version_info())
):