fix: prevent crash when invalid OpenAPI spec is loaded for tool servers (#20257)
* enh * fix
This commit is contained in:
1 parent
935808f5ea
commit
697e94e935
2 files changed
+20
-8
No files matched your search
@@ -379,6 +379,13 @@ export const getToolServersData = async (servers: object[]) => {
|
||||
}
|
||||
|
||||
if (res) {
|
||||
if (!res.paths) {
|
||||
return {
|
||||
error: 'Invalid OpenAPI spec',
|
||||
url: server?.url
|
||||
};
|
||||
}
|
||||
|
||||
const { openapi, info, specs } = {
|
||||
openapi: res,
|
||||
info: res.info,
|
||||
@@ -1667,7 +1674,7 @@ export interface ModelMeta {
|
||||
profile_image_url?: string;
|
||||
}
|
||||
|
||||
export interface ModelParams {}
|
||||
export interface ModelParams { }
|
||||
|
||||
export type GlobalModelConfig = ModelConfig[];
|
||||
|
||||
|
||||
Reference in new issue
Block a user