Skip to content

Commit 02f386d

Browse files
committed
fix: OrganizationRepository.ExternalSlug uses json.RawMessage
1 parent 4fab489 commit 02f386d

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

sentry/organization_repositories.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sentry
22

33
import (
44
"context"
5+
"encoding/json"
56
"fmt"
67
"time"
78
)
@@ -22,7 +23,8 @@ type OrganizationRepository struct {
2223
Status string `json:"status"`
2324
DateCreated time.Time `json:"dateCreated"`
2425
IntegrationId string `json:"integrationId"`
25-
ExternalSlug string `json:"externalSlug"`
26+
ExternalSlug json.RawMessage `json:"externalSlug"`
27+
ExternalId string `json:"externalId"`
2628
}
2729

2830
// OrganizationRepositoriesService provides methods for accessing Sentry organization repositories API endpoints.

sentry/organization_repositories_test.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package sentry
22

33
import (
44
"context"
5+
"encoding/json"
56
"fmt"
67
"net/http"
78
"testing"
@@ -29,7 +30,8 @@ func TestOrganizationRepositoriesService_List(t *testing.T) {
2930
"status": "active",
3031
"dateCreated": "2022-08-15T06:31:49.817916Z",
3132
"integrationId": "123456",
32-
"externalSlug": "aht4davchml6srhh6mvthluoscl2lzmi"
33+
"externalSlug": "aht4davchml6srhh6mvthluoscl2lzmi",
34+
"externalId": "123456"
3335
}
3436
]`)
3537
})
@@ -54,7 +56,8 @@ func TestOrganizationRepositoriesService_List(t *testing.T) {
5456
Status: "active",
5557
DateCreated: mustParseTime("2022-08-15T06:31:49.817916Z"),
5658
IntegrationId: "123456",
57-
ExternalSlug: "aht4davchml6srhh6mvthluoscl2lzmi",
59+
ExternalSlug: json.RawMessage(`"aht4davchml6srhh6mvthluoscl2lzmi"`),
60+
ExternalId: "123456",
5861
},
5962
}
6063
assert.Equal(t, expected, repos)
@@ -79,7 +82,8 @@ func TestOrganizationRepositoriesService_Create(t *testing.T) {
7982
"status": "active",
8083
"dateCreated": "2022-08-15T06:31:49.817916Z",
8184
"integrationId": "123456",
82-
"externalSlug": "aht4davchml6srhh6mvthluoscl2lzmi"
85+
"externalSlug": "aht4davchml6srhh6mvthluoscl2lzmi",
86+
"externalId": "123456"
8387
}`)
8488
})
8589

@@ -102,7 +106,8 @@ func TestOrganizationRepositoriesService_Create(t *testing.T) {
102106
Status: "active",
103107
DateCreated: mustParseTime("2022-08-15T06:31:49.817916Z"),
104108
IntegrationId: "123456",
105-
ExternalSlug: "aht4davchml6srhh6mvthluoscl2lzmi",
109+
ExternalSlug: json.RawMessage(`"aht4davchml6srhh6mvthluoscl2lzmi"`),
110+
ExternalId: "123456",
106111
}
107112
assert.Equal(t, expected, repo)
108113
}
@@ -128,7 +133,8 @@ func TestOrganizationRepositoriesService_Delete(t *testing.T) {
128133
"status": "pending_deletion",
129134
"dateCreated": "2022-08-15T06:31:49.817916Z",
130135
"integrationId": "123456",
131-
"externalSlug": "aht4davchml6srhh6mvthluoscl2lzmi"
136+
"externalSlug": "aht4davchml6srhh6mvthluoscl2lzmi",
137+
"externalId": "123456"
132138
}`)
133139
})
134140

@@ -146,7 +152,8 @@ func TestOrganizationRepositoriesService_Delete(t *testing.T) {
146152
Status: "pending_deletion",
147153
DateCreated: mustParseTime("2022-08-15T06:31:49.817916Z"),
148154
IntegrationId: "123456",
149-
ExternalSlug: "aht4davchml6srhh6mvthluoscl2lzmi",
155+
ExternalSlug: json.RawMessage(`"aht4davchml6srhh6mvthluoscl2lzmi"`),
156+
ExternalId: "123456",
150157
}
151158
assert.Equal(t, expected, repo)
152159
}

0 commit comments

Comments
 (0)