go-datadog-api icon indicating copy to clipboard operation
go-datadog-api copied to clipboard

Allow both int and string in more places

Open mrwonko opened this issue 6 years ago • 11 comments

This is basically a combination of the apparently abandoned #198 and #195 with some additional cleanup and added tests. The goal is fixing #192.

With the fixes in place I noticed additional type mismatches for Params.Count, Params.Start and ConditionalFormat.Value, which I fixed in the same way.

mrwonko avatar Mar 01 '19 14:03 mrwonko

Still need to fix

json: cannot unmarshal bool into Go struct field TileDefStyle.paletteFlip of type string

json: cannot unmarshal string into Go struct field Widget.alert_id of type int

and maybe #220:

json: cannot unmarshal bool into Go struct field TileDefMarker.label of type string

(althought that one doesn't block me quite as much)

mrwonko avatar Mar 01 '19 16:03 mrwonko

Still need to fix

json: cannot unmarshal bool into Go struct field TileDefStyle.paletteFlip of type string

json: cannot unmarshal string into Go struct field Widget.alert_id of type int

and maybe #220:

json: cannot unmarshal bool into Go struct field TileDefMarker.label of type string

(althought that one doesn't block me quite as much)

@mrwonko thanks so much for all this work! If you are happy to address those issues too, that would be fantastic.

ojongerius avatar Mar 03 '19 22:03 ojongerius

Still need to fix

json: cannot unmarshal bool into Go struct field TileDefStyle.paletteFlip of type string

json: cannot unmarshal string into Go struct field Widget.alert_id of type int

and maybe #220:

json: cannot unmarshal bool into Go struct field TileDefMarker.label of type string

(althought that one doesn't block me quite as much)

@mrwonko thanks so much for all this work! If you are happy to address those issues too, that would be fantastic.

Will do, I just ran out of time on Friday.

mrwonko avatar Mar 04 '19 08:03 mrwonko

As far as I'm concerned this is now done, all the screenboards from my project work now.

mrwonko avatar Mar 05 '19 13:03 mrwonko

Thanks @mrwonko! I'll have some time to review and hopefully merge tomorrow.

ojongerius avatar Mar 05 '19 19:03 ojongerius

@masci as a Datadog employee with most likely more insight in your API, what is your opinion on this?

While I very much appreciate the library working around quirks of the DD API, it is becoming so inconsistent. I'd hate to continue to introduce breaking changes each time people find them.

Any ideas on a structural approach to this problem, @mrwonko, @masci. @nyanshak, @yfronto or @zorkian, care to think along?

ojongerius avatar Mar 07 '19 02:03 ojongerius

@ojongerius, @mrwonko What is the status update of this? would this fix https://github.com/terraform-providers/terraform-provider-datadog/issues/105?

facundovictor avatar Jun 05 '19 23:06 facundovictor

Hey @ojongerius From Datadog here. I've communicated internally to put these issues on the radar but don't have any timeframes for when a longer term fix would be possible unfortunately.

I'm in favor of pushing this forward if you are, to resolve the existing issues people are facing.

nmuesch avatar Jun 06 '19 18:06 nmuesch

Is this PR still likely to get merged? Just ran into the json: cannot unmarshal number into Go struct field Params.widgets.params.count of type string error today when trying to update a screen board widget programmatically.

ryanschneider avatar Oct 31 '19 23:10 ryanschneider

@ojongerius Also wondering what the status on this one is as it seems to have been dormant for >9 months now? Ran into the problem today as I'm no longer able to update a screenboard with container tiles using the terraform provider due to the error err: json: cannot unmarshal bool into Go struct field TileDefStyle.paletteFlip of type string. Any chance this will be merged at some point?

onematchfox avatar Dec 11 '19 14:12 onematchfox

It seems everybody is in favor, I am not sure to understand why this is not merged @ojongerius Note: It also seems this relates with my current opened PR: https://github.com/zorkian/go-datadog-api/pull/325.

afarbos avatar Jun 25 '20 18:06 afarbos