From 6f11092a57442f5f2a73f155917ebfedcb8e9fd9 Mon Sep 17 00:00:00 2001 From: nmonterroso Date: Mon, 22 Jun 2015 10:35:57 -0700 Subject: [PATCH] call setHost using API baspath when no apiclient is provided --- .../swagger-codegen/src/main/resources/php/ApiClient.mustache | 4 ++-- modules/swagger-codegen/src/main/resources/php/api.mustache | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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;