nuxt-hub / core

Build full-stack applications with Nuxt on CloudFlare, with zero configuration.
https://hub.nuxt.com
Apache License 2.0
993 stars 57 forks source link

Bad Zod validation schema in Vectorize query function #350

Closed V1laZ closed 3 weeks ago

V1laZ commented 3 weeks ago

Describe the bug When calling the vectorize query function without the second 'params' argument it throws a Zod validation error.

Steps to reproduce

  1. Call hubVectorize('<index>').query([32.4, 6.55, 11.2, 10.3, 87.9])

Expected behavior There's probably a missing .optional() method at the end of the params schema definition in Vectorize's query command. According to the docs it should be possible to call the function without the second argument.

Workaround hubVectorize('<index>').query([32.4, 6.55, 11.2, 10.3, 87.9], {})