Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ModelSchema produces id > (integer | null) openapi #1160

Open
viktorvsk opened this issue May 10, 2024 · 1 comment
Open

[BUG] ModelSchema produces id > (integer | null) openapi #1160

viktorvsk opened this issue May 10, 2024 · 1 comment

Comments

@viktorvsk
Copy link

viktorvsk commented May 10, 2024

Describe the bug

Having this model definition:

class MyModel(ModelSchema):
    class Meta:
        model = MyModel
        fields = ["id"]

Produces next definition on Swagger: id > (integer | null).

However this definition:

class MyModel(ModelSchema):
    id: int
    class Meta:
        model = MyModel

Produces id* integer as expected. SQL is default — id bigint NOT NULL

Versions (please complete the following information):

  • Python version: 3.12.2
  • Django version: 5.0.2
  • Django-Ninja version: 1.1.0
  • Pydantic version: 2.6.4

Probably a duplicate of #907

@pmdevita
Copy link

pmdevita commented May 14, 2024

What does your MyModel orm model look like?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants