I'm using the typescript-axios client generated by OpenAPI and I need to log the requests made by the client. I know how to use interceptors with axios, but how can I get at the underlying axios instance?
The code generated by https://github.com/OpenAPITools/openapi-generator has a protected axios
property.
The following [partially quoted] block comes from an OpenAPITools/openapi-generator
issue.
The DefaultApi has a protected
axios
property which can be accessedconst finnhubClient = new DefaultApi({ apiKey, }) finnhubClient.axios.interceptors.response.use( response => response, error => { console.log('error: ', error) throw error } )