-
-
Notifications
You must be signed in to change notification settings - Fork 241
Open
Labels
bug 🔥Something isn't workingSomething isn't workingclientClient package relatedClient package relatedjavascriptPull requests that update Javascript codePull requests that update Javascript code
Description
Description
Bug Description
openapi-ts with tanstack/query plugin generates incorrect query parameter names for deepObject style parameters in infiniteQueryOptions and causes TypeScript errors. This is the only blocker preventing us from adopting openapi-ts. We use query param object style for existing APIs, so we need to support it. As far as I know, query param object official spec since OpenAPI 3.0
Thanks for your lovely library!
Current Output
const page = typeof pageParam === 'object' ? pageParam : {
query: {
'pageable.page': pageParam // Wrong: uses dot notation
}
};
error:
Type 'Pick<Pick<Options<GetDeepObjectData>, "body" | "path" | "query" | "headers" | "baseUrl"> & { _id: string; _infinite?: boolean | undefined; tags?: readonly string[] | undefined; }, "body" | ... 2 more ... | "headers"> | { ...; }' is not assignable to type 'Pick<Pick<Options<GetDeepObjectData>, "body" | "path" | "query" | "headers" | "baseUrl"> & { _id: string; _infinite?: boolean | undefined; tags?: readonly string[] | undefined; }, "body" | ... 2 more ... | "headers">'.
Type '{ query: { 'pageable.page': number; }; }' is not assignable to type 'Pick<Pick<Options<GetDeepObjectData>, "body" | "path" | "query" | "headers" | "baseUrl"> & { _id: string; _infinite?: boolean | undefined; tags?: readonly string[] | undefined; }, "body" | ... 2 more ... | "headers">'.
Types of property 'query' are incompatible.
Object literal may only specify known properties, and ''pageable.page'' does not exist in type '{ pageable: { page?: number | undefined; size?: number | undefined; sort?: string[] | undefined; }; }'
Reproducible example or configuration
https://stackblitz.com/~/github.com/WooWan/openapi-ts-reproduction
OpenAPI specification (optional)
No response
System information (optional)
Environment
openapi-ts: 0.83.1
TypeScript: 5.9.3
Metadata
Metadata
Assignees
Labels
bug 🔥Something isn't workingSomething isn't workingclientClient package relatedClient package relatedjavascriptPull requests that update Javascript codePull requests that update Javascript code