We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I get this error: Cannot convert undefined or null to object
Cannot convert undefined or null to object
Triggered by making query string a z.object:
querystring: z.object({ query: z.string() }),
import { type FastifyInstance, type FastifyPluginAsync } from 'fastify' import { ZodTypeProvider } from 'fastify-type-provider-zod' import z from 'zod' const scraperRoute: FastifyPluginAsync = async function ( fastify: FastifyInstance ) { fastify.withTypeProvider<ZodTypeProvider>().route({ method: 'GET', url: '/scraper', schema: { querystring: z.object({ query: z.string().min(4) }), response: { 200: z.object({ url: z.string().min(2), hidden: z.boolean() }) } }, handler: async (request, reply) => { // @ts-ignore const { query } = request.query try { const data = await getScraper(query) return reply.code(200).send(data) } catch (error) { fastify.log.error(error) return reply.code(500).send() } } }) } export default scraperRoute
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I get this error:
Cannot convert undefined or null to object
Triggered by making query string a z.object:
The text was updated successfully, but these errors were encountered: