Open mario-fehr opened 9 months ago
I am receiving a similar error as well for the following api call through the sdk:
$apiResponse = $client->marketing()->forms()->formsApi()->getPage();
Similar error here when calling:
$forms = $this->hubspot->marketing()->forms()->FormsApi()->getPage();
Here is the error:
{
"title": "InvalidArgumentException",
"type": "InvalidArgumentException",
"code": 500,
"message": "Invalid value 'dropdown' for 'field_type', must be one of 'payment_link_radio'",
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/Model/DependentFieldDependentField.php",
"line": 369,
"trace": [
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/ObjectSerializer.php",
"line": 478,
"function": "setFieldType",
"class": "HubSpot\\Client\\Marketing\\Forms\\Model\\DependentFieldDependentField",
"type": "->"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/ObjectSerializer.php",
"line": 369,
"function": "deserialize",
"class": "HubSpot\\Client\\Marketing\\Forms\\ObjectSerializer",
"type": "::"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/ObjectSerializer.php",
"line": 478,
"function": "deserialize",
"class": "HubSpot\\Client\\Marketing\\Forms\\ObjectSerializer",
"type": "::"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/ObjectSerializer.php",
"line": 369,
"function": "deserialize",
"class": "HubSpot\\Client\\Marketing\\Forms\\ObjectSerializer",
"type": "::"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/ObjectSerializer.php",
"line": 478,
"function": "deserialize",
"class": "HubSpot\\Client\\Marketing\\Forms\\ObjectSerializer",
"type": "::"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/ObjectSerializer.php",
"line": 369,
"function": "deserialize",
"class": "HubSpot\\Client\\Marketing\\Forms\\ObjectSerializer",
"type": "::"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/ObjectSerializer.php",
"line": 478,
"function": "deserialize",
"class": "HubSpot\\Client\\Marketing\\Forms\\ObjectSerializer",
"type": "::"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/Api/FormsApi.php",
"line": 1067,
"function": "deserialize",
"class": "HubSpot\\Client\\Marketing\\Forms\\ObjectSerializer",
"type": "::"
},
{
"file": "/home/xxx/Sites/xxx/vendor/hubspot/api-client/codegen/Marketing/Forms/Api/FormsApi.php",
"line": 998,
"function": "getPageWithHttpInfo",
"class": "HubSpot\\Client\\Marketing\\Forms\\Api\\FormsApi",
"type": "->"
},
workaround:
$response = $this->hubspot->apiRequest([
'path' => '/marketing/v3/forms/',
]);
$forms = json_decode($response->getBody());
Same error with version 11.1.0 :(
Receiving the same error when calling
$client->marketing()->forms()->formsApi()->create(/* my data*/);
It's produce the following
PHP Fatal error: Uncaught InvalidArgumentException: Invalid value 'email' for 'field_type', must be one of 'payment_link_radio' in /var/www/sc/sdk/vendor/hubspot/api-client/codegen/Marketing/Forms/Model/DependentFieldDependentField.php:472
Although the form successfully created on HubSpot. Just weird fatal error that can't be caught in catch :(
Any updates on this?
Looks like something is wrong with the "oneOf" shema mapping for the "field_types" at the marketing form apis.