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

Use contractless resolver without setting default values for missing properties #1085

Closed
barakakha opened this issue Oct 19, 2020 · 7 comments · Fixed by #1095
Closed

Use contractless resolver without setting default values for missing properties #1085

barakakha opened this issue Oct 19, 2020 · 7 comments · Fixed by #1095
Assignees
Milestone

Comments

@barakakha
Copy link

i'm trying to deserialize dictionary of <string, object> to a class. when some of the properties in the class are not in the serialized dictionary the deserialization is setting the default values for those properties.

is there a way to avoid that? maybe with some custom formatter\resolver?

@pCYSl5EDgo
Copy link
Contributor

@barakakha
There is no way to avoid that unless you implement the custom formatter for yourself.

@AArnott
May I work on this issue?

@AArnott AArnott added this to the v2.3 milestone Oct 24, 2020
@AArnott
Copy link
Collaborator

AArnott commented Oct 24, 2020

This sounds like a subset of #1074. Yes, if you can do it for mpc and dynamic resolvers, for map- and array-encoded objects, IMO this is a good change. Thanks for volunteering, @pCYSl5EDgo!

We should target the develop branch (not master) since it's a breaking change.

I don't think @neuecc will have any objection, but mentioning him here as FYI.

@pCYSl5EDgo
Copy link
Contributor

pCYSl5EDgo commented Oct 25, 2020

The solution PR can be splitted into 2 parts (mpc.exe and DynamicResolver).
Should I create unified 1 PR or divided 2 PRs?

EDIT

2 draft PR for review and 1 release PR seem good.
#1091 Dynamic
#1092 mpc.exe

@AArnott
Copy link
Collaborator

AArnott commented Oct 25, 2020

I'd prefer that they come as one PR, since we always want mpc and dynamic resolvers to have the same behavior.

@AArnott
Copy link
Collaborator

AArnott commented Oct 25, 2020

It looks like you're keeping them separate for purposes of review, and then you'll combine them, yes? If so, that's fine.

@pCYSl5EDgo
Copy link
Contributor

pCYSl5EDgo commented Oct 25, 2020

Yes for the review.
And I will combine them.

pCYSl5EDgo added a commit to pCYSl5EDgo/MessagePack-CSharp that referenced this issue Oct 27, 2020
…rp#1092

commit d7a50b9
Merge: 02ae418 5a6cda6
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 09:33:45 2020 +0900

    Merge remote-tracking branch 'upstream/develop' into solution#1085-mpc

commit 02ae418
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 09:25:20 2020 +0900

    Update: Loop demonstration

commit d84ae75
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 09:24:31 2020 +0900

    Change: drop deserialized value -> reader.Skip()

commit 9b0d4a2
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 00:27:10 2020 +0900

    Fix: remove unused boolean local variables

commit fdfabeb
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 00:00:28 2020 +0900

    Update: Make the same as Dynamic

commit bef4692
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 19:37:11 2020 +0900

    Add test project

commit a8fac80
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 18:55:27 2020 +0900

    Add types to sandbox

commit 6ffc3c3
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 18:45:40 2020 +0900

    Update: string-key mpc.exe

commit 44819e6
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 18:05:24 2020 +0900

    Update: int-key mpc.exe

commit 0a2fef4
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 12:12:57 2020 +0900

    Fix: var -> global::MessagePack.IFormatterResolver

commit 086aa11
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 12:05:21 2020 +0900

    Fix: Line Feed

commit 39d3d08
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 12:03:37 2020 +0900

    Fix: space

commit c57f423
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 12:00:32 2020 +0900

    Change: var to globall::
    Revert: DepthStep position
    Revert: }#> -> } #>

commit de6fd23
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sat Oct 24 11:04:44 2020 +0900

     fix CRLF

commit 4b6ae7c
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sat Oct 24 10:59:50 2020 +0900

    Change the format to decrease template part lines.

    Change the iterator `i` type from `int` to `var`.

commit 95f41ad
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Fri Oct 23 21:03:54 2020 +0900

    This is a cherry-pick of MessagePack-CSharp#1074.
    This is a refactoring of int-key mpc.exe tt file.
pCYSl5EDgo added a commit to pCYSl5EDgo/MessagePack-CSharp that referenced this issue Oct 27, 2020
…rp#1091

commit 5fbf110
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 18:12:45 2020 +0900

    make BuildDeserialize easy to understand

commit 292badc
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 13:47:48 2020 +0900

    Update: Rename LocalField -> LocalVariable

commit 007e338
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 13:12:38 2020 +0900

    Add test code for setter call after explicit constructor

commit 5181801
Merge: 5948fc0 5a6cda6
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Mon Oct 26 12:59:36 2020 +0900

    Merge branch 'develop' of https://github.com/neuecc/MessagePack-CSharp into solution#1085-Dynamic

commit 5948fc0
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 21:18:12 2020 +0900

    Add tests

commit 96aaa6a
Author: pCYSl5EDgo <pCYSl5EDgo@yahoo.co.jp>
Date:   Sun Oct 25 20:25:44 2020 +0900

    Update: DynamicObjectResolver
@pCYSl5EDgo
Copy link
Contributor

I think this issue can be closed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants