fix(httpapi): return pty error bodies (#28838)
This commit is contained in:
@@ -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",
|
||||
)
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user