hey-api / openapi-ts

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

Code generated by TanStack Query plugin does not pass validation #1191

Closed holtgrewe closed 3 weeks ago

holtgrewe commented 4 weeks ago

Description

With @hey-api/openapi-ts v0.53.11, the generated code yields problems with type checks:

ext/varfish-api/src/lib/@tanstack/vue-query.gen.ts:84:14 - error TS2527: The inferred type of 'casesAnalysisApiCaseanalysisListInfiniteOptions' references an inaccessible 'unique symbol' type. A type annotation is necessary.
84 export const casesAnalysisApiCaseanalysisListInfiniteOptions = (options: Options<CasesAnalysisApiCaseanalysisListData>) => { return infiniteQueryOptions<CasesAnalysisApiCaseanalysisListResponse, CasesAnalysisApiCaseanalysisListError, InfiniteData<CasesAnalysisApiCaseanalysisListResponse>, QueryKey<Options<CasesAnalysisApiCaseanalysisListData>>, string | Pick<QueryKey<Options<CasesAnalysisApiCaseanalysisListData>>[0], 'body' | 'headers' | 'path' | 'query'>>(
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reproducible example or configuration

https://github.com/holtgrewe/hey-api-bugs-unique-symbl

OpenAPI specification (optional)

See here

https://github.com/holtgrewe/hey-api-bugs-unique-symbl/blob/main/varfish_api_schema.yaml

System information (optional)

See MWE repository

mrlubos commented 4 weeks ago

@holtgrewe I can't replicate this issue locally with the latest version. Please try once it's released and if the issue persists, create a StackBlitz example. 🙏

holtgrewe commented 3 weeks ago

Thanks, this works now.