Const
A Zod schema for a boolean in a query parameter. Since query parameters must be strings, you can't validate them with a z.boolean() schema. You can use this as a schema which parses a string into a boolean. It uses the yn library for parsing.
z.boolean()
yn
QueryBooleanSchema.parse('1'); // trueQueryBooleanSchema.parse('false'); // false Copy
QueryBooleanSchema.parse('1'); // trueQueryBooleanSchema.parse('false'); // false
A Zod schema for a boolean in a query parameter. Since query parameters must be strings, you can't validate them with a
z.boolean()
schema. You can use this as a schema which parses a string into a boolean. It uses theyn
library for parsing.