Skip to content

[REQ] typescript-axios basePath to be passed as config #8065

@sahanatroam

Description

@sahanatroam

Is your feature request related to a problem? Please describe.

having to pass base path as a new parm where as you could simply pass the BASE_PATH as axios config
https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache#L244

Describe the solution you'd like

https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/resources/typescript-axios/apiInner.mustache#L244

Ideally we should change the line above to do the following

return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
  const axiosRequestArgs = {...localVarAxiosArgs.options, url: (basePath || configuration?.basePath) + localVarAxiosArgs.url};
  return axios.request(axiosRequestArgs);
};

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions