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

Fixes inconsistent API typing for sub_type #8

Merged
merged 1 commit into from
Nov 3, 2018

Conversation

leucos
Copy link
Contributor

@leucos leucos commented Nov 3, 2018

UptimeRobot API returns inconsistent types on sub_type (just like keyword_type).
This is addressed using interface{} instead of int

A test case has been added.

Should fix #5

UptimeRobot API returns inconsistent types on sub_type (just like keyword_type).
This is addressed using interface{} instead of int
@bitfield
Copy link
Owner

bitfield commented Nov 3, 2018

Fantastic! Thanks for the PR.

As I expect you know, the problem with keyword_type and sub_type is that when they're set, they're integers, but when they're not set, they're returned as an empty string. I suspect the JSON parsing libraries in other languages are less strict than Go (see golang/go#22182), and can cope with this, but nonetheless, the API should return a consistent type (probably null if it's unset).

I've contacted Uptime Robot about this, but evidently they haven't fixed it yet.

@bitfield bitfield merged commit 285bb82 into bitfield:master Nov 3, 2018
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

Successfully merging this pull request may close these issues.

Issue when use monitors command
2 participants