-
-
Notifications
You must be signed in to change notification settings - Fork 594
Description
Description
My OpenAPI specification contains parameters with values are located in cookies. It would be most convenient if this project wrote specified cookies to outgoing requests.
I saw #1689 was closed and wanted an open issue for tracking.
When the openapi-typescript client is running in my Next.js project under a file with "use client" the web browser cookies are sent along 👍
When the openapi-typescript client is running on server side Next.js code, no cookies are sent along with the request, even when specified.
Proposal
Cookies that are specified for a request are written to outgoing requests. If a cookie under that name already exists, it is overwritten if specified. In the case of the openapi-typescript client running under a file with "use client" (in the web browser), supplying the value of null (or similar) for a specified cookie name will allow a type-safe way to convey the meaning "use the web browser's value for this cookie"
Alternatively, docs and an example on how to do this via middleware would be wonderful, I am not very TypeScript savvy.
Checklist
- I’m willing to open a PR for this (see CONTRIBUTING.md)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status