Skip to content

Commit

Permalink
Fixes #7177
Browse files Browse the repository at this point in the history
  • Loading branch information
e-dard committed Aug 19, 2016
1 parent 9b28f77 commit 1d7990f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ With this release the systemd configuration files for InfluxDB will use the syst
- [#7125](https://github.com/influxdata/influxdb/pull/7125): Ensure gzip writer is closed in influx_inspect export
- [#7127](https://github.com/influxdata/influxdb/pull/7127): Concurrent series limit
- [#7119](https://github.com/influxdata/influxdb/pull/7119): Fix CREATE DATABASE when dealing with default values.
- [#7177](https://github.com/influxdata/influxdb/issues/7177): Fix base64 encoding issue with /debug/vars tags.

## v0.13.0 [2016-05-12]

Expand Down
17 changes: 17 additions & 0 deletions models/points.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package models // import "github.com/influxdata/influxdb/models"
import (
"bytes"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
"hash/fnv"
Expand Down Expand Up @@ -1396,6 +1397,22 @@ type Tag struct {
Value []byte
}

// MarshalJSON implements the json.Marshaler interface.
//
// When Tags are marshalled to a JSON representation it is helpful if they're
// represented as readable strings, rather than the base64 encoded strings which
// are emitted when encoding a []byte.
func (t Tag) MarshalJSON() ([]byte, error) {
var out = struct {
Key string `json:"key"`
Value string `json:"value"`
}{
Key: string(t.Key),
Value: string(t.Value),
}
return json.Marshal(out)
}

// Tags represents a sorted list of tags.
type Tags []Tag

Expand Down

0 comments on commit 1d7990f

Please sign in to comment.