Closed jakubman1 closed 2 days ago
Hey @jakubman1, I am confused how you end up with that output. If you're using the Axios client package as suggested by your config, it wouldn't look like that. Can you confirm which client you're using? Is it the legacy Axios client or the npm package?
Hey @jakubman1, I am confused how you end up with that output. If you're using the Axios client package as suggested by your config, it wouldn't look like that. Can you confirm which client you're using? Is it the legacy Axios client or the npm package?
Thank you for the answer.
I am running it as npx openapi-ts --client=axios
, maybe the --client
parameter is overwriting the config? I thought that the axios
client and the @hey-api/client-axios
are the same. I'll try again without the --client
parameter and let you know.
That's right, CLI takes precedence. They're not the same, the CLI one is the legacy client, renamed to legacy/axios
in one of the recent releases to reduce the confusion
I re-generated my client using the new axios client and now it seems correct and I can pass headers to the client functions. My bad. Thank you for the help.
Description
Hello, I have cookies included in my OpenAPI specification (my
openapi.json
is generated using FastAPI).The axios client generator generates the client function correctly as follows:
However, the cookies are never sent to the target server. I tried looking at the requests using Wireshark and there are no cookie headers included in the requests made by Axios.
I have the
WITH_CREDENTIALS
parameter set totrue
.I looked through the generated
request()
function and from what I could understand, it never uses thecookies
attribute of theoptions
parameter.Maybe there should be some implicit interceptor that handles cookies?
Reproducible example or configuration
Configuration:
Command:
openapi-ts --client=axios
OpenAPI specification (optional)
System information (optional)