Skip to content

false-positive warning "Parameter unfilled". #1094

@spikyo

Description

@spikyo

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:

  1. Create a model.
  2. Add a ConfigDict(extra='forbid', validate_by_name=True).
  3. Add a parameter with a name written in snake_case.
  4. Assign this parameter a Field with an alias written in camelCase.
  5. Try to instantiate the model, passing a value for the parameter using its snake_case key.
  6. See the error.

Expected behavior
Parameters should be recognized as filled.

Screenshots
Image
Image

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions