mirage / ocaml-rpc

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

pythongen: allow optional fields of structs to be absent #89

Closed gaborigloi closed 6 years ago

gaborigloi commented 6 years ago

Previously the generated python code failed in the typechecking Python code when an optional field wasn't present in the Python dictionary. Now we only typecheck the optional field if it is actually there in the dict.

Signed-off-by: Gabor Igloi gabor.igloi@citrix.com

gaborigloi commented 6 years ago

I've tested it on some code that was previously failing, and now it works with these changes. I wasn't sure whether to include the generated OASIS changes.

gaborigloi commented 6 years ago

Basically this is equivalent to this change: https://github.com/xapi-project/xapi-storage/pull/79/files#diff-9aff33d7c53066ba28c1262c277b9cd6R49 in https://github.com/xapi-project/xapi-storage/pull/79