Skip to content

v4.0.12: GetCampaignRecipients invalid typing #128

@maallard

Description

@maallard

Hello again,

Like in the issue I reported two weeks ago, I found a discreprancy between what the REST API can return and the typings in the SDK.

When calling GET https://api.brevo.com/v3/smsCampaigns/:campaignId, the API returns :

{
  "id": 31,
  "recipients": {
    "lists": [
      {
        "id": 33,
        "name": "List #1"
      }
    ],
  },
}

However the SDK only allows an array of ints for GetCampaignRecipients::lists

class GetCampaignRecipients extends JsonSerializableType
{
    #[JsonProperty('lists'), ArrayType(['integer'])] // should probably allow array as the API can return JSON objects 
    public array $lists;
...
}

Thus calling SmsCampaignsClient::getSmsCampaigns throws a BrevoException with the following message: Failed to deserialize response: Unable to deserialize value of type 'array' as 'integer'.

We do not use exclusion lists but I guess the issue is probably also there for GetCampaignRecipients::$exclusionLists.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions