-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return single element array with JSON-RPC is impossible? #422
Comments
This was apparently done in the very first version of the |
I guess that replacing Lines 393 to 402 in ca704a9
with encode_handler_payload({response, ErlStruct}, ID, json) ->
StructStr = json2:encode({struct, [
{result, ErlStruct},
{id, ID},
{"jsonrpc", "2.0"}
]}),
{ok, StructStr};
encode_handler_payload({response, [ErlStruct]}, ID, haxe) ->
encode_handler_payload({response, ErlStruct}, ID, haxe);
encode_handler_payload({response, ErlStruct}, ID, haxe) ->
StructStr = [$h, $x, $r | haxe:encode(ErlStruct)],
{ok, StructStr}.
will fix the issue but breaks backward compatibility at the same time. |
Right, the backward compatibility issue is the problem with changing this. |
When we have a method that returns list of structs, depending on the element count we will get completely different results:
The question is why encode_handler_payload unwraps single-element lists?
The text was updated successfully, but these errors were encountered: