HubSpot / hubspot-api-php

HubSpot API PHP Client Libraries for V3 version of the API
Apache License 2.0
195 stars 82 forks source link

Invalid value "email" for "field_type", must one of "payment_link_radio" error #294

Open mario-fehr opened 9 months ago

mario-fehr commented 9 months ago

image

Looks like something is wrong with the "oneOf" shema mapping for the "field_types" at the marketing form apis.

paulknisely commented 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();
image
muncherelli commented 8 months ago

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": "->"
        },
muncherelli commented 8 months ago

workaround:

$response = $this->hubspot->apiRequest([
    'path' => '/marketing/v3/forms/',
]);
$forms = json_decode($response->getBody());
dimitriBouteille commented 6 months ago

Same error with version 11.1.0 :(

utilmind commented 5 months ago

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 :(

boboldehampsink commented 1 month ago

Any updates on this?