-
Notifications
You must be signed in to change notification settings - Fork 53
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
Duplicate key allowed in map #39
Comments
I would like to see this change merged. Is there any update for this issue? @dumbbell? |
Thanks for the direct ping, I don't get other notifications apparently... After looking at the patch, it needs some improvements. For instance, it only works if the key is a scalar in |
@dumbbell Is there an update on this issue? Anything that can be done to help with this? |
Thank you for the ping, I completely forgot about this and missed again the latest change made by @slezakattack... Working on this right now! |
Awesome! Thank you. Any chance that could be added to a release? |
Yes. I'm waiting a day or two for answers on other issues/pull requests, then I will cut a release. |
This brings several bug fixes, including one which is a change of behavior: * @slezakattack implemented key deduplication in the construction of mappings, both when using proplists and maps (#39, #40). * Report a parsing error if a block collection is unfinished when the end of the document is reached; e.g. when a `]` or `}` character is missing (#43, #50). * Fix parsing of indented block scalar when they are finished by a document or directives end marker (#41, #51). @kianmeng also fixed several typos (#47). The Rebar configuration was updated to work with recent versions. While working on that, the CI was switched from Travis to GitHub Actions. Thank you to all contributors for their reports & patches!
@flurin: I just published yamerl 0.9.0 to Hex.pm. Thank you for your patience! |
Excellent, thank you! |
Oh no! I realize I'm late to the party here but we were relying on the duplicate key "feature" when in detailed_const mode to (ab)use the yaml syntax and create a much (c)leaner dsl for our purposes. Is there any chance that you would consider wrapping these new changes under a configuration switch, to still support the old behavior while keeping the new behavior as default? Something like I feel that it is reasonable in detailed_const mode to support invalid yaml. As I see it this provides a complete view of the document even if it is invalid in this way, which the developer can use or discard as needed. |
Yes, I can introduce that option, @bobkocisko. I filed an issue for that (#52). |
Thank you! |
According to the YAML spec (https://yaml.org/spec/1.2/spec.html#id2802432), one of "maps" properties is to possess unique keys.
Discovered a bug that yamerl allows multiple keys when map is proplist and/or {detailed_constr, true} is set.
I have a PR to address the bug along with a test coming soon.
The text was updated successfully, but these errors were encountered: