mirror of
https://github.com/jlengrand/openapi-generator.git
synced 2026-05-16 00:21:19 +00:00
merged
This commit is contained in:
@@ -82,6 +82,7 @@ public class PhpClientCodegen extends DefaultCodegen implements CodegenConfig {
|
||||
typeMapping.put("map", "map");
|
||||
typeMapping.put("array", "array");
|
||||
typeMapping.put("list", "array");
|
||||
typeMapping.put("object", "object");
|
||||
|
||||
supportingFiles.add(new SupportingFile("composer.mustache", packagePath.replace('/', File.separatorChar), "composer.json"));
|
||||
supportingFiles.add(new SupportingFile("configuration.mustache", (packagePath + "/lib").replace('/', File.separatorChar), "Configuration.php"));
|
||||
|
||||
@@ -182,13 +182,10 @@ class ApiClient {
|
||||
$this->updateParamsForAuth($headerParams, $queryParams, $authSettings);
|
||||
|
||||
# construct the http header
|
||||
if ($headerParams != null) {
|
||||
# add default header
|
||||
$headerParams = array_merge((array)self::$default_header, $headerParams);
|
||||
$headerParams = array_merge((array)self::$default_header, (array)$headerParams);
|
||||
|
||||
foreach ($headerParams as $key => $val) {
|
||||
$headers[] = "$key: $val";
|
||||
}
|
||||
foreach ($headerParams as $key => $val) {
|
||||
$headers[] = "$key: $val";
|
||||
}
|
||||
|
||||
// form data
|
||||
@@ -292,7 +289,9 @@ class ApiClient {
|
||||
} else if (is_object($data)) {
|
||||
$values = array();
|
||||
foreach (array_keys($data::$swaggerTypes) as $property) {
|
||||
$values[$data::$attributeMap[$property]] = $this->sanitizeForSerialization($data->$property);
|
||||
if ($data->$property !== null) {
|
||||
$values[$data::$attributeMap[$property]] = $this->sanitizeForSerialization($data->$property);
|
||||
}
|
||||
}
|
||||
$sanitized = $values;
|
||||
} else {
|
||||
@@ -397,7 +396,7 @@ class ApiClient {
|
||||
$deserialized = $values;
|
||||
} elseif ($class == 'DateTime') {
|
||||
$deserialized = new \DateTime($data);
|
||||
} elseif (in_array($class, array('string', 'int', 'float', 'double', 'bool'))) {
|
||||
} elseif (in_array($class, array('string', 'int', 'float', 'double', 'bool', 'object'))) {
|
||||
settype($data, $class);
|
||||
$deserialized = $data;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user