fix(httpapi): return mcp server not found errors (#28817)

This commit is contained in:
Shoubhit Dash
2026-05-22 17:46:30 +05:30
committed by GitHub
parent 51da3483a9
commit 0beb4de3e8
8 changed files with 158 additions and 72 deletions

View File

@@ -173,4 +173,21 @@ describe("PublicApi OpenAPI v2 errors", () => {
)
}
})
test("documents MCP server not-found errors", () => {
const spec = OpenApi.fromApi(PublicApi) as OpenApiSpec
for (const route of [
["post", "/mcp/{name}/auth"],
["post", "/mcp/{name}/auth/authenticate"],
["post", "/mcp/{name}/auth/callback"],
["delete", "/mcp/{name}/auth"],
["post", "/mcp/{name}/connect"],
["post", "/mcp/{name}/disconnect"],
] as const) {
expect(componentName(responseRef(spec.paths[route[1]]?.[route[0]]?.responses?.["404"]) ?? "")).toBe(
"McpServerNotFoundError",
)
}
})
})