Skip to content

[BUG] pydantics MISSING sentinel is not handled #1655

@Ksauder

Description

@Ksauder

Describe the bug

I'm experimenting with the use of the MISSING sentinel added in pydantic 2.12. I ran into an issue during serialization where a default value could not be created for the sentinel which is triggered by the overriding of default_schema since the MISSING sentinel is not treated as a no-op.

I'm not sure the custom generator or method are needed, at least not for the allOf piece since I believe that changed in openapi schema v3.1, but I didn't trace all of that down. It may still be needed to handle how default factories and callables are handled.

Versions (please complete the following information):

  • Python version: 3.12.12
  • Django version: 5.28
  • Django-Ninja version: 1.5.0
  • Pydantic version: 2.12.4

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