Union typing on model property #284
Labels
bug
Something isn't working
fix confirmation pending
issue has been fixed and confirmation from issue reporter is pending
Describe the bug
The resolve_type_hint method inside plumbing.py does not recognize a hint in form:
because the resolve_type_hint checks specifically for
isinstance(None, args[1])
.on line 834.
so the same method with switched types in Union does work as expected
Using
Python 3.9
drf-spectacular == 0.13.1
djangorestframework == 3.12.2
Expected behavior
I would assume that the order of types in Union does not matter as Python documentation says.
https://docs.python.org/3/library/typing.html#typing.Union
The text was updated successfully, but these errors were encountered: