go-sentry-api icon indicating copy to clipboard operation
go-sentry-api copied to clipboard

json: cannot unmarshal bool into Go struct field Event.metadata of type string

Open thnk2wn opened this issue 2 years ago • 0 comments

Executing event, err := client.GetProjectEvent(org, project, eventId) returns this error:

json: cannot unmarshal bool into Go struct field Event.metadata of type string

Event metadata appears to be defined as:

Metadata *map[string]string json:"metadata,omitempty"`

Looking at the response, there can be non string data types like this boolean:

"metadata": {
  "display_title_with_tree_label": false
}

This change resolves the error:

Metadata *map[string]interface{} json:"metadata,omitempty"

thnk2wn avatar Jan 24 '23 15:01 thnk2wn