fix(httpapi): return request not found errors (#28693)
This commit is contained in:
@@ -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",
|
||||
)
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user