-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Don't ignore additional entries in UntypedReflectDeserializerVisitor
#7112
Don't ignore additional entries in UntypedReflectDeserializerVisitor
#7112
Conversation
@SkiFire13 Alice is right that this could be a potentially breaking change. It was not an intended behavior but there may be users who happen to have a map with more than one entry (perhaps generated via a tool and left by accident). Could you add a Migration Guide section to the PR just indicating that affected users simply need to remove the second entry? This will help with the Migration Guide automation when putting together the release notes. |
1252d38
to
55c1382
Compare
I've added a Migration Guide section. I feel like the wording could be clearer though, let me know if you have any idea on how to improve it. |
I think the wording is okay (or at least good enough to build off when putting together the full guide haha). Thanks for adding it! |
55c1382
to
4e355d6
Compare
Rebased to solve the merge conflicts. |
@SkiFire13 can you rebase this? CI isn't detectingsome of the runs, and I think that a trivial rebase should fix it up. |
4e355d6
to
95c025c
Compare
I rebased but I'm not sure why CI decided to cancel the |
…eflectDeserializerVisitor
95c025c
to
66cfada
Compare
Fingers crossed let's go... |
Objective
Currently when
UntypedReflectDeserializerVisitor
deserializes aBox<dyn Reflect>
it only considers the first entry of the map, silently ignoring any additional entries. For example the following RON data:is successfully deserialized as a
f32
, completly ignoring the"u32": 1
part.Solution
UntypedReflectDeserializerVisitor
was changed to check if any other key could be deserialized, and in that case returns an error.Changelog
UntypedReflectDeserializer
now errors on malformed inputs instead of silently disgarding additional data.Migration Guide
If you were deserializing
Box<dyn Reflect>
values with multiple entries (i.e. entries other than"type": { /* fields */ }
) you should remove them or deserialization will fail.