mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-01 16:26:39 +00:00
Merge pull request #2562 from LaurenceJJones/fix/zod-openapi-catch-error
fix(zod): Add openapi call after catch
This commit is contained in:
@@ -31,12 +31,23 @@ const listSiteResourcesQuerySchema = z.object({
|
|||||||
sort_by: z
|
sort_by: z
|
||||||
.enum(["name"])
|
.enum(["name"])
|
||||||
.optional()
|
.optional()
|
||||||
.catch(undefined),
|
.catch(undefined)
|
||||||
|
.openapi({
|
||||||
|
type: "string",
|
||||||
|
enum: ["name"],
|
||||||
|
description: "Field to sort by"
|
||||||
|
}),
|
||||||
order: z
|
order: z
|
||||||
.enum(["asc", "desc"])
|
.enum(["asc", "desc"])
|
||||||
.optional()
|
.optional()
|
||||||
.default("asc")
|
.default("asc")
|
||||||
.catch("asc")
|
.catch("asc")
|
||||||
|
.openapi({
|
||||||
|
type: "string",
|
||||||
|
enum: ["asc", "desc"],
|
||||||
|
default: "asc",
|
||||||
|
description: "Sort order"
|
||||||
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
export type ListSiteResourcesResponse = {
|
export type ListSiteResourcesResponse = {
|
||||||
|
|||||||
Reference in New Issue
Block a user