fix(httpapi): return request not found errors (#28693)

This commit is contained in:
Shoubhit Dash
2026-05-22 16:29:12 +05:30
committed by GitHub
parent 76d9c2cd76
commit 4ce247eaba
15 changed files with 213 additions and 56 deletions

View File

@@ -157,4 +157,20 @@ describe("PublicApi OpenAPI v2 errors", () => {
)
}
})
test("documents permission and question not-found errors", () => {
const spec = OpenApi.fromApi(PublicApi) as OpenApiSpec
expect(componentName(responseRef(spec.paths["/permission/{requestID}/reply"]?.post?.responses?.["404"]) ?? "")).toBe(
"PermissionNotFoundError",
)
for (const route of [
["post", "/question/{requestID}/reply"],
["post", "/question/{requestID}/reject"],
] as const) {
expect(componentName(responseRef(spec.paths[route[1]]?.[route[0]]?.responses?.["404"]) ?? "")).toBe(
"QuestionNotFoundError",
)
}
})
})