From e1a25d85488e0e4dfa76321904bcd9be3cce64ad Mon Sep 17 00:00:00 2001 From: Toby Padilla Date: Mon, 21 Apr 2025 13:12:56 -0600 Subject: [PATCH] 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. --- pkg/github/pullrequests.go | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pkg/github/pullrequests.go b/pkg/github/pullrequests.go index b1584c0e..1ecd209e 100644 --- a/pkg/github/pullrequests.go +++ b/pkg/github/pullrequests.go @@ -915,23 +915,38 @@ func CreatePullRequestReview(getClient GetClientFn, t translations.TranslationHe "description": "path to the file", }, "position": map[string]interface{}{ - "type": []string{"number", "null"}, + "anyOf": []interface{}{ + map[string]string{"type": "number"}, + map[string]string{"type": "null"}, + }, "description": "position of the comment in the diff", }, "line": map[string]interface{}{ - "type": []string{"number", "null"}, + "anyOf": []interface{}{ + map[string]string{"type": "number"}, + map[string]string{"type": "null"}, + }, "description": "line number in the file to comment on. For multi-line comments, the end of the line range", }, "side": map[string]interface{}{ - "type": []string{"string", "null"}, + "anyOf": []interface{}{ + map[string]string{"type": "string"}, + map[string]string{"type": "null"}, + }, "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)", }, "start_line": map[string]interface{}{ - "type": []string{"number", "null"}, + "anyOf": []interface{}{ + map[string]string{"type": "number"}, + map[string]string{"type": "null"}, + }, "description": "The first line of the range to which the comment refers. Required for multi-line comments.", }, "start_side": map[string]interface{}{ - "type": []string{"string", "null"}, + "anyOf": []interface{}{ + map[string]string{"type": "string"}, + map[string]string{"type": "null"}, + }, "description": "The side of the diff on which the start line resides for multi-line comments. (LEFT or RIGHT)", }, "body": map[string]interface{}{