From 18fa12a6bd69b2cef44c1cac0b994ba111155ff3 Mon Sep 17 00:00:00 2001 From: Jonathan Moody <103143855+moodyjon@users.noreply.github.com> Date: Fri, 28 Oct 2022 09:31:10 -0400 Subject: [PATCH] Elaborate comment on jsonPatchingCodec. --- server/session.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/server/session.go b/server/session.go index 8b12cd4..03e2254 100644 --- a/server/session.go +++ b/server/session.go @@ -426,8 +426,11 @@ type serverResponse struct { } // jsonPatchingCodec is able to intercept the JSON requests/responses -// and tweak them. Currently it appears we need to add a -// "jsonrpc": "1.0" or "jsonrpc": "2.0" to make the client happy. +// and tweak them. Currently, it appears we need to make several changes: +// 1) add "jsonrpc": "2.0" (or "jsonrpc": "1.0") in response +// 2) add newline to frame response +// 3) add "params": [] when "params" is missing +// 4) replace params ["arg1", "arg2", ...] with [["arg1", "arg2", ...]] type jsonPatchingCodec struct { conn net.Conn inBuffer *bytes.Buffer