H
Hono4mo ago
iEmix

Zod why error

My code:
app.openapi(createRoute({
method: 'get' as any,
path: "/",
tags: ["Assistants"],
security: [{Basic: []}],
summary: "Returns a list of assistants",
request: {
query: z.object({
limit: z.string().optional(),
order: z.string().optional(),
after: z.string().optional(),
before: z.string().optional(),
}),
},
}),
app.openapi(createRoute({
method: 'get' as any,
path: "/",
tags: ["Assistants"],
security: [{Basic: []}],
summary: "Returns a list of assistants",
request: {
query: z.object({
limit: z.string().optional(),
order: z.string().optional(),
after: z.string().optional(),
before: z.string().optional(),
}),
},
}),
error Argument type {summary: string, path: string, request: {query: ZodObject<{before: ZodOptional<ZodString>, limit: ZodOptional<ZodString>, after: ZodOptional<ZodString>, order: ZodOptional<ZodString>}, "strip", ZodTypeAny, {[k in keyof objectUtil.addQuestionMarks<baseObjectOutputType<{before: ..., limit: ..., after: ..., order: ...}>, any>]: objectUtil.addQuestionMarks<baseObjectOutputType<{before: ..., limit: ..., after: ..., order: ...}>, any>[k]}, {[k_1 in keyof baseObjectInputType<{before: ..., limit: ..., after: ..., order: ...}>]: baseObjectInputType<{before: ..., limit: ..., after: ..., order: ...}>[k_1]}>}, security: {Basic: any[]}[], method: any, responses: {200: {description: string, content: {"application/json": {schema: ...}}}}, tags: string[]} & {getRoutingPath(): RoutingPath<string>} is not assignable to parameter type RouteConfig why i recive error ?
No description
2 Replies
iEmix
iEmixOP4mo ago
code works by i recive error in phpstorm I hack this
request: {
query: z.object({
limit: z.string().optional(),
order: z.string().optional(),
after: z.string().optional(),
before: z.string().optional(),
}) as RouteParameter,
},
request: {
query: z.object({
limit: z.string().optional(),
order: z.string().optional(),
after: z.string().optional(),
before: z.string().optional(),
}) as RouteParameter,
},
Aditya Mathur
Aditya Mathur4mo ago
Can you share a quick reproduction for this single route?
Want results from more Discord servers?
Add your server