Skip to content

Issue Annotations can be more than just string #56

@xescugc

Description

@xescugc

The error is json: cannot unmarshal object into Go struct field Issue.annotations of type string and if I output the raw JSON from Sentry I can see that some issues have an annotations:[{}](with content inside, not just empty hehe) so basically can also have an object inside.

I can fix this by just doing:

diff --git a/issue.go b/issue.go
index b1986ef..1a83f10 100644
--- a/issue.go
+++ b/issue.go
@@ -82,7 +82,7 @@ type Activity struct {
 
 // Issue returns a issue found in sentry
 type Issue struct {
-       Annotations         *[]string               `json:"annotations,omitempty"`
+       Annotations         *[]interface{}          `json:"annotations,omitempty"`
        AssignedTo          *InternalUser           `json:"assignedTo,omitempty"`
        Activity            *[]Activity             `json:"activity,omitempty"`
        Count               *string                 `json:"count,omitempty"`

But when I tried to test it I could not find a way to actually inject the Annotations.

The fix is easy but also it's a change of type so it'll not be backwards compatible also.

What would be the right process to fix this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions