-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Description
Describe the bug
When I define a field in a model with its name in snake_case and its alias in camelCase, I get a false-positive warning that the parameter is unfilled.
To Reproduce
Steps to reproduce the behavior:
- Create a model.
- Add a
ConfigDict(extra='forbid', validate_by_name=True). - Add a parameter with a name written in snake_case.
- Assign this parameter a Field with an alias written in camelCase.
- Try to instantiate the model, passing a value for the parameter using its snake_case key.
- See the error.
Expected behavior
Parameters should be recognized as filled.
Environment (please complete the following information):
OS: macOS Sequoia 15.6.1
IDE: PyCharm 2024.3.5
Pydantic Version: 2.11.7
Question
Am I doing something wrong? Are there any workarounds for this?
richard-havel
Metadata
Metadata
Assignees
Labels
No labels

