trpc-openapi icon indicating copy to clipboard operation
trpc-openapi copied to clipboard

Query param not working in example/with-nuxtjs

Open imding opened this issue 1 year ago • 0 comments

Hi I am having some issue getting query params to come through in a Nuxt project.

Steps to reproduce:

  1. gh repo clone jlalmes/trpc-openapi
  2. cd trpc-openapi/examples/with-nuxtjs
  3. pnpm add jsonwebtoken trpc-openapi uuid zod @types/jsonwebtoken @types/uuid
  4. pnpm i
  5. remove .optional() from the /posts route input image
  6. pnpm dev
  7. make GET request to /posts route with userId query param image

What I found:

  1. the code for extracting query params and adding them to the input is here image
  2. the nuxt adapter sets the url field using the pathname here, which does not include the ?param=value part of the url image

imding avatar Feb 24 '24 04:02 imding