Merge branch 'master' of https://github.com/swagger-api/swagger-codegen into php_api_doc

This commit is contained in:
wing328
2016-03-16 11:42:27 +08:00
124 changed files with 4712 additions and 3276 deletions

View File

@@ -245,7 +245,17 @@ class ObjectSerializer
settype($data, 'array');
$deserialized = $data;
} elseif ($class === '\DateTime') {
$deserialized = new \DateTime($data);
// Some API's return an invalid, empty string as a
// date-time property. DateTime::__construct() will return
// the current time for empty input which is probably not
// what is meant. The invalid empty string is probably to
// be interpreted as a missing field/value. Let's handle
// this graceful.
if (!empty($data)) {
$deserialized = new \DateTime($data);
} else {
$deserialized = null;
}
} elseif (in_array($class, array({{&primitives}}))) {
settype($data, $class);
$deserialized = $data;

View File

@@ -110,7 +110,7 @@ class Configuration
*
* @var string
*/
protected $userAgent = "PHP-Swagger/{{artifactVersion}}";
protected $userAgent = "{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{artifactVersion}}}/php{{/httpUserAgent}}";
/**
* Debug switch (default set to false)