fastmail / Ix

automatic generation of JMAP-style APIs
GNU General Public License v2.0
10 stars 5 forks source link

Result references #107

Closed rjbs closed 6 years ago

rjbs commented 6 years ago

The JMAP core spec recently added the ability for the arguments to the nth method call to be computed server-side by looking at the results of the (n-x)th method call. This branch implements that.

During handle_calls, each call has its args passed to expand_backrefs, which looks for #arg-style names and expands them using the result reference algorithm. Failure to expand a backref causes the method to fail early. We provide terrific error messages.

This branch includes a small implementation of the JSON Pointer, with the * behavior added by JMAP core.