pipedrive / client-php

Pipedrive API client for PHP
MIT License
48 stars 55 forks source link

FieldTypeAsString not accepted during deserialization #97

Closed Askelkana closed 3 days ago

Askelkana commented 12 months ago

Stack trace:

PHP Fatal error:  Uncaught InvalidArgumentException: Invalid value for enum '\Pipedrive\Model\FieldTypeAsString', must be one of: 'address', 'date', 'daterange', 'double', 'enum', 'monetary', 'org', '
people', 'phone', 'set', 'text', 'time', 'timerange', 'user', 'varchar', 'varchar_auto', 'visible_to' in ...\vendor\pipedrive\pipedrive\lib\ObjectSerializer.php:375
Stack trace:
#0 ...\vendor\pipedrive\pipedrive\lib\ObjectSerializer.php(400): Pipedrive\ObjectSerializer::deserialize('int', '\\Pipedrive\\Mode...', NULL)
#1 ...\vendor\pipedrive\pipedrive\lib\ObjectSerializer.php(287): Pipedrive\ObjectSerializer::deserialize(Object(stdClass), '\\Pipedrive\\Mode...', NULL)
#2 ...\vendor\pipedrive\pipedrive\lib\ObjectSerializer.php(400): Pipedrive\ObjectSerializer::deserialize(Array, '\\Pipedrive\\Mode...', NULL)
#3 ...\vendor\pipedrive\pipedrive\lib\Api\DealFieldsApi.php(1373): Pipedrive\ObjectSerializer::deserialize(Object(stdClass), '\\Pipedrive\\Mode...', Array)
#4 ...\vendor\pipedrive\pipedrive\lib\Api\DealFieldsApi.php(1314): Pipedrive\Api\DealFieldsApi->getDealFieldsWithHttpInfo(0, NULL)
arturludan commented 11 months ago

I have the same problem for field types like 'int', 'picture', 'stage', 'status' and 'varchar_options'.

jonghyeok commented 11 months ago

I also same problem when call getDealFields function.

Use same example code

$apiInstance = new Pipedrive\Api\DealFieldsApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$start = 0; // int | Pagination start
$limit = 100; // int | Items shown per page

try {
    $result = $apiInstance->getDealFields($start,$limit);
    echo '<pre>';
    print_r($result);
    echo '</pre>';
} catch (Exception $e) {
    echo 'Exception when calling DealFieldsApi->getDealFields: ', $e->getMessage(), PHP_EOL;
}

Then code return this error. Exception when calling DealFieldsApi->getDealFields: Invalid value for enum '\Pipedrive\Model\FieldTypeAsString', must be one of: 'address', 'date', 'daterange', 'double', 'enum', 'monetary', 'org', 'people', 'phone', 'set', 'text', 'time', 'timerange', 'user', 'varchar', 'varchar_auto', 'visible_to'

github-actions[bot] commented 2 weeks ago

This issue has been marked as stale due to inactivity. It will be closed in 30 days if no further activity occurs.

s-pogoda commented 3 days ago

Hello @Askelkana @arturludan @jonghyeok,

I'm writing to let you know, that the issue with getting Pipedrive entity fields now fixed in the 7.1.0 version

Sorry for the delayed replay