Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The problem with being clever and efficient is that you wind up having to write things like:

https://tools.ietf.org/html/rfc6868

Which is the kind of horror case of trying to do everything with clever little pieces of micro-format.

Now, the argument between XML and JSON is less of a big deal, except XML gets wishy-washy with whitespace in some ways which frustrate me. JSON number handling is screwy, it's true. I'd be tempted by CBOR if there were no other considerations - and I'd love to write a JMAP-over-CBOR or JMAP-over-ASN.1 or whatever at some point.

But you can very easily structure non-binary data in and out of JSON reliably, and everyone can get a parser which works. That's a big win. It's fine to disregard edge cases if you stay away from the edges - for example if you're serialising integers between 0 and 1000 then the fact that your datatype isn't 256 bit clean isn't a big deal. Same way you can use Newtonian physics when dealing with sprinters - but I don't think that race organisers have little concern for running a race correctly because they don't factor in relativity.

So we kept JMAP in the safe subset of JSON, because it's the best format for a whole lot of other reasons.



Specifically, JMAP explicitly requires I-JSON (https://tools.ietf.org/html/rfc8620#section-1.5).

If, for example, you try sending a request with duplicated keys in an object, the JMAP server will reject your request with the urn:ietf:params:jmap:error:notJSON error.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: