Yep.. of course :)
Since many of us will be implementing JSON-RPC in HTTP servers, there
may be a small implementation issue with this, since most HTTP servers
are coded so that all requests return some kind of response.
I think that returning response headers + 204 (No content) meets the
intent for notifications, so MUST NOT is a bit strong here. SHOULD NOT
would be preferable, IMO.
- Jim Washington
204 (No content) Stays *OK* with the MUST-NOT, since 204 header is an
HTTP (transport) concept, the actual json-rpc doesn't return any data.
My 2c
LP
regards,
Roland
> We should try to have this finalized by 2/29 (Friday).
no, definietely not. that's too early, and there are too many bugs in
the so-called "release candidate".
> Are there any other
> comments / objections with the current 1.2 RC 1 spec in its current form?
yes, there are. plenty of them.
there was a discussion some time ago about my 1.2-proposal ("without
version-field") vs. my 2.0-proposal ("with version-field"). As far as I
know, the version-field "won". but if we use a version-field, we should
also clean-up some other things, like I suggested in my 2.0-proposal,
but which has not been done in "1.2 RC 1".
- first of all, the changes that have been made to (my) 1.2-proposal which
resulted in the "1.2 RC 1" are incomplete and inconsistent, and a
clean-up is really necessary (e.g. chapter 3 "compatibility" is
completely outdated).
- there has been the suggestion to rename the "version"-field
to "jsonrpc", which I think is sensible.
- the "version"-field in the response is redundant. this group should
decide if it should be necessary, omitted or optional.
- the error-object should look differently.
- most of the members here agreed that some empty fields may be omitted.
but the "1.2 RC 1" doesn't contain this.
- should it be called 1.2 or 2.0?
I'll modify the "1.2 RC 1" the next days (or create an own version, if
you wish) according to this.
regards,
Roland
> Can we change notifications so that we are not calling them
> unreliable?
why? you cannot rely on notifications.
of course you can propose an other formulation, but the meaning should
stay the same. It's unreliable in the same way as e.g. UDP is.
> As any number of
> things could happen transport wise, routing wise, exception wise, that
> make regular requests just as 'unreliable'.
no. of course, regular requests can get lost, but you can notice this!
and thats a *big difference*. with notifications, you CANNOT DETECT ERRORS
(e.g. lost packets, wrong calls etc.).
regards,
Roland
Wording is correct, this is the same difference between tcp and udp.
Network transmissions are unreliable by essence.
Network wise, please think the other way : getting error notification is
the only thing that makes a protocol 'reliable' so if you do not respond
ever to a message, your protocol is inherently 'unreliable' as the
network transmission is.
LP
No, it's not a notification -- it's not even valid JSON-RPC, since
"params" must be an JSON-Array or -Object.
Of course, it could be discussed how a server should handle invalid
JSON-RPC (of if it should handle it at all) and how far it should
"guess" what it was meant to be. But I *strongly* prefer that the
server should *not* handle it at all -- everything else could cause
strange behaviour. So, the example is *correct*.
regards,
Roland
Hi,I am wondering if this example is correct:--> {"jsonrpc": "2.0", "method": 1, "params": "bar"}<-- {"jsonrpc": "2.0", "error": {"code": -32600, "message": "InvalidRequest."}, "id": null}Since the request has no "id" (but is valid JSON so it can be parsed),it's a notification and should not receive a response.No, it's not a notification -- it's not even valid JSON-RPC, since
"params" must be an JSON-Array or -Object.
> That would seem to contradict "Every Request, except Notifications,
> MUST be replied to with a Response."
No. The example string
{"jsonrpc": "2.0", "method": 1, "params": "bar"}
is neither a Request, nor a Notification -- is not even valid JSON-RPC!
It's the same for e.g.
{"jsonrpc:" "2.0", "foo": "bar"}
Maybe the first example it was *meant* to be a notification, but the
server must not guess what the user possibly meant...
regards,
Roland
Not sure this is would be worth the complication, especially because of what it could become with extensions or future versions. But for the collisions the lack of it could cause with 1.0 clients, I would skip the field entirely from the spec. There are those of us who have systems sending messages back and forth between our own clients/servers who could skip the field entirely, as we are purely "2.0" already.
Fact is, that the field is not intended to differentiate 2.0 from 1.0 but 2.0 from 2.3 and 3.0 and .. it eventually makes a difference from 1.0 but the field is a little more future oriented. This is why we settled to the importance of a version field. My O.O2€ Lo.
O.O2€ is worth more than my $0.02 :)
That might not last :) but IANAE(conomist)
So the field would be used to represent whatever extensions (and behaviors) the client desires?
Should the server reject handling of extensions it does not recognize? Should the server attempt handling of versions greater than it can recognize? The official spec version would best be required as the first string descriptor?
The server MUST behave as expected by the JSON-RPC Major.minor Version specs.The server MAY be able to handle previous versions requests, and MUST be able if so, to respond in the appropriate dialect.