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

Marker label can be bool #220

Open
mrwonko opened this issue Mar 1, 2019 · 0 comments
Open

Marker label can be bool #220

mrwonko opened this issue Mar 1, 2019 · 0 comments

Comments

@mrwonko
Copy link

mrwonko commented Mar 1, 2019

TileDefMarker.Label is a *string, but for one of my screenboards Datadog returns true, which results in this error:

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

Here's an excerpt of the screenboard that caused this:

{
	"board_title": "anonymized",
	"read_only": false,
	"author_info": {
		"author_name": "anonymous"
	},
	"description": "",
	"board_bgtype": "board_graph",
	"created": "2019-02-19T13:47:39.808958+00:00",
	"created_by": {
		"disabled": false,
		"handle": "anonymous",
		"name": "anonymous",
		"is_admin": false,
		"role": null,
		"access_role": "st",
		"verified": true,
		"email": "anonymous",
		"icon": "https://secure.gravatar.com/avatar/42?s=48&d=retro"
	},
	"new_id": "ano-nym-ous",
	"modified": "2019-02-27T15:50:13.939611+00:00",
	"originalHeight": 80,
	"height": 80,
	"width": "100%",
	"isIntegration": false,
	"disableEditing": false,
	"originalWidth": "100%",
	"widgets": [
		{
			"board_id": 585431,
			"globalTimeframe": {
				"isLive": true,
				"start": 1551278820000,
				"end": 1551282420000
			},
			"title_align": "left",
			"title_size": 16,
			"title": true,
			"generated_title": "anonymized",
			"title_text": "anonymized",
			"height": 13,
			"tile_def": {
				"viz": "timeseries",
				"requests": [
					{
						"q": "sum:anonymized.as_count()",
						"aggregator": "avg",
						"style": {
							"width": "normal",
							"palette": "dog_classic",
							"type": "solid"
						},
						"type": "line",
						"conditional_formats": []
					}
				],
				"autoscale": true,
				"markers": [
					{
						"type": "info bold",
						"val": "0",
						"value": "y = 0",
						"label": true
					}
				]
			},
			"width": 47,
			"time": {},
			"y": 2,
			"x": 48,
			"legend_size": "0",
			"add_timeframe": true,
			"type": "timeseries",
			"legend": false,
			"isShared": false
		}
	],
	"disableCog": false,
	"id": 42,
	"isShared": false
}
mrwonko added a commit to mrwonko/go-datadog-api that referenced this issue Mar 4, 2019
This introduces a new type StrBoolD (similar to StrIntD) for types that can be
either strings or bools in JSON.

Fixes zorkian#220
masterzen pushed a commit to masterzen/go-datadog-api that referenced this issue Sep 6, 2019
This introduces a new type StrBoolD (similar to StrIntD) for types that can be
either strings or bools in JSON.

Fixes zorkian#220
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

No branches or pull requests

1 participant