forked from loafle/openapi-generator-original
Merge branch 'master' of https://github.com/swagger-api/swagger-codegen into php_api_doc
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user