When I use the @hey-api/client-fetch client, and the request body is an array of string there is a typescript error:
Argument of type '{ url: string; headers?: Record<string, unknown> | HeadersInit | undefined; method?: "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE" | undefined; ... 19 more ...; body?: string[] | undefined; }' is not assignable to parameter of type 'RequestOptionsBase'.
Types of property 'body' are incompatible.
Type 'string[] | undefined' is not assignable to type 'Record<string, unknown> | BodyInit | Record<string, unknown>[] | null | undefined'.
Type 'string[]' is not assignable to type 'Record<string, unknown> | BodyInit | Record<string, unknown>[] | null | undefined'.
Type 'string[]' is not assignable to type 'Record<string, unknown>[]'.
Type 'string' is not assignable to type 'Record<string, unknown>'.
Description
When I use the @hey-api/client-fetch client, and the request body is an array of string there is a typescript error:
OpenAPI specification (optional)
Configuration
System information (optional)
See: https://github.com/mlankamp/openapi
Probable solution: add
Array<unknown>
to https://github.com/hey-api/openapi-ts/blob/d9372335368015aeed63b9a88d066f19fc6d3d57/packages/client-fetch/src/types.ts#L22