fix(openapi): Add openapi call after catch

fix: #2561
without making an explicit call to openapi a runtime error happens because it cannot infer the type, the call to openapi is the same across the codebase
This commit is contained in:
Laurence
2026-02-28 11:27:19 +00:00
parent 72bf6f3c41
commit b0a34fa21b

View File

@@ -31,12 +31,23 @@ const listSiteResourcesQuerySchema = z.object({
sort_by: z
.enum(["name"])
.optional()
.catch(undefined),
.catch(undefined)
.openapi({
type: "string",
enum: ["name"],
description: "Field to sort by"
}),
order: z
.enum(["asc", "desc"])
.optional()
.default("asc")
.catch("asc")
.openapi({
type: "string",
enum: ["asc", "desc"],
default: "asc",
description: "Sort order"
})
});
export type ListSiteResourcesResponse = {