fix(httpapi): return pty error bodies (#28838)

This commit is contained in:
Shoubhit Dash
2026-05-22 21:00:20 +05:30
committed by GitHub
parent d92b8d8009
commit 5cf597d583
7 changed files with 119 additions and 14 deletions

View File

@@ -190,4 +190,22 @@ describe("PublicApi OpenAPI v2 errors", () => {
)
}
})
test("documents PTY resource and ticket errors", () => {
const spec = OpenApi.fromApi(PublicApi) as OpenApiSpec
for (const route of [
["get", "/pty/{ptyID}"],
["put", "/pty/{ptyID}"],
["delete", "/pty/{ptyID}"],
["post", "/pty/{ptyID}/connect-token"],
] as const) {
expect(componentName(responseRef(spec.paths[route[1]]?.[route[0]]?.responses?.["404"]) ?? "")).toBe(
"PtyNotFoundError",
)
}
expect(componentName(responseRef(spec.paths["/pty/{ptyID}/connect-token"]?.post?.responses?.["403"]) ?? "")).toBe(
"PtyForbiddenError",
)
})
})