adlio / trello

Trello API wrapper for Go
MIT License
219 stars 71 forks source link

fix: change products and powerups type in organization struct #95

Closed kolaente closed 4 months ago

kolaente commented 4 months ago

It looks like Trello changed this from a string value to an integer. I searched around in their api docs but couldn't really find anything about this so I just assumed int (not uint, int64, etc).

Before this patch, I got an error message like this:


JSON decode failed on https://api.trello.com/1/organizations/<uuuid>
{"id":"uuuid","name":"lorem-ipsum","displayName":"Lorem Ipsum","desc":"","descData":{"emoji":{}},"url":"https://trello.com/w/lorem-ipsum","website":"http://example.com/","teamType":null,"logoHash":"affffe","logoUrl":"https://trello-logos.s3.amazonaws.com/some-uid","offering":"trello.business_class","products":[110],"powerUps":[110]}: json: cannot unmarshal number into Go struct field Organization.products of type string
adlio commented 4 months ago

Hey, thanks for the contribution! I'm looking to do some updates soon and am happy to accept. I see there is test coverage over this type already, but the tests all had an empty array for powerUps. Would you mind adding tests with realistic data?

kolaente commented 4 months ago

Added some, is that what you had in mind?