Minor JSON-RPC 2.0 spec deviation found during a pre-stable validation pass, verified against current main (75ac47d).
src/utils/json-rpc.ts:208-210:
// Body must be a non-null object or array.
if (!body || typeof body !== "object") {
return createJsonRpcError(null, PARSE_ERROR, "Parse error");
}
A body of 123, "str", true, or null is well-formed JSON — parsing succeeded — but is not a valid Request object. Per JSON-RPC 2.0, -32700 Parse error is reserved for "Invalid JSON was received by the server"; a structurally invalid (non-object) request should be -32600 Invalid Request.
Verified: 123, "str", and null all currently return -32700 instead of -32600.
The surrounding handling is otherwise spec-correct (checked: [] → -32600, [1,2] → array of per-item -32600, notification suppression → 202 empty body, truly malformed JSON → -32700), so the fix is just distinguishing "JSON.parse failed" from "parsed but not an object" at this boundary.
Minor JSON-RPC 2.0 spec deviation found during a pre-stable validation pass, verified against current
main(75ac47d).src/utils/json-rpc.ts:208-210:A body of
123,"str",true, ornullis well-formed JSON — parsing succeeded — but is not a valid Request object. Per JSON-RPC 2.0,-32700 Parse erroris reserved for "Invalid JSON was received by the server"; a structurally invalid (non-object) request should be-32600 Invalid Request.Verified:
123,"str", andnullall currently return-32700instead of-32600.The surrounding handling is otherwise spec-correct (checked:
[]→-32600,[1,2]→ array of per-item-32600, notification suppression → 202 empty body, truly malformed JSON →-32700), so the fix is just distinguishing "JSON.parse failed" from "parsed but not an object" at this boundary.