3 Commits

Author SHA1 Message Date
Ulf Wiger 1619e3fb38 update deps 2025-04-07 11:36:15 +02:00
Ulf Wiger 2e2804c6aa fix encoding of solutions msg 2025-03-23 22:00:20 +01:00
Ulf Wiger ea7914048a report multiple solutions 2025-03-22 12:00:03 +01:00
3 changed files with 5 additions and 10 deletions
+1 -1
View File
@@ -3,7 +3,7 @@
{plugins, [rebar3_hex]}.
{deps, [
{gmserialization, {git, "https://git.qpq.swiss/QPQ-AG/gmserialization.git",
{ref, "ac64e01b0f"}}}
{ref, "bff07885fb"}}}
]}.
{xref_checks, [undefined_function_calls, undefined_functions,
+1 -1
View File
@@ -8,5 +8,5 @@
1},
{<<"gmserialization">>,
{git,"https://git.qpq.swiss/QPQ-AG/gmserialization.git",
{ref,"ac64e01b0f675c1a34c70a827062f381920742db"}},
{ref,"bff07885fb9fd328db4d1ae2cd27b118b57dd929"}},
0}].
+3 -8
View File
@@ -150,7 +150,7 @@ decode(MsgBin, ?PROTOCOL_JSON, Vsn) ->
#{ <<"method">> := Method
, <<"params">> := Params } ->
%% JSON-RPC notification
#{ notification => validate(decode_msg_(Method, Params), Vsn) };
#{ notification => #{ msg => validate(decode_msg_(Method, Params), Vsn) }};
#{ <<"id">> := Id
, <<"result">> := Result } ->
#{ reply => #{ id => Id
@@ -167,7 +167,7 @@ decode(MsgBin, ?PROTOCOL_JSON, Vsn) ->
encode(#{call := Req0}, P, V) ->
{Id, Req} = maps:take(id, Req0),
encode_request(Req, Id, P, V);
encode(#{notification := Msg}, P, V) ->
encode(#{notification := #{msg := Msg}}, P, V) ->
encode_msg(Msg, P, V);
encode(#{reply := Reply0}, P, V) when is_map(Reply0) ->
{Id, Reply} = maps:take(id, Reply0),
@@ -204,11 +204,7 @@ encode_reply(Reply, Id, ?PROTOCOL_JSON, _Vsn) ->
ok ->
#{ <<"jsonrpc">> => <<"2.0">>
, <<"id">> => Id
, <<"result">> => <<"ok">> };
continue ->
#{ <<"jsonrpc">> => <<"2.0">>
, <<"id">> => Id
, <<"result">> => <<"continue">> }
, <<"result">> => <<"ok">> }
end,
json_encode(Msg).
@@ -235,7 +231,6 @@ error_code(unknown_method ) -> -32601;
error_code(_ ) -> -32603. % internal error
decode_result(<<"ok">>, _) -> ok;
decode_result(<<"continue">>, _) -> continue;
decode_result(#{<<"connect_ack">> := #{ <<"protocol">> := P
, <<"version">> := V }}, Vsn) ->
Msg = #{connect_ack => #{ protocol => P