acacode / swagger-typescript-api

Generate the API Client for Fetch or Axios from an OpenAPI Specification
MIT License
3.39k stars 362 forks source link

http-client cannot customize #885

Closed sytruong92 closed 3 months ago

sytruong92 commented 3 months ago

I want to customize fetch to add interceptor but I not work. Can you help me

export interface ApiConfig { baseUrl?: string; baseApiParams?: Omit<RequestParams, "baseUrl" | "cancelToken" | "signal">; securityWorker?: (securityData: SecurityDataType | null) => Promise<RequestParams | void> | RequestParams | void; interceptors?: Interceptors; customFetch?: typeof fetch; }