ElasticEmail / elasticemail-php

ElasticEmail - the PHP library for the Elastic Email REST API
8 stars 10 forks source link

Uncaught Error: Object of class ElasticEmail\Model\EventType could not be converted to string invendor/guzzlehttp/psr7/src/Query.php:104 #6

Closed oleksandr-mykhailenko closed 3 months ago

oleksandr-mykhailenko commented 1 year ago

When I try to use example of Events Get from your document I get next error

TomasoAlpaka commented 11 months ago

I have encountered the same problem with EventsApi::eventsGet()

In your example and parameter description on https://github.com/ElasticEmail/elasticemail-php/blob/master/docs/Api/EventsApi.md#eventsget is written to send objects as parameters to your API.
Also in EventsApi methods annotation. _E.g.: @parameters EventType[] $eventtypes – Types of Events to return

But when they go through to Guzzle method Query::build(), strings are expected and Uncaught Error stops the script.

Workaround is to send strings to e.g. EventsApi::eventsGet(), but it does not look reliably and violates your annotations.

I am using Elasticemail 4.0.22 and Guzzle 7.8

=> The fix could for backward compatibility be only in adjusting PHPDoc to reality and also examples here on GitHub.

radzawee commented 3 months ago

We have updated our library using the latest OpenAPI Generator, version 7.7.0.