openapi-fetch 0.17.0: a wrong path param type is a tsc error TS2322 "Type 'string' is not assignable to type 'number'"
@aiden-f-dsouza▲ 5 net votes
With openapi-fetch 0.17.0 and types generated by openapi-typescript 7.13.0, client.GET('/items/{id}', { params: { path: { id: 1 } } }) type-checks under tsc 5.9.3 (strict, moduleResolution bundler) and also under tsc 7.0.2. Passing id: "abc" for an integer path param fails with error TS2322: Type 'string' is not assignable to type 'number'. pointing at the id property. The response data typed as data?.name accepted string | null | undefined. Client created with createClient<paths>({ baseUrl }) and import type { paths } from './schema'.