go-datadog-api
go-datadog-api copied to clipboard
Allow both int and string in more places
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.
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)
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.
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.
As far as I'm concerned this is now done, all the screenboards from my project work now.
Thanks @mrwonko! I'll have some time to review and hopefully merge tomorrow.
@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, @mrwonko What is the status update of this? would this fix https://github.com/terraform-providers/terraform-provider-datadog/issues/105?
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.
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.
@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?
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.