hey-api / openapi-ts

🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more. Support: @mrlubos
https://heyapi.dev
Other
1.31k stars 102 forks source link

Improved types for Vue Tanstack Query #1030

Open rkorzhoff opened 2 months ago

rkorzhoff commented 2 months ago

Description

It would be great if you could improve the types for requests parameters, especially considering Vue 3 refs. It’s a common use case to pass reactive variables as parameters

image

Reproducible example or configuration

https://stackblitz.com/edit/vitejs-vite-cwmyp5

Just install deps and run npm run ts:check

OpenAPI specification (optional)

No response

System information (optional)

No response

stackblitz[bot] commented 2 months ago

Fix this issue in StackBlitz Codeflow Start a new pull request in StackBlitz Codeflow.

holtgrewe commented 5 days ago

Actually, MaybeRefOrGetter<T> should be used and toValue(value) can be used to resolve this.