mirage / ocaml-rpc

Light library to deal with RPCs in OCaml
ISC License
96 stars 31 forks source link

Fix marshalling of optional arguments #88

Closed jonludlam closed 6 years ago

jonludlam commented 6 years ago

Previously if an argument to an RPC call was a named optional value it would be unconditionally added to the dictionary of params and the optionness encoded by either passing an empty or one element Enum in the dict. This patch makes it more consistent with how optional record values are encoded - if 'None' the names argument is now omitted from the arg dict, and if 'Some' the value is unboxed from the Enum and put directly into the dict.

Signed-off-by: Jon Ludlam jonathan.ludlam@citrix.com

mseri commented 6 years ago

The build is failing with

 File "lib/rpc_lwt.ml", line 130, characters 21-44:
- Error: This expression has type Rpc.t but an expression was expected of type
-          'a Lwt.t
- Command exited with code 2.

but it's not immediately obvioous to me what is wrong.

UPDATE: oh yes, there are a few returns missing

mseri commented 6 years ago

Oops. I meant to squash them