Skip to content

Commit 3b0b32e

Browse files
committed
Remove custom media type for global node IDs
1 parent 2ae5df7 commit 3b0b32e

31 files changed

+178
-182
lines changed

github/gists.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func (s *GistsService) List(ctx context.Context, user string, opt *GistListOptio
115115
}
116116

117117
// TODO: remove custom Accept header when this API fully launches.
118-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
118+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
119119

120120
var gists []*Gist
121121
resp, err := s.client.Do(ctx, req, &gists)
@@ -141,7 +141,7 @@ func (s *GistsService) ListAll(ctx context.Context, opt *GistListOptions) ([]*Gi
141141
}
142142

143143
// TODO: remove custom Accept header when this API fully launches.
144-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
144+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
145145

146146
var gists []*Gist
147147
resp, err := s.client.Do(ctx, req, &gists)
@@ -167,7 +167,7 @@ func (s *GistsService) ListStarred(ctx context.Context, opt *GistListOptions) ([
167167
}
168168

169169
// TODO: remove custom Accept header when this API fully launches.
170-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
170+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
171171

172172
var gists []*Gist
173173
resp, err := s.client.Do(ctx, req, &gists)
@@ -189,7 +189,7 @@ func (s *GistsService) Get(ctx context.Context, id string) (*Gist, *Response, er
189189
}
190190

191191
// TODO: remove custom Accept header when this API fully launches.
192-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
192+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
193193

194194
gist := new(Gist)
195195
resp, err := s.client.Do(ctx, req, gist)
@@ -211,7 +211,7 @@ func (s *GistsService) GetRevision(ctx context.Context, id, sha string) (*Gist,
211211
}
212212

213213
// TODO: remove custom Accept header when this API fully launches.
214-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
214+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
215215

216216
gist := new(Gist)
217217
resp, err := s.client.Do(ctx, req, gist)
@@ -233,7 +233,7 @@ func (s *GistsService) Create(ctx context.Context, gist *Gist) (*Gist, *Response
233233
}
234234

235235
// TODO: remove custom Accept header when this API fully launches.
236-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
236+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
237237

238238
g := new(Gist)
239239
resp, err := s.client.Do(ctx, req, g)
@@ -255,7 +255,7 @@ func (s *GistsService) Edit(ctx context.Context, id string, gist *Gist) (*Gist,
255255
}
256256

257257
// TODO: remove custom Accept header when this API fully launches.
258-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
258+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
259259

260260
g := new(Gist)
261261
resp, err := s.client.Do(ctx, req, g)
@@ -282,7 +282,7 @@ func (s *GistsService) ListCommits(ctx context.Context, id string, opt *ListOpti
282282
}
283283

284284
// TODO: remove custom Accept header when this API fully launches.
285-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
285+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
286286

287287
var gistCommits []*GistCommit
288288
resp, err := s.client.Do(ctx, req, &gistCommits)
@@ -354,7 +354,7 @@ func (s *GistsService) Fork(ctx context.Context, id string) (*Gist, *Response, e
354354
}
355355

356356
// TODO: remove custom Accept header when this API fully launches.
357-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
357+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
358358

359359
g := new(Gist)
360360
resp, err := s.client.Do(ctx, req, g)
@@ -376,7 +376,7 @@ func (s *GistsService) ListForks(ctx context.Context, id string) ([]*GistFork, *
376376
}
377377

378378
// TODO: remove custom Accept header when this API fully launches.
379-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
379+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
380380

381381
var gistForks []*GistFork
382382
resp, err := s.client.Do(ctx, req, &gistForks)

github/gists_test.go

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestGistsService_List_specifiedUser(t *testing.T) {
2323

2424
mux.HandleFunc("/users/u/gists", func(w http.ResponseWriter, r *http.Request) {
2525
testMethod(t, r, "GET")
26-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
26+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
2727
testFormValues(t, r, values{
2828
"since": since,
2929
})
@@ -48,7 +48,7 @@ func TestGistsService_List_authenticatedUser(t *testing.T) {
4848

4949
mux.HandleFunc("/gists", func(w http.ResponseWriter, r *http.Request) {
5050
testMethod(t, r, "GET")
51-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
51+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
5252
fmt.Fprint(w, `[{"id": "1"}]`)
5353
})
5454

@@ -79,7 +79,7 @@ func TestGistsService_ListAll(t *testing.T) {
7979

8080
mux.HandleFunc("/gists/public", func(w http.ResponseWriter, r *http.Request) {
8181
testMethod(t, r, "GET")
82-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
82+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
8383
testFormValues(t, r, values{
8484
"since": since,
8585
})
@@ -106,7 +106,7 @@ func TestGistsService_ListStarred(t *testing.T) {
106106

107107
mux.HandleFunc("/gists/starred", func(w http.ResponseWriter, r *http.Request) {
108108
testMethod(t, r, "GET")
109-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
109+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
110110
testFormValues(t, r, values{
111111
"since": since,
112112
})
@@ -131,7 +131,7 @@ func TestGistsService_Get(t *testing.T) {
131131

132132
mux.HandleFunc("/gists/1", func(w http.ResponseWriter, r *http.Request) {
133133
testMethod(t, r, "GET")
134-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
134+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
135135
fmt.Fprint(w, `{"id": "1"}`)
136136
})
137137

@@ -160,7 +160,7 @@ func TestGistsService_GetRevision(t *testing.T) {
160160

161161
mux.HandleFunc("/gists/1/s", func(w http.ResponseWriter, r *http.Request) {
162162
testMethod(t, r, "GET")
163-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
163+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
164164
fmt.Fprint(w, `{"id": "1"}`)
165165
})
166166

@@ -200,7 +200,7 @@ func TestGistsService_Create(t *testing.T) {
200200
json.NewDecoder(r.Body).Decode(v)
201201

202202
testMethod(t, r, "POST")
203-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
203+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
204204
if !reflect.DeepEqual(v, input) {
205205
t.Errorf("Request body = %+v, want %+v", v, input)
206206
}
@@ -253,7 +253,7 @@ func TestGistsService_Edit(t *testing.T) {
253253
json.NewDecoder(r.Body).Decode(v)
254254

255255
testMethod(t, r, "PATCH")
256-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
256+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
257257
if !reflect.DeepEqual(v, input) {
258258
t.Errorf("Request body = %+v, want %+v", v, input)
259259
}
@@ -308,7 +308,7 @@ func TestGistsService_ListCommits(t *testing.T) {
308308

309309
mux.HandleFunc("/gists/1/commits", func(w http.ResponseWriter, r *http.Request) {
310310
testMethod(t, r, "GET")
311-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
311+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
312312
testFormValues(t, r, nil)
313313
fmt.Fprint(w, `
314314
[
@@ -356,7 +356,7 @@ func TestGistsService_ListCommits_withOptions(t *testing.T) {
356356

357357
mux.HandleFunc("/gists/1/commits", func(w http.ResponseWriter, r *http.Request) {
358358
testMethod(t, r, "GET")
359-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
359+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
360360
testFormValues(t, r, values{
361361
"page": "2",
362362
})
@@ -485,7 +485,7 @@ func TestGistsService_Fork(t *testing.T) {
485485

486486
mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) {
487487
testMethod(t, r, "POST")
488-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
488+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
489489
fmt.Fprint(w, `{"id": "2"}`)
490490
})
491491

@@ -506,7 +506,7 @@ func TestGistsService_ListForks(t *testing.T) {
506506

507507
mux.HandleFunc("/gists/1/forks", func(w http.ResponseWriter, r *http.Request) {
508508
testMethod(t, r, "GET")
509-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
509+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
510510
testFormValues(t, r, nil)
511511
fmt.Fprint(w, `
512512
[

github/git_blobs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func (s *GitService) GetBlob(ctx context.Context, owner string, repo string, sha
3232
}
3333

3434
// TODO: remove custom Accept header when this API fully launches.
35-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
35+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
3636

3737
blob := new(Blob)
3838
resp, err := s.client.Do(ctx, req, blob)
@@ -67,7 +67,7 @@ func (s *GitService) CreateBlob(ctx context.Context, owner string, repo string,
6767
}
6868

6969
// TODO: remove custom Accept header when this API fully launches.
70-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
70+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
7171

7272
t := new(Blob)
7373
resp, err := s.client.Do(ctx, req, t)

github/git_blobs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ func TestGitService_GetBlob(t *testing.T) {
2121

2222
mux.HandleFunc("/repos/o/r/git/blobs/s", func(w http.ResponseWriter, r *http.Request) {
2323
testMethod(t, r, "GET")
24-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
24+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
2525

2626
fmt.Fprint(w, `{
2727
"sha": "s",
@@ -90,7 +90,7 @@ func TestGitService_CreateBlob(t *testing.T) {
9090
json.NewDecoder(r.Body).Decode(v)
9191

9292
testMethod(t, r, "POST")
93-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
93+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
9494

9595
want := input
9696
if !reflect.DeepEqual(v, want) {

github/git_commits.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ package github
88
import (
99
"context"
1010
"fmt"
11-
"strings"
1211
"time"
1312
)
1413

@@ -70,8 +69,8 @@ func (s *GitService) GetCommit(ctx context.Context, owner string, repo string, s
7069
}
7170

7271
// TODO: remove custom Accept headers when APIs fully launch.
73-
acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
74-
req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
72+
//acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
73+
//req.Header.Set("Accept", strings.Join(acceptHeaders, ", "))
7574

7675
c := new(Commit)
7776
resp, err := s.client.Do(ctx, req, c)
@@ -127,7 +126,7 @@ func (s *GitService) CreateCommit(ctx context.Context, owner string, repo string
127126
}
128127

129128
// TODO: remove custom Accept header when this API fully launches.
130-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
129+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
131130

132131
c := new(Commit)
133132
resp, err := s.client.Do(ctx, req, c)

github/git_commits_test.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,17 @@ import (
1111
"fmt"
1212
"net/http"
1313
"reflect"
14-
"strings"
1514
"testing"
1615
)
1716

1817
func TestGitService_GetCommit(t *testing.T) {
1918
client, mux, _, teardown := setup()
2019
defer teardown()
2120

22-
acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
21+
//acceptHeaders := []string{mediaTypeGitSigningPreview, mediaTypeGraphQLNodeIDPreview}
2322
mux.HandleFunc("/repos/o/r/git/commits/s", func(w http.ResponseWriter, r *http.Request) {
2423
testMethod(t, r, "GET")
25-
testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
24+
//testHeader(t, r, "Accept", strings.Join(acceptHeaders, ", "))
2625
fmt.Fprint(w, `{"sha":"s","message":"m","author":{"name":"n"}}`)
2726
})
2827

@@ -60,7 +59,7 @@ func TestGitService_CreateCommit(t *testing.T) {
6059
json.NewDecoder(r.Body).Decode(v)
6160

6261
testMethod(t, r, "POST")
63-
testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
62+
//testHeader(t, r, "Accept", mediaTypeGraphQLNodeIDPreview)
6463

6564
want := &createCommit{
6665
Message: input.Message,

github/git_refs.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (s *GitService) GetRef(ctx context.Context, owner string, repo string, ref
6464
}
6565

6666
// TODO: remove custom Accept header when this API fully launches.
67-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
67+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
6868

6969
r := new(Reference)
7070
resp, err := s.client.Do(ctx, req, r)
@@ -98,7 +98,7 @@ func (s *GitService) GetRefs(ctx context.Context, owner string, repo string, ref
9898
}
9999

100100
// TODO: remove custom Accept header when this API fully launches.
101-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
101+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
102102

103103
var rawJSON json.RawMessage
104104
resp, err := s.client.Do(ctx, req, &rawJSON)
@@ -155,7 +155,7 @@ func (s *GitService) ListRefs(ctx context.Context, owner, repo string, opt *Refe
155155
}
156156

157157
// TODO: remove custom Accept header when this API fully launches.
158-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
158+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
159159

160160
var rs []*Reference
161161
resp, err := s.client.Do(ctx, req, &rs)
@@ -181,7 +181,7 @@ func (s *GitService) CreateRef(ctx context.Context, owner string, repo string, r
181181
}
182182

183183
// TODO: remove custom Accept header when this API fully launches.
184-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
184+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
185185

186186
r := new(Reference)
187187
resp, err := s.client.Do(ctx, req, r)
@@ -207,7 +207,7 @@ func (s *GitService) UpdateRef(ctx context.Context, owner string, repo string, r
207207
}
208208

209209
// TODO: remove custom Accept header when this API fully launches.
210-
req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
210+
//req.Header.Set("Accept", mediaTypeGraphQLNodeIDPreview)
211211

212212
r := new(Reference)
213213
resp, err := s.client.Do(ctx, req, r)

0 commit comments

Comments
 (0)