You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
called with me <class 'django.contrib.auth.models.User'>
called with both='me <me@me.com>' username='me' email='me@me.com' <class 'myproject.api.UserSchema'>
My guess is the function gets called by Django-ninja and then gets called again by Pydantic, because the name is overloaded. This doesn't seem to be expected/intended. The only way I can see to fix it in my code is to scatter isinstance calls in all my resolvers.
Versions (please complete the following information):
Python version: 3.12
Django version: tried with 5.1.3 and 4.2.15
Django-Ninja version: 1.3.0
Pydantic version: tried with 2.10.1 and 2.8.2
The text was updated successfully, but these errors were encountered:
Describe the bug
Roughly following https://django-ninja.dev/guides/response/django-pydantic/ I am seeing static resolvers called twice, once with the Django model and once with the Pydantic Schema. Consider this schema:
The console output is:
My guess is the function gets called by Django-ninja and then gets called again by Pydantic, because the name is overloaded. This doesn't seem to be expected/intended. The only way I can see to fix it in my code is to scatter
isinstance
calls in all my resolvers.Versions (please complete the following information):
The text was updated successfully, but these errors were encountered: