openapistack / openapi-client-axios

JavaScript client library for consuming OpenAPI-enabled APIs with axios
https://openapistack.co
MIT License
558 stars 67 forks source link

set transformResponse in axiosConfigDefaults #66

Closed meteoriteliu closed 3 years ago

meteoriteliu commented 3 years ago

i want to do some processing everytime I gets api response, so I set a function in transformResponse in axiosConfigDefaults, which takes data as param and return data as it is. After applying the config, the response I got from apiclient changed to same as the data transformResponse function received. I think it is setting transformResponse overwrites the openapi-client's behavior of processing the response. I wonder what is the way (if any) to set a global response interceptor/function? thanks~