Schemas: Allow nulls in schema for +/-Infinity types (#70958)

* Add null options and remove veneer attributes

* Generate all code, remove old veneer defs

* Remove now-unnecessary error expect
This commit is contained in:
sam boyer
2023-06-30 18:15:02 +03:00
committed by GitHub
parent ad8211cce7
commit 751b982d9c
8 changed files with 57 additions and 86 deletions
+3 -3
View File
@@ -612,13 +612,13 @@ type RangeMap struct {
// Range to match against and the result to apply when the value is within the range
Options struct {
// Min value of the range. It can be null which means -Infinity
From float64 `json:"from"`
From *float32 `json:"from"`
// Result used as replacement with text and color when the value matches
Result ValueMappingResult `json:"result"`
// Max value of the range. It can be null which means +Infinity
To float64 `json:"to"`
To *float32 `json:"to"`
} `json:"options"`
Type RangeMapType `json:"type"`
}
@@ -866,7 +866,7 @@ type Threshold struct {
// Value represents a specified metric for the threshold, which triggers a visual change in the dashboard when this value is met or exceeded.
// Nulls currently appear here when serializing -Infinity to JSON.
Value float32 `json:"value"`
Value *float32 `json:"value"`
}
// Thresholds configuration for the panel