atlassian / atlassian/go-sentry-api

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

Open
#40 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
55
Forks
45
PR merge metrics
No merged PRs in 30d

Description

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:

```json
"metadata": {
"display_title_with_tree_label": false
}
```

This change resolves the error:
> Metadata *map[string]interface{} `json:"metadata,omitempty"`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at the Event struct and the GetProjectEvent entry point, then reproduce the response containing a boolean value in metadata. Confirm that the event response unmarshals without the reported type error and that existing metadata behavior remains intact.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.