json-rpc: fix malformed error response

This commit is contained in:
yosoyubik 2021-09-10 14:51:41 +02:00
parent 32cbb97b40
commit cd4b8e696e

View File

@ -40,9 +40,7 @@
%batch a+(turn bas.response response-to-json) %batch a+(turn bas.response response-to-json)
:: ::
%result %result
:- %o %- pairs:enjs:format
%- molt
^- (list [@t json])
:: FIXME: return 'id' as string, number or NULL :: FIXME: return 'id' as string, number or NULL
:: ::
:~ ['jsonrpc' s+'2.0'] :~ ['jsonrpc' s+'2.0']
@ -51,14 +49,16 @@
== ==
:: ::
%error %error
:- %o =, enjs:format
%- molt %- pairs
^- (list [@t json])
:~ ['jsonrpc' s+'2.0'] :~ ['jsonrpc' s+'2.0']
['id' ?~(id.response ~ s+id.response)] ['id' ?~(id.response ~ s+id.response)]
['code' n+code.response] ::
['message' s+message.response] :- 'error'
== %- pairs
:~ ['code' n+code.response]
['message' s+message.response]
== ==
== ==
:: ::
++ validate-request ++ validate-request