Skip to content

Commit

Permalink
Expose the fields from MuteTimeInterval in JSON correctly
Browse files Browse the repository at this point in the history
Before this PR, when marshalling to JSON, the go variable name would be taken (respective 'Name' and 'TimeIntervals') as JSON field name. With this PR we take instead the same name as for the YAML fields as everywhere else in the configuration.

Signed-off-by: Jean-Philippe Quémémer <jeanphilippe.quemener@grafana.com>
  • Loading branch information
JohnnyQQQQ committed Nov 10, 2021
1 parent 5b825e2 commit bc29986
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ func resolveFilepaths(baseDir string, cfg *Config) {

// MuteTimeInterval represents a named set of time intervals for which a route should be muted.
type MuteTimeInterval struct {
Name string `yaml:"name"`
TimeIntervals []timeinterval.TimeInterval `yaml:"time_intervals"`
Name string `yaml:"name" json:"name"`
TimeIntervals []timeinterval.TimeInterval `yaml:"time_intervals" json:"time_intervals"`
}

// UnmarshalYAML implements the yaml.Unmarshaler interface for MuteTimeInterval.
Expand Down

0 comments on commit bc29986

Please sign in to comment.