jlalmes / trpc-openapi

OpenAPI support for tRPC 🧩
https://www.npmjs.com/package/trpc-openapi
MIT License
2.12k stars 136 forks source link

Query param not working in example/with-nuxtjs #438

Open imding opened 4 months ago

imding commented 4 months ago

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