Skip to content

Commit 27dd1c4

Browse files
fixes ProjectV2FieldOption.ID type from int64 to string
1 parent 25561d3 commit 27dd1c4

File tree

4 files changed

+77
-20
lines changed

4 files changed

+77
-20
lines changed

github/github-accessors.go

Lines changed: 26 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/github-accessors_test.go

Lines changed: 34 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

github/projects.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ type ListProjectsOptions struct {
7979
//
8080
// GitHub API docs: https://docs.github.com/rest/projects/fields
8181
type ProjectV2FieldOption struct {
82-
ID *int64 `json:"id,omitempty"` // The unique identifier for this option.
83-
Name string `json:"name,omitempty"` // The display name of the option.
84-
Color string `json:"color,omitempty"` // The color associated with this option (e.g., "blue", "red").
85-
Description string `json:"description,omitempty"` // An optional description for this option.
82+
ID *string `json:"id,omitempty"` // The unique identifier for this option.
83+
Name *string `json:"name,omitempty"` // The display name of the option.
84+
Color *string `json:"color,omitempty"` // The color associated with this option (e.g., "blue", "red").
85+
Description *string `json:"description,omitempty"` // An optional description for this option.
8686
}
8787

8888
// ProjectV2Field represents a field in a GitHub Projects V2 project.

github/projects_test.go

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -185,8 +185,8 @@ func TestProjectsService_ListProjectFieldsForOrg(t *testing.T) {
185185
"dataType": "single_select",
186186
"url": "https://api.github.com/projects/1/fields/field1",
187187
"options": [
188-
{"id": 1, "name": "Todo", "color": "blue", "description": "Tasks to be done"},
189-
{"id": 2, "name": "In Progress", "color": "yellow"}
188+
{"id": "1", "name": "Todo", "color": "blue", "description": "Tasks to be done"},
189+
{"id": "2", "name": "In Progress", "color": "yellow"}
190190
],
191191
"created_at": "2011-01-02T15:04:05Z",
192192
"updated_at": "2012-01-02T15:04:05Z"
@@ -254,8 +254,8 @@ func TestProjectsService_ListProjectFieldsForUser(t *testing.T) {
254254
"dataType": "single_select",
255255
"url": "https://api.github.com/projects/1/fields/field1",
256256
"options": [
257-
{"id": 1, "name": "Todo", "color": "blue", "description": "Tasks to be done"},
258-
{"id": 2, "name": "In Progress", "color": "yellow"}
257+
{"id": "1", "name": "Todo", "color": "blue", "description": "Tasks to be done"},
258+
{"id": "2", "name": "In Progress", "color": "yellow"}
259259
],
260260
"created_at": "2011-01-02T15:04:05Z",
261261
"updated_at": "2012-01-02T15:04:05Z"
@@ -317,8 +317,8 @@ func TestProjectsService_GetProjectFieldForOrg(t *testing.T) {
317317
"dataType": "single_select",
318318
"url": "https://api.github.com/projects/1/fields/field1",
319319
"options": [
320-
{"id": 1, "name": "Todo", "color": "blue", "description": "Tasks to be done"},
321-
{"id": 2, "name": "In Progress", "color": "yellow"}
320+
{"id": "1", "name": "Todo", "color": "blue", "description": "Tasks to be done"},
321+
{"id": "2", "name": "In Progress", "color": "yellow"}
322322
],
323323
"created_at": "2011-01-02T15:04:05Z",
324324
"updated_at": "2012-01-02T15:04:05Z"
@@ -358,8 +358,8 @@ func TestProjectsService_GetProjectFieldForUser(t *testing.T) {
358358
"dataType": "single_select",
359359
"url": "https://api.github.com/projects/1/fields/field3",
360360
"options": [
361-
{"id": 1, "name": "Done", "color": "red", "description": "Done task"},
362-
{"id": 2, "name": "In Progress", "color": "yellow"}
361+
{"id": "1", "name": "Done", "color": "red", "description": "Done task"},
362+
{"id": "2", "name": "In Progress", "color": "yellow"}
363363
],
364364
"created_at": "2011-01-02T15:04:05Z",
365365
"updated_at": "2012-01-02T15:04:05Z"
@@ -588,10 +588,10 @@ func TestProjectV2Field_Marshal(t *testing.T) {
588588
URL: "https://api.github.com/projects/1/fields/field1",
589589
Options: []*ProjectV2FieldOption{
590590
{
591-
ID: Ptr(int64(1)),
592-
Name: "Todo",
593-
Color: "blue",
594-
Description: "Tasks to be done",
591+
ID: Ptr("1"),
592+
Name: Ptr("Todo"),
593+
Color: Ptr("blue"),
594+
Description: Ptr("Tasks to be done"),
595595
},
596596
},
597597
CreatedAt: &Timestamp{referenceTime},
@@ -606,7 +606,7 @@ func TestProjectV2Field_Marshal(t *testing.T) {
606606
"url": "https://api.github.com/projects/1/fields/field1",
607607
"options": [
608608
{
609-
"id": 1,
609+
"id": "1",
610610
"name": "Todo",
611611
"color": "blue",
612612
"description": "Tasks to be done"

0 commit comments

Comments
 (0)