File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -590,6 +590,9 @@ def _is_pydantic_serializable(param: inspect.Parameter) -> bool:
590590 if param .annotation == inspect .Parameter .empty :
591591 return True
592592
593+ if "ForwardRef" in repr (param .annotation ):
594+ return True
595+
593596 if isinstance (param .annotation , str ):
594597 return False
595598
@@ -641,7 +644,12 @@ def _generate_schema(
641644 name : (
642645 # 1. We infer the argument type here: use Any rather than None so
643646 # it will not try to auto-infer the type based on the default value.
644- (param .annotation if param .annotation != inspect .Parameter .empty else Any ),
647+ (
648+ param .annotation
649+ if param .annotation != inspect .Parameter .empty
650+ and "ForwardRef" not in repr (param .annotation )
651+ else Any
652+ ),
645653 pydantic .Field (
646654 # 2. We do not support default values for now.
647655 # default=(
You can’t perform that action at this time.
0 commit comments