From 163fe11101f8617aa028419a5b0b4e5946729173 Mon Sep 17 00:00:00 2001 From: Matt Keeler Date: Thu, 21 Jun 2018 11:17:17 -0400 Subject: [PATCH] Make sure we omit the Kind value in JSON if empty --- agent/structs/service_definition.go | 2 +- agent/structs/structs.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/agent/structs/service_definition.go b/agent/structs/service_definition.go index e2eea181d0..d8e416af7e 100644 --- a/agent/structs/service_definition.go +++ b/agent/structs/service_definition.go @@ -14,7 +14,7 @@ import ( // ServiceDefinition is used to JSON decode the Service definitions. For // documentation on specific fields see NodeService which is better documented. type ServiceDefinition struct { - Kind ServiceKind + Kind ServiceKind `json:",omitempty"` ID string Name string Tags []string diff --git a/agent/structs/structs.go b/agent/structs/structs.go index 2cc75e1e96..7b719405a4 100644 --- a/agent/structs/structs.go +++ b/agent/structs/structs.go @@ -512,7 +512,7 @@ type NodeService struct { // Kind is the kind of service this is. Different kinds of services may // have differing validation, DNS behavior, etc. An empty kind will default // to the Default kind. See ServiceKind for the full list of kinds. - Kind ServiceKind + Kind ServiceKind `json:",omitempty"` ID string Service string