浏览代码

fix: incorrect tool name (#2489)

tags/0.5.7
Yeuoly 1年前
父节点
当前提交
48bacd01cc
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6
    1
      api/core/tools/utils/parser.py

+ 6
- 1
api/core/tools/utils/parser.py 查看文件

@@ -115,7 +115,12 @@ class ApiBasedToolSchemaParser:

# check if there is a operation id, use $path_$method as operation id if not
if 'operationId' not in interface['operation']:
interface['operation']['operationId'] = f'{interface["path"]}_{interface["method"]}'
# remove special characters like / to ensure the operation id is valid ^[a-zA-Z0-9_-]{1,64}$
path = interface['path']
if interface['path'].startswith('/'):
path = interface['path'][1:]
path = path.replace('/', '_')
interface['operation']['operationId'] = f'{path}_{interface["method"]}'

bundles.append(ApiBasedToolBundle(
server_url=server_url + interface['path'],

正在加载...
取消
保存