diff --git a/configuration/configuration.go b/configuration/configuration.go index e7fa4f1c..96aef06d 100644 --- a/configuration/configuration.go +++ b/configuration/configuration.go @@ -1071,9 +1071,7 @@ func (s *SectionParser) statsOptions() interface{} { //nolint:gocognit opt.StatsRefreshDelay = misc.ParseTimeout(v.Delay) } case *stats.ShowNode: - if v.Name != "" { - opt.StatsShowNodeName = misc.StringP(v.Name) - } + opt.StatsShowNodeName = misc.StringP(v.Name) case *stats.URI: if v.Prefix != "" { opt.StatsURIPrefix = v.Prefix diff --git a/models/stats_options.go b/models/stats_options.go index 6ce4e6f8..c7a1ca42 100644 --- a/models/stats_options.go +++ b/models/stats_options.go @@ -82,7 +82,7 @@ type StatsOptions struct { // stats show node name // Pattern: ^[^\s]+$ - StatsShowNodeName *string `json:"stats_show_node_name,omitempty"` + StatsShowNodeName *string `json:"stats_show_node_name"` // stats uri prefix // Pattern: ^[^\s]+$ diff --git a/specification/build/haproxy_spec.yaml b/specification/build/haproxy_spec.yaml index 8ada19c6..1ffc62eb 100644 --- a/specification/build/haproxy_spec.yaml +++ b/specification/build/haproxy_spec.yaml @@ -7556,6 +7556,7 @@ definitions: pattern: ^[^\s]+$ type: string x-nullable: true + x-omitempty: false stats_uri_prefix: pattern: ^[^\s]+$ type: string diff --git a/specification/models/configuration/misc.yaml b/specification/models/configuration/misc.yaml index 5752f7b5..13e125e5 100644 --- a/specification/models/configuration/misc.yaml +++ b/specification/models/configuration/misc.yaml @@ -245,6 +245,7 @@ stats_options: type: string pattern: '^[^\s]+$' x-nullable: true + x-omitempty: false stats_uri_prefix: type: string pattern: '^[^\s]+$'