GNU bug report logs - #72941
jsonrpc: Check if parameters are in line with the spec

Previous Next

Package: emacs;

Reported by: Felician Nemeth <nemethf <at> tmit.bme.hu>

Date: Sun, 1 Sep 2024 21:48:03 UTC

Severity: normal

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Felician Nemeth <nemethf <at> tmit.bme.hu>, João Távora <joaotavora <at> gmail.com>
Cc: daniel <at> dpettersson.net, 72941 <at> debbugs.gnu.org
Subject: bug#72941: jsonrpc: Check if parameters are in line with the spec
Date: Mon, 02 Sep 2024 14:26:22 +0300
> Cc: Daniel Pettersson <daniel <at> dpettersson.net>
> From: Felician Nemeth <nemethf <at> tmit.bme.hu>
> Date: Sun, 01 Sep 2024 18:26:02 +0200
> 
> I failed to implement an LSP extension to Eglot, because my function
> sent a required parameter as a string instead of an array containing a
> single element: the string.  In the end it turned out that this was my
> fault, because according to the JSON specification: "If present,
> parameters for the rpc call MUST be provided as a Structured
> value. Either by-position through an Array or by-name through an
> Object."  https://www.jsonrpc.org/specification#parameter_structures
> 
> Would it be possible to extend jsonrpc.el to check the params argument
> of jsonrpc-request, jsonrpc-notify, and jsonrpc-async-request whether it
> is a structured value?  And if it is not, then guide the programmer to
> the above URL with a warning.
> 
> Thank you.
> 
> (Background: <https://github.com/ocaml/ocaml-lsp/issues/1330>)

Adding João.




This bug report was last modified 221 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.