-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
Closed
Labels
Description
Is your feature request related to a problem? Please describe.
Just like issue above, I also want to append header.
const init = {
method: context.method,
headers: headers,
body,
credentials: this.configuration.credentials,
...initOverrides
};But {X, ...Y} is one level merging, not deep merging.
When initOverrides has key headers, prev key headers is gone.
So, current implement can't append header.
Describe the solution you'd like
Current signature
private createFetchParams(context: RequestOpts, initOverrides?: RequestInit)Merging using {X, ...Y}
REQ
private createFetchParams(
context: RequestOpts,
initOverrides?: RequestInit | ((context: RequestOpts) => RequestInit)
)Merging using {X, ...Y(X) }
Describe alternatives you've considered
Convert {X, ...Y} to some deep merging library fn(X, Y).
But consider openapi-generator target many language, I prefer former to decrease you guys maintenance burden.
Additional context
You guys are awesome. :)
Reactions are currently unavailable