Skip to content

[BUG] Warning about BodyParams shadowing BodyModel #33

@pmdevita

Description

@pmdevita

Describe the bug
A clear and concise description of what the bug is.

Got this warning

/usr/local/lib/python3.12/site-packages/pydantic/_internal/_fields.py:201 UserWarning: Field name "schema" in "BodyParams" shadows an attribute in parent "BodyModel"
warnings.warn(

At a quick glance, this seems to have something to do with the OpenAPI spec generation, given references in our tests.

Versions (please complete the following information):

  • Python version: 3.12
  • Django version: 5.2
  • Django-Ninja version: using the 1.4.0 performance branch
  • Pydantic version: 2.8

Note you can quickly get this by runninng in ./manage.py shell this line:

import django; import pydantic; import ninja; django.__version__; ninja.__version__; pydantic.__version__

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions