Fix union type hint checks (#318)
Fix some obscure edge cases related to typing.Union type args. Fixes #304.
This commit is contained in:
committed by
Cristi Vîjdea
parent
3d43ee6748
commit
76c8fe0646
@@ -33,6 +33,10 @@ if typing:
|
||||
# Following cases are not 100% correct, but it should work somehow and not crash.
|
||||
(Union[int, float], None),
|
||||
(List, {'type': openapi.TYPE_ARRAY, 'items': openapi.Items(openapi.TYPE_STRING)}),
|
||||
('SomeType', None),
|
||||
(type('SomeType', (object,), {}), None),
|
||||
(None, None),
|
||||
(6, None),
|
||||
])
|
||||
def test_get_basic_type_info_from_hint(hint_class, expected_swagger_type_info):
|
||||
type_info = get_basic_type_info_from_hint(hint_class)
|
||||
|
||||
Reference in New Issue
Block a user