Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Parameterless procedure invocation support #5

Closed
wants to merge 6 commits into
from

Conversation

Projects
None yet
2 participants
Contributor

evolchek commented Nov 1, 2011

No description provided.

tonyg commented on 9fb4543 Oct 17, 2011

Why do you want this change? Wouldn't it be just as easy to pass in [] where required instead of undefined?

Collaborator

evolchek replied Oct 18, 2011

This 'undefined' is provided by rfc4627_jsonrpc_http:parse_jsonrpc/5 when no params are specified in POST request:
https://github.com/mrspark/erlang-rfc4627/blob/9fb45432f9bc274690694f0a6933e354b3545955/src/rfc4627_jsonrpc_http.erl#L151
We may fix it there then.

Hmm, interesting. Reading the 1.1 JSON-RPC spec, it's hard to know what to do. So first off, I think you're right to fix it in rfc4627_jsonrpc_http:parse_jsonrpc/5, but the question then becomes: what should be done? My guess is that absent parameters should be treated like [], exactly as you suggested in this commit. The spec says that params is optional, but then says that if it has a value other than an array or object, the server must reject the request with an error, which seems a bit contradictory.

Collaborator

evolchek replied Nov 1, 2011

tonyg replied Nov 1, 2011

Thanks! Applied.

@tonyg tonyg closed this Nov 1, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment