diff --git a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache index c2a6b369f3c..996ccbd16d9 100644 --- a/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache +++ b/modules/swagger-codegen/src/main/resources/php/ApiClient.mustache @@ -28,9 +28,9 @@ class ApiClient { protected $defaultHeaders = array(); /** - * The host (from basePath) + * The host */ - protected $host = '{{basePath}}'; + protected $host = 'http://localhost'; /* * @var string timeout (second) of the HTTP request, by default set to 0, no timeout diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index a014ecbaccc..b6f17f528d5 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -39,7 +39,7 @@ class {{classname}} { function __construct($apiClient = null) { if ($apiClient == null) { - $apiClient = new ApiClient(); + $apiClient = (new ApiClient())->setHost('{{basePath}}'); } $this->apiClient = $apiClient;