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

Enable deserialization constructors to use parameter names that match their property names #1054

Merged
merged 1 commit into from
Sep 25, 2020

Conversation

nabeelsherazi
Copy link

Hi! I was able to clean up the commits for the fixes I developed for the issue where MPC wasn't able to de/serialize objects with string key names that weren't the same as the member names. I believe this fixes issue #1016, and indeed, in my own use case, I am now able to successfully de/serialize objects with these characteristics. These changes do not break any existing behavior (see screenshot of all tests passing), and I have written a new test to check coverage of this case as well, which passes.

Let me know if everything looks good or if there's anything you want me to change.

image

@AArnott AArnott linked an issue Sep 24, 2020 that may be closed by this pull request
@AArnott AArnott changed the title Fixes #1016 and adds test Enable deserialization constructors to use parameter names that match their property names Sep 24, 2020
…ing key names and member names

Preferrs string key if both found. Tests are also added.
Copy link
Collaborator

@AArnott AArnott 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. @neuecc do you want to take a look as well?

@neuecc
Copy link
Member

neuecc commented Sep 25, 2020

Thank you, I think it's fine.

@AArnott AArnott added this to the v2.1 milestone Sep 25, 2020
@AArnott AArnott merged commit d21e84d into MessagePack-CSharp:master Sep 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for custom constructor parameter matching
3 participants