Skip to content

Commit

Permalink
keyspace: remove omit empty to expose default keyspace id (#5972)
Browse files Browse the repository at this point in the history
ref #4399

Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: disksing <i@disksing.com>

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
  • Loading branch information
disksing and ti-chi-bot authored Feb 13, 2023
1 parent 7acfacb commit 7944000
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/apiv2/handlers/keyspace.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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"`
Expand Down

0 comments on commit 7944000

Please sign in to comment.