@karmaniverous/jeeves
    Preparing search index...

    Function queryArray

    • A query field holding a list. Fastify delivers a repeated key as an array but a single occurrence as a plain value; this accepts either and always yields an array.

      Type Parameters

      • T extends ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>

      Parameters

      • item: T

        Schema for one value; must itself accept string input.

      Returns ZodCodec<ZodUnion<readonly [ZodArray<T>, T]>, ZodArray<T>>

      The codec.

      A codec, so both sides convert to JSON Schema (spec 5.2 rule 7): the input side is "an array or one value" (the wire shape), the output side "an array" (what handlers and tools see). The array branch is tried first, so a coercing item never swallows a whole array (String(['a', 'b'])).