On Fri, 24 Apr 2020, Ryan Joseph via fpc-pascal wrote:
On Apr 24, 2020, at 10:23 AM, Ryan Joseph <generic...@gmail.com> wrote:
Just tested on my language server and the problem is you provided a null error
key, which is not in the protocol.
I've never seen the fpjsonrpc unit before so I don't know where this got
inserted but it needs to be removed.
I think we need to override a method to remove the null error, like this:
function TLSPDispatcher.FormatResult(Const AClassName, AMethodName:
TJSONStringType;
Const Params,ID, Return : TJSONData) : TJSONData;
begin
Result:=TJSONObject.Create([
'result',Return,
TransactionProperty,ID.Clone
]);
if jdoJSONRPC2 in options then
TJSONObject(Result).Add('jsonrpc','2.0');
end;
I fixed TCustomJSONRPCDispatcher not to add a Null in case of V2. But V1 needs
it.
see https://www.jsonrpc.org/specification_v1
Committed in revision 45047.
Michael.
_______________________________________________
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal