Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit86fbc85

Browse files
authored
Fix handling nil values for optional string array parameters, (#194)
* Fix handling nil values for optional string array parameters,nil values should be equivalent to an empty string, currently we return an error but Claude passes nil for optional values.* lint fixes
1 parent56c1fce commit86fbc85

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

‎pkg/github/issues_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -468,9 +468,10 @@ func Test_CreateIssue(t *testing.T) {
468468
),
469469
),
470470
requestArgs:map[string]interface{}{
471-
"owner":"owner",
472-
"repo":"repo",
473-
"title":"Minimal Issue",
471+
"owner":"owner",
472+
"repo":"repo",
473+
"title":"Minimal Issue",
474+
"assignees":nil,// Expect no failure with nil optional value.
474475
},
475476
expectError:false,
476477
expectedIssue:&github.Issue{

‎pkg/github/server.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,8 @@ func OptionalStringArrayParam(r mcp.CallToolRequest, p string) ([]string, error)
238238
}
239239

240240
switchv:=r.Params.Arguments[p].(type) {
241+
casenil:
242+
return []string{},nil
241243
case []string:
242244
returnv,nil
243245
case []any:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp