forked from loafle/openapi-generator-original
add binary support for php response
This commit is contained in:
@@ -230,7 +230,7 @@ class ApiClient
|
||||
throw new ApiException("API call to $url timed out: ".serialize($response_info), 0, null, null);
|
||||
} elseif ($response_info['http_code'] >= 200 && $response_info['http_code'] <= 299 ) {
|
||||
// return raw body if response is a file
|
||||
if ($responseType == '\SplFileObject') {
|
||||
if ($responseType == '\SplFileObject' || $responseType == 'ByteArray') {
|
||||
return array($http_body, $response_info['http_code'], $http_header);
|
||||
}
|
||||
|
||||
|
||||
@@ -241,6 +241,8 @@ class ObjectSerializer
|
||||
$values[] = $this->deserialize($value, $subClass);
|
||||
}
|
||||
$deserialized = $values;
|
||||
} elseif ($class === 'ByteArray') { // byte array
|
||||
$deserialized = unpack('C*', (string)$data);
|
||||
} elseif ($class === '\DateTime') {
|
||||
$deserialized = new \DateTime($data);
|
||||
} elseif (in_array($class, array({{&primitives}}))) {
|
||||
|
||||
Reference in New Issue
Block a user