Skip to content

Commit 9fa582d

Browse files
tobySamMorrowDrums
authored andcommitted
fix: use anyOf instead of nullable type array
Windsurf is erroring on the `create_pull_request` tool because we're using an array of types to make fields nullable. This PR uses `anyOf` instead and should fix the issue.
1 parent 495c0cb commit 9fa582d

File tree

1 file changed

+20
-5
lines changed

1 file changed

+20
-5
lines changed

pkg/github/pullrequests.go

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -915,23 +915,38 @@ func CreatePullRequestReview(getClient GetClientFn, t translations.TranslationHe
915915
"description": "path to the file",
916916
},
917917
"position": map[string]interface{}{
918-
"type": []string{"number", "null"},
918+
"anyOf": []interface{}{
919+
map[string]string{"type": "number"},
920+
map[string]string{"type": "null"},
921+
},
919922
"description": "position of the comment in the diff",
920923
},
921924
"line": map[string]interface{}{
922-
"type": []string{"number", "null"},
925+
"anyOf": []interface{}{
926+
map[string]string{"type": "number"},
927+
map[string]string{"type": "null"},
928+
},
923929
"description": "line number in the file to comment on. For multi-line comments, the end of the line range",
924930
},
925931
"side": map[string]interface{}{
926-
"type": []string{"string", "null"},
932+
"anyOf": []interface{}{
933+
map[string]string{"type": "string"},
934+
map[string]string{"type": "null"},
935+
},
927936
"description": "The side of the diff on which the line resides. For multi-line comments, this is the side for the end of the line range. (LEFT or RIGHT)",
928937
},
929938
"start_line": map[string]interface{}{
930-
"type": []string{"number", "null"},
939+
"anyOf": []interface{}{
940+
map[string]string{"type": "number"},
941+
map[string]string{"type": "null"},
942+
},
931943
"description": "The first line of the range to which the comment refers. Required for multi-line comments.",
932944
},
933945
"start_side": map[string]interface{}{
934-
"type": []string{"string", "null"},
946+
"anyOf": []interface{}{
947+
map[string]string{"type": "string"},
948+
map[string]string{"type": "null"},
949+
},
935950
"description": "The side of the diff on which the start line resides for multi-line comments. (LEFT or RIGHT)",
936951
},
937952
"body": map[string]interface{}{

0 commit comments

Comments
 (0)