Skip to content

Commit

Permalink
remove omit empty to expose default keyspace id (tikv#13) (tikv#25)
Browse files Browse the repository at this point in the history
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Co-authored-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
  • Loading branch information
disksing and AmoebaProtozoa authored Feb 13, 2023
1 parent 6756faa commit c15f1a6
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 c15f1a6

Please sign in to comment.