You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm guessing that this isn't currently possible, but I wanted to ask and start a discussion. I'm using RTK Query and the codegen tool with OpenAPI on our server. Our server requires a custom Organization-ID header for almost all endpoints to identify which of the user's organizations is active/relevant on the client (like different teams on Slack). Because this header is required everywhere, I'm adding it to headers via the prepareHeaders function in the RTK Query base query.
This part works great. However, when I run codegen all of the endpoint hooks now require Organization-ID as an argument.
Presumably I can pass it an empty string and that will get overwritten during prepareHeaders, but I'd like to clean that up if possible. Is there any way that I can tell codegen to skip that header when generating the arg type for the hooks? If not, does anyone have ideas for how this capability could be added while keeping with the intent and patterns of this project? I'd be interested in contributing if so.
The text was updated successfully, but these errors were encountered:
I'm guessing that this isn't currently possible, but I wanted to ask and start a discussion. I'm using RTK Query and the codegen tool with OpenAPI on our server. Our server requires a custom
Organization-ID
header for almost all endpoints to identify which of the user's organizations is active/relevant on the client (like different teams on Slack). Because this header is required everywhere, I'm adding it to headers via theprepareHeaders
function in the RTK Query base query.This part works great. However, when I run codegen all of the endpoint hooks now require
Organization-ID
as an argument.Generated hook arg type:
which gets called like:
Presumably I can pass it an empty string and that will get overwritten during
prepareHeaders
, but I'd like to clean that up if possible. Is there any way that I can tell codegen to skip that header when generating the arg type for the hooks? If not, does anyone have ideas for how this capability could be added while keeping with the intent and patterns of this project? I'd be interested in contributing if so.The text was updated successfully, but these errors were encountered: