diff --git a/modules/swagger-codegen/src/main/resources/php/Configuration.mustache b/modules/swagger-codegen/src/main/resources/php/Configuration.mustache index cdbba93a000..1fdccf7006a 100644 --- a/modules/swagger-codegen/src/main/resources/php/Configuration.mustache +++ b/modules/swagger-codegen/src/main/resources/php/Configuration.mustache @@ -38,6 +38,11 @@ class Configuration */ protected $apiKeys = []; + /** + * Array to store Guzzle Request Options + */ + protected $requestConfigurations = []; + /** * Associate array to store API prefix (e.g. Bearer) * @@ -135,6 +140,29 @@ class Configuration return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; } + /** + * Sets Additional Guzzle Request options + * + * @param array $additionalRequestConfigs Array of Addition Guzzle Configs + * + * @return $this + */ + public function setRequestOptions(array $additionalRequestConfigs) + { + $this->requestConfigurations = $additionalRequestConfigs; + return $this; + } + + /** + * Gets Additional Guzzle Request options + * + * @return array of Guzzle Request options + */ + public function getRequestOptions() + { + return $this->requestConfigurations; + } + /** * Sets the prefix for API key (e.g. Bearer) * diff --git a/modules/swagger-codegen/src/main/resources/php/api.mustache b/modules/swagger-codegen/src/main/resources/php/api.mustache index e0b01e1f678..800ed7fa2ec 100644 --- a/modules/swagger-codegen/src/main/resources/php/api.mustache +++ b/modules/swagger-codegen/src/main/resources/php/api.mustache @@ -523,6 +523,10 @@ use {{invokerPackage}}\ObjectSerializer; } } + if(!empty($this->config->getRequestOptions())) { + $options = array_merge($options, $this->config->getRequestOptions()); + } + return $options; } } diff --git a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache index 867d3b5a13d..5cfc00d9d4e 100644 --- a/modules/swagger-codegen/src/main/resources/php/model_generic.mustache +++ b/modules/swagger-codegen/src/main/resources/php/model_generic.mustache @@ -178,12 +178,12 @@ class {{classname}} {{#parentSchema}}extends {{{parent}}} {{/parentSchema}}{{^pa */ public function listInvalidProperties() { - {{#parent}} + {{#parentSchema}} $invalidProperties = parent::listInvalidProperties(); - {{/parent}} - {{^parent}} + {{/parentSchema}} + {{^parentSchema}} $invalidProperties = []; - {{/parent}} + {{/parentSchema}} {{#vars}} {{#required}}