atlassian / atlassian/go-sentry-api
json: cannot unmarshal bool into Go struct field Event.metadata of type string
- 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