Bug Report
Package: hubspot/api-client
Version: 14.0.5
File: codegen/Crm/Objects/Api/BatchApi.php
Description
The createWithHttpInfo method (and likely its async counterpart) only handles
HTTP 200 as a successful response in its status-code switch. However, the
HubSpot API returns 201 Created for batch-create operations.
Because 201 is not matched by case 200:, it falls through to default:,
which deserializes the response body as an Error model instead of
BatchResponseSimplePublicObject. This causes callers to receive an Error
object even when the request succeeded.
Affected code (line 448 ff.)
switch($statusCode) {
case 200:
return $this->handleResponseWithDataType(
'\HubSpot\Client\Crm\Objects\Model\BatchResponseSimplePublicObject',
$request,
$response,
);
default:
return $this->handleResponseWithDataType(
'\HubSpot\Client\Crm\Objects\Model\Error',
$request,
$response,
);
}
Expected behaviour
A 201 response should be treated as success and deserialized as
BatchResponseSimplePublicObject, the same way 200 currently is.
Bug Report
Package:
hubspot/api-clientVersion: 14.0.5
File:
codegen/Crm/Objects/Api/BatchApi.phpDescription
The
createWithHttpInfomethod (and likely its async counterpart) only handlesHTTP
200as a successful response in its status-code switch. However, theHubSpot API returns
201 Createdfor batch-create operations.Because
201is not matched bycase 200:, it falls through todefault:,which deserializes the response body as an
Errormodel instead ofBatchResponseSimplePublicObject. This causes callers to receive anErrorobject even when the request succeeded.
Affected code (line 448 ff.)
Expected behaviour
A 201 response should be treated as success and deserialized as
BatchResponseSimplePublicObject, the same way 200 currently is.