-
Notifications
You must be signed in to change notification settings - Fork 34
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 Map Entries get "squashed" to the last entry in Yaml src #12
Comments
I think the def parseYaml(baseConstructor: BaseConstructor = new Constructor()) = ???
def parseYamls(baseConstructor: BaseConstructor = new Constructor()) = ??? |
👍 - makes sense to change the signature regarding which constructor (or better put - the default behaviour) I maybe slightly green on understanding the YAML specifications but it occurs to me that "accepting" duplicate keys (in 1.1) is not good.. and in 1.2 is a MUST NOT allow duplicates. I could be wrong, but it leads to the "default" behaviour to be
and error on load if they are found.
I am about to push a PR to snakeyaml that introduces a config object to the constructor, instead of this overloaded method. |
I have reworked the change in snakeyaml and then reworked the impact to my fork.
|
If SnakeYAML is to provide a way to configure the way YAMLs are parsed, I'd rather have the configuration be done explicitly in the |
There is unexpected behaviour when dealing with duplicate maps inside a yaml file.
will be valid, and will only have a
{foo:{value:2}}
map (no error).The expected behaviour would be to have an exception // parsing error of some form.
The underlying behaviour is in snakeyaml, and it tracked and documented well here https://bitbucket.org/asomov/snakeyaml/issues/337/option-to-disallow-duplicate-keys.
snakeyaml
https://bitbucket.org/asomov/snakeyaml/pull-requests/10moultingyaml
at this commit rbuckland@08b41afThis issue is needed to track the outcome of the PR to
snakeyaml
.The text was updated successfully, but these errors were encountered: