openapi-typescript icon indicating copy to clipboard operation
openapi-typescript copied to clipboard

Header in createClient not considered when resolving request

Open newza-fullmetal opened this issue 7 months ago • 3 comments

Description

If I add default headers in the createClient call

const sharedHeader = { workspace: env().workspace, 'x-web-version': '2' }
const client = createClient({ baseUrl: env().ENDPOINT, fetch: customFetchWithInterceptor, headers: sharedHeader })

It is not resolved when I use the client : client.GET('/internal/notifications/getuserwebnotifications', { params: { query } })

the error is : "the property header is missing in the type .... "

here the params typescript of this specific request :

    query?: {
        page?: number;
        page_size?: number;
        search?: string;
        ordering?: string;
        action?: string;
    };
    header: {
        workspace: string;
    };
}

Expected result

I would expect the header were inherited from the createClient call. But maybe I am missing something.

newza-fullmetal avatar Jan 16 '24 10:01 newza-fullmetal