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

Throw an exception on duplicate keys #750

Merged

Conversation

nuttytree
Copy link

Deserializing YAML with non-unique keys throws a YamlException. Resolves #536

@aaubry aaubry force-pushed the master branch 8 times, most recently from a0f8359 to 78b1ab3 Compare December 2, 2022 22:39
@EdwardCooke
Copy link
Collaborator

I would prefer if this was done as an option and defaulted to the current behavior. In the deserializer builder, we would add another method, something like ThrowExceptionOnDuplicateKeys. That would set the feature flag to enable or disable this code.

@nuttytree
Copy link
Author

I went without the option because duplicate keys are not valid YAML but I will update today to make it optional.

@EdwardCooke
Copy link
Collaborator

EdwardCooke commented Dec 8, 2022 via email

@nuttytree
Copy link
Author

Sorry about the delay in getting this PR updated, been sucked into multiple things at work. I have updated to make the duplicate key checking optional. Let me know if you don't like the naming.

@EdwardCooke EdwardCooke merged commit 6bf5b44 into aaubry:master Dec 14, 2022
@EdwardCooke
Copy link
Collaborator

Merged! Yay.

@aaubry
Copy link
Owner

aaubry commented Dec 14, 2022

This feature has been released in version 12.2.1.

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.

Deserializing is not handling non-unique keys correctly
3 participants