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
In 1.15.0, this is properly detected in the generated schema as an integer.
In 1.16.0 (I couldn't get 1.15.1 to run properly), it is incorrectly detected as a string.
The text was updated successfully, but these errors were encountered:
johnthagen
changed the title
Optional type hint support broken
Optional type hint schema generation support broken
Jul 30, 2019
I think you're right, it looks like it was broken in 69b628a by removing the if not inspect.isclass(hint_class) and hasattr(hint_class, '__args__'): check in SerializerMethodFieldInspector. I have a PR coming up.
1.15.1 broke support for
Optional
type hinting schema generation.Optional
was added in Add support for custom and collection type hint classes #272Python versions on which the problem as been reproduced:
To reproduce, create a
Serializer
like:In 1.15.0, this is properly detected in the generated schema as an integer.
In 1.16.0 (I couldn't get 1.15.1 to run properly), it is incorrectly detected as a string.
The text was updated successfully, but these errors were encountered: