Unverified Commit 48bacd01 authored by Yeuoly's avatar Yeuoly Committed by GitHub

fix: incorrect tool name (#2489)

parent 297d0f1f
...@@ -115,7 +115,12 @@ class ApiBasedToolSchemaParser: ...@@ -115,7 +115,12 @@ class ApiBasedToolSchemaParser:
# check if there is a operation id, use $path_$method as operation id if not # check if there is a operation id, use $path_$method as operation id if not
if 'operationId' not in interface['operation']: 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( bundles.append(ApiBasedToolBundle(
server_url=server_url + interface['path'], server_url=server_url + interface['path'],
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment