Skip to content

Commit 8c68fcb

Browse files
committed
Expect no id in the refusal of an unreadable request id
## Motivation and Context The null id test of `test/mcp/server_test.rb` (#612) expects the refusal to carry `"id": null`, and the test of an id that is neither a string nor an integer (#613) only checks that `response[:id]` is nil. #615, merged after both, leaves the `id` member out of an error response whose request id cannot be read, so the first test fails on main (CI run 39142457575) and the second no longer pins the shape of the response. Both now expect a response without an `id` member; the library is unchanged. ## How Has This Been Tested? `test/mcp/server_test.rb`; against main the null id test fails as in CI.
1 parent 25fd02f commit 8c68fcb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎test/mcp/server_test.rb‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ def read_resource_request(uri)
19421942

19431943
response = @server.handle({ jsonrpc: "2.0", id: nil, method: "tools/call", params: { name: "count", arguments: {} } })
19441944

1945-
assert_equal({ jsonrpc: "2.0", id: nil, error: { code: -32600, message: "Invalid Request", data: "Request ID must not be null" } }, response)
1945+
assert_equal({ jsonrpc: "2.0", error: { code: -32600, message: "Invalid Request", data: "Request ID must not be null" } }, response)
19461946
assert_equal 0, calls
19471947
end
19481948

@@ -1996,7 +1996,7 @@ def read_resource_request(uri)
19961996
[3.14, true, false, { a: 1 }, [1]].each do |id|
19971997
response = @server.handle({ jsonrpc: "2.0", id: id, method: "ping" })
19981998

1999-
assert_nil response[:id], id.inspect
1999+
refute response.key?(:id), id.inspect
20002000
assert_equal(-32600, response[:error][:code], id.inspect)
20012001
end
20022002
end

0 commit comments

Comments
 (0)