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
if hasattr(param_type, "__origin__"):
if param_type.__origin__ is list or param_type.__origin__ is List:
properties["type"] = "array"
# 处理列表中的元素类型
if hasattr(param_type, "__args__") and param_type.__args__:
item_type = param_type.__args__[0]
properties["items"] = self.get_schema_object(f"{parameter}_item", item_type)
return properties
The text was updated successfully, but these errors were encountered:
Bug Description
在 Robyn 框架的 OpenAPI 文档生成功能中,发现了一个与泛型类型处理相关的 bug。当 API 端点返回或接收包含泛型类型(如 List[Object] )的参数时,OpenAPI 规范生成不正确,导致 Swagger UI 无法正确显示这些类型。
Steps to Reproduce
Your operating system
Windows
Your Python version (
python --version
)3.11
Your Robyn version
latest
Additional Info
问题出现在 openapi.py 文件的 get_schema_object 方法中,大约在第 397行。需要添加对泛型类型的处理逻辑。
检查是否为泛型类型(如List[Object])
The text was updated successfully, but these errors were encountered: