Mandatory Query Parameters? #238
Unanswered
tsteckenborn
asked this question in
Q&A
Replies: 2 comments
-
Yes, it's the default in zod, for example here const api = makeApi([{
method: "get",
path: "/users",
parameters: [{
type: "Query",
name: "limit",
schema: z.string(),
}],
response: userSchema,
}]); and here it's optional: const api = makeApi([{
method: "get",
path: "/users",
parameters: [{
type: "Query",
name: "limit",
schema: z.string().optional(),
}],
response: userSchema,
}]); |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a possibility to make specific query parameters mandatory for an endpoint?
Beta Was this translation helpful? Give feedback.
All reactions