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

Segment Type contains incorrect ID type string instead of int #68

Open
khaled-bionews opened this issue Feb 26, 2025 · 1 comment
Open

Comments

@khaled-bionews
Copy link

khaled-bionews commented Feb 26, 2025

The API response from Mailchimp for segments returns the Segment Id as a type Integer (https://mailchimp.com/developer/marketing/api/list-segments/list-segments/) but the Segment struct contains a type string for the ID. This causes an unrecoverable error when fetching segments via the GetSegments function of the ListReponse during the json unmarshaling process, specifically: Error getting segments: json: cannot unmarshal number into Go struct field Segment.segments.id of type string.

@khaled-bionews
Copy link
Author

khaled-bionews commented Feb 26, 2025

This is fixed via #59 but was never merged and the issue persists in the current version of Segments.go.

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