From 79440006252e6edc4b1aacdaae09ce21b46693b7 Mon Sep 17 00:00:00 2001 From: disksing Date: Mon, 13 Feb 2023 16:40:02 +0800 Subject: [PATCH] keyspace: remove omit empty to expose default keyspace id (#5972) ref tikv/pd#4399 Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com> Signed-off-by: disksing Co-authored-by: Ti Chi Robot --- server/apiv2/handlers/keyspace.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/apiv2/handlers/keyspace.go b/server/apiv2/handlers/keyspace.go index 5facbf5d465..b2124807a09 100644 --- a/server/apiv2/handlers/keyspace.go +++ b/server/apiv2/handlers/keyspace.go @@ -326,7 +326,7 @@ type KeyspaceMeta struct { // 1. Keyspace State are marshaled to their corresponding name for better readability. func (meta *KeyspaceMeta) MarshalJSON() ([]byte, error) { return json.Marshal(&struct { - ID uint32 `json:"id,omitempty"` + ID uint32 `json:"id"` Name string `json:"name,omitempty"` State string `json:"state,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` @@ -345,7 +345,7 @@ func (meta *KeyspaceMeta) MarshalJSON() ([]byte, error) { // UnmarshalJSON reverse KeyspaceMeta's the Custom JSON marshal. func (meta *KeyspaceMeta) UnmarshalJSON(data []byte) error { aux := &struct { - ID uint32 `json:"id,omitempty"` + ID uint32 `json:"id"` Name string `json:"name,omitempty"` State string `json:"state,omitempty"` CreatedAt int64 `json:"created_at,omitempty"`