From e9b230fb08404501d3eae18e30fec933dab270fc Mon Sep 17 00:00:00 2001 From: Andrew Benton Date: Wed, 11 Dec 2024 17:04:04 -0800 Subject: [PATCH] fix(rpc): mark some fields as omitempty Resolves https://github.com/riza-io/mcp-go/issues/12 --- rpc.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpc.go b/rpc.go index 2cca0a5..a247493 100644 --- a/rpc.go +++ b/rpc.go @@ -8,10 +8,10 @@ type Stream interface { } type Message struct { - ID *json.Number `json:"id"` + ID *json.Number `json:"id,omitempty"` JsonRPC *string `json:"jsonrpc"` - Method *string `json:"method"` - Params *json.RawMessage `json:"params"` + Method *string `json:"method,omitempty"` + Params *json.RawMessage `json:"params,omitempty"` Result *json.RawMessage `json:"result,omitempty"` Error *ErrorDetail `json:"error,omitempty"` }