Make sure we omit the Kind value in JSON if empty

This commit is contained in:
Matt Keeler 2018-06-21 11:17:17 -04:00 committed by Jack Pearkes
parent 2f90768662
commit 8b27c3268a
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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