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

Screenboard width and height should stay as type string #192

Open
masci opened this issue Nov 13, 2018 · 2 comments
Open

Screenboard width and height should stay as type string #192

masci opened this issue Nov 13, 2018 · 2 comments

Comments

@masci
Copy link

masci commented Nov 13, 2018

Hi all,

#190 changed the type for Screenboard.Height and Screenboard.Width from *string to *int (see https://github.com/zorkian/go-datadog-api/pull/190/files#diff-7d71d2abb56836dce85c7c7b114c80dcL20) but I believe they should stay as strings, at least width since it can be something like "100%".

@nyanshak
Copy link
Collaborator

I agree that *int is not the right type, but I think *string is also not the right type. I think *json.Number is appropriate as it will accept strings such as "1", "100%", but also numbers such as 1 or 1.1. Would you mind updating this PR to use *json.Number instead?

masterzen pushed a commit to masterzen/go-datadog-api that referenced this issue Nov 16, 2018
Datadog API for screenboards width and height can return either numbers
, number (like “1024”) strings or even strings (like “100%”).
The recent fix zorkian#190 changed those fields to be only ints, breaking
the compatibility with some datadog screen boards.
As suggested in zorkian#192 this change fixes the issue by making the fields
become `json.Number` which should cover all possible returned values.
@mrwonko
Copy link

mrwonko commented Mar 1, 2019

So it looks like this was supposed to be fixed by #195, which in turn was supposed to be based on #198, both of which are now closed without further explanation? I'll create a new pull request combining those two closed requests.

mrwonko added a commit to mrwonko/go-datadog-api that referenced this issue Mar 1, 2019
Besides integer sizes in pixel (e.g. 768) the API can also return percentages
(e.g. "100%").

Fixes zorkian#192
mrwonko added a commit to mrwonko/go-datadog-api that referenced this issue Mar 1, 2019
Besides integer sizes in pixel (e.g. 768) the API can also return percentages
(e.g. "100%").

Fixes zorkian#192
mrwonko added a commit to mrwonko/go-datadog-api that referenced this issue Mar 4, 2019
Besides integer sizes in pixel (e.g. 768) the API can also return percentages
(e.g. "100%").

Fixes zorkian#192
masterzen pushed a commit to masterzen/go-datadog-api that referenced this issue Sep 6, 2019
Besides integer sizes in pixel (e.g. 768) the API can also return percentages
(e.g. "100%").

Fixes zorkian#192
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants