unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#72941: jsonrpc: Check if parameters are in line with the spec
@ 2024-09-01 16:26 Felician Nemeth
  2024-09-02 11:26 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Felician Nemeth @ 2024-09-01 16:26 UTC (permalink / raw)
  To: 72941; +Cc: Daniel Pettersson

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>)





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-12 11:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-01 16:26 bug#72941: jsonrpc: Check if parameters are in line with the spec Felician Nemeth
2024-09-02 11:26 ` Eli Zaretskii
2024-09-05 20:35   ` Daniel Pettersson
2024-09-13 17:13     ` Felician Nemeth
2024-09-28  8:47       ` Eli Zaretskii
2024-09-28 11:40         ` Daniel Pettersson
2024-10-02 11:41           ` Felician Nemeth
2024-10-12 11:21           ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).