mailerlite / mailerlite-go

Go SDK for MailerLite
MIT License
3 stars 3 forks source link

Error unmarshaling campaign list -- wrong type for 'settings' field #9

Closed jtarrio closed 1 year ago

jtarrio commented 1 year ago

Calling the client.Campaign.List method results in the following error:

json: cannot unmarshal array into Go struct field Campaign.data.settings of type mailerlite.CampaignSettings

The API version that the client specifies (2022-12-01) causes the server to return an array for the 'settings' field of a campaign, while the client expects an object. (It looks like the server started returning an object instead of an array at version 2023-01-11).

robgordon89 commented 1 year ago

this should now be resolved in the latest version, please confirm.

jtarrio commented 1 year ago

Yes, that seems to have worked.