Describe the bug
Our check at
|
if not inspect.isclass(arg_hint) or arg_hint is inspect.Parameter.empty: |
that does
inspect.isclass is
False for
typing.Optional (which is an alias for
typing.Union). Remove that check. And make sure to write a test accepting an optional parameter (ideally using a Pydantic model as the inner optional value since this is what was originally reported).