Skip to content

Commit

Permalink
Ommit Dashboard's summarization field when empty.
Browse files Browse the repository at this point in the history
- This prevents the following API error when the field is omitted from
  the json object:
  ```
  Cannot deserialize value of type `sunnylabs.query.SummarizationStrategy` from String \"\":  was not one of [MEAN, MEDIAN, MIN, MAX, SUM, COUNT, LAST, FIRST, ANOMALOUS]
  ```

Signed-off-by: Brendan Winter <[email protected]>
  • Loading branch information
bwinter committed Aug 1, 2023
1 parent 5b681e8 commit 0e6647d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
# Changelog

Changelog for go-wavefront-management-api.

## [2.1.0]

- Dashboard object to omit chart `summarization` field when empty.
- Helps prevent the following API error when it is not included in the JSON body:
```text
Cannot deserialize value of type `sunnylabs.query.SummarizationStrategy` from String \"\": was not one of [MEAN, MEDIAN, MIN, MAX, SUM, COUNT, LAST, FIRST, ANOMALOUS]
```
## [2.0.0]
Breaking Change:
Expand Down
2 changes: 1 addition & 1 deletion dashboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ type Chart struct {
NoDefaultEvents bool `json:"noDefaultEvents"`

// Strategy to use when aggregating metric points (LAST, AVERAGE, COUNT, etc)
Summarization string `json:"summarization"`
Summarization string `json:"summarization,omitempty"`

// Sources is an Array of Source
Sources []Source `json:"sources"`
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.0
2.1.0

0 comments on commit 0e6647d

Please sign in to comment.