Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optional named params fix #126

Merged
merged 2 commits into from
Jul 12, 2018

Conversation

jonludlam
Copy link
Contributor

Fixes for named parameters that have option types.

Named parameters are marshalled into a dictionary, unless they are
option typed, where a 'None' is simply absent from the dictionary
and 'Some x' puts 'x' into the dict. When _all_ named parameters are
option typed and are _all_ 'None' the Client modules would previously
assume there weren't any named params and incorrectly omit the
dictionary.

Signed-off-by: Jon Ludlam <[email protected]>
Copy link
Collaborator

@gaborigloi gaborigloi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
We've discussed that the alternative fix in the server, indicating that none of the optional named params are present by the absence of the first dictionary, is incorrect, it does not work when the first unnamed param itself is a dictionary. Thus we must send an empty dictionary, if all the named params are optional and absent.

We should merge #117 soon to avoid having to do the same fix 3 times. 😅

@jonludlam
Copy link
Contributor Author

Agreed about #117 - we just need to schedule a chunk of time to look at the PR!

@jonludlam jonludlam merged commit 2525190 into mirage:master Jul 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants