Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 11 datetime parse error #75

Open
kt-repp opened this issue Feb 11, 2025 · 1 comment
Open

Laravel 11 datetime parse error #75

kt-repp opened this issue Feb 11, 2025 · 1 comment

Comments

@kt-repp
Copy link

kt-repp commented Feb 11, 2025

When trying to list or show specific whatsapp template, runtime halts with error:

[2025-02-11 07:22:22] local.ERROR: Parsing datetime string "2025-02-10T12:27:27.765995100Z" using format "Y-m-d\TH:i:s.vP" resulted in 1 errors: 
at position 23: The timezone could not be found in the database {"exception":"[object] (Symfony\\Component\\Serializer\\Exception\\NotNormalizableValueException(code: 0): Parsing datetime string \"2025-02-10T12:27:27.765995100Z\" using format \"Y-m-d\\TH:i:s.vP\" resulted in 1 errors: 
at position 23: The timezone could not be found in the database at /var/www/html/vendor/symfony/serializer/Exception/NotNormalizableValueException.php:32)
[stacktrace]
#0 /var/www/html/vendor/symfony/serializer/Normalizer/DateTimeNormalizer.php(120): Symfony\\Component\\Serializer\\Exception\\NotNormalizableValueException::createForUnexpectedDataType('Parsing datetim...', '2025-02-10T12:2...', Array, 'createdAt', true)
#1 /var/www/html/vendor/symfony/serializer/Serializer.php(240): Symfony\\Component\\Serializer\\Normalizer\\DateTimeNormalizer->denormalize('2025-02-10T12:2...', 'DateTime', 'json', Array)
#2 /var/www/html/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php(837): Symfony\\Component\\Serializer\\Serializer->denormalize('2025-02-10T12:2...', 'DateTime', 'json', Array)
#3 /var/www/html/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php(938): Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer->validateAndDenormalize(Object(Symfony\\Component\\TypeInfo\\Type\\NullableType), 'Infobip\\\\Model\\\\W...', 'createdAt', '2025-02-10T12:2...', 'json', Array)
#4 /var/www/html/vendor/symfony/serializer/Normalizer/AbstractNormalizer.php(374): Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer->denormalizeParameter(Object(ReflectionClass), Object(ReflectionParameter), 'createdAt', '2025-02-10T12:2...', Array, 'json')
#5 /var/www/html/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php(243): Symfony\\Component\\Serializer\\Normalizer\\AbstractNormalizer->instantiateObject(Array, '\\\\Infobip\\\\Model\\\\...', Array, Object(ReflectionClass), false, 'json')
#6 /var/www/html/vendor/symfony/serializer/Normalizer/AbstractObjectNormalizer.php(339): Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer->instantiateObject(Array, '\\\\Infobip\\\\Model\\\\...', Array, Object(ReflectionClass), false, 'json')
#7 /var/www/html/vendor/symfony/serializer/Serializer.php(240): Symfony\\Component\\Serializer\\Normalizer\\AbstractObjectNormalizer->denormalize(Array, '\\\\Infobip\\\\Model\\\\...', 'json', Array)
#8 /var/www/html/vendor/symfony/serializer/Serializer.php(145): Symfony\\Component\\Serializer\\Serializer->denormalize(Array, '\\\\Infobip\\\\Model\\\\...', 'json', Array)
#9 /var/www/html/vendor/infobip/infobip-api-php-client/Infobip/ObjectSerializer.php(117): Symfony\\Component\\Serializer\\Serializer->deserialize(Array, '\\\\Infobip\\\\Model\\\\...', 'json', Array)
#10 /var/www/html/vendor/infobip/infobip-api-php-client/Infobip/Api/ApiTrait.php(65): Infobip\\ObjectSerializer->deserialize('{\"id\":\"11141791...', '\\\\Infobip\\\\Model\\\\...', Array)
#11 /var/www/html/vendor/infobip/infobip-api-php-client/Infobip/Api/WhatsAppApi.php(3844): Infobip\\Api\\WhatsAppApi->deserialize(Object(GuzzleHttp\\Psr7\\Stream), '\\\\Infobip\\\\Model\\\\...', Array)
#12 /var/www/html/vendor/infobip/infobip-api-php-client/Infobip/Api/WhatsAppApi.php(3675): Infobip\\Api\\WhatsAppApi->getWhatsappTemplateResponse(Object(GuzzleHttp\\Psr7\\Response), Object(GuzzleHttp\\Psr7\\Uri))
#13 /var/www/html/test-template.php(14): Infobip\\Api\\WhatsAppApi->getWhatsappTemplate('XXXX', 'XXXX')

Sample code to reproduce error:

$configuration = new Configuration(host: "XXX", apiKey: "XXX");
$whatsAppApi = new WhatsAppApi(config: $configuration);
$whatsAppApi->getWhatsAppTemplates(sender: "XXX");

Environment:

PHP 8.3.16 (cli) (built: Jan 17 2025 01:31:10) (NTS)
laravel/framework v11.41.3
symfony/serializer v7.2.3
infobip/infobip-api-php-client v6.2.1
@kt-repp
Copy link
Author

kt-repp commented Feb 13, 2025

Update: at the moment I am using following workaround bc208cf

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant