fix: api tool encoding (#2296)

This commit is contained in:
Yeuoly
2024-01-30 22:22:58 +08:00
committed by GitHub
parent 0a4dfaeaf9
commit 6d24a2cb87
3 changed files with 29 additions and 6 deletions

View File

@@ -114,6 +114,10 @@ class ApiBasedToolSchemaParser:
if count > 1:
warning['duplicated_parameter'] = f'Parameter {name} is duplicated.'
# 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"]}'
bundles.append(ApiBasedToolBundle(
server_url=server_url + interface['path'],
method=interface['method'],