forked from loafle/openapi-generator-original
fix: 🐛 Added ability to override basePath while creating ApiClient instance (#10327)
Solves #9179
This commit is contained in:
parent
31342580cb
commit
538f12c36d
@ -16,13 +16,18 @@ import querystring from "querystring";
|
|||||||
* @class
|
* @class
|
||||||
*/{{/emitJSDoc}}
|
*/{{/emitJSDoc}}
|
||||||
class ApiClient {
|
class ApiClient {
|
||||||
constructor() {
|
/**
|
||||||
|
* The base URL against which to resolve every API call's (relative) path.
|
||||||
|
* Overrides the default value set in spec file if present
|
||||||
|
* @param {String} basePath
|
||||||
|
*/
|
||||||
|
constructor(basePath = '{{{basePath}}}') {
|
||||||
{{#emitJSDoc}}/**
|
{{#emitJSDoc}}/**
|
||||||
* The base URL against which to resolve every API call's (relative) path.
|
* The base URL against which to resolve every API call's (relative) path.
|
||||||
* @type {String}
|
* @type {String}
|
||||||
* @default {{{basePath}}}
|
* @default {{{basePath}}}
|
||||||
*/{{/emitJSDoc}}
|
*/{{/emitJSDoc}}
|
||||||
this.basePath = '{{{basePath}}}'.replace(/\/+$/, '');
|
this.basePath = basePath.replace(/\/+$/, '');
|
||||||
|
|
||||||
{{#emitJSDoc}}/**
|
{{#emitJSDoc}}/**
|
||||||
* The authentication methods to be included for all API calls.
|
* The authentication methods to be included for all API calls.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user